> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rmz.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Order

> Update the status of an existing order.

# Update Order

<div className="flex items-center gap-2 mb-4">
  <span className="px-2 py-1 bg-yellow-100 text-yellow-800 rounded text-sm font-mono font-bold">PUT</span>
  <code>/orders/{"{id}"}</code>
</div>

Updates an order's status. Use this to mark orders as shipped, delivered, completed, cancelled, or refunded.

<Snippet file="rmz-plus-required.mdx" />

## Authentication

<Snippet file="auth-bearer-header.mdx" />

## Headers

| Header          | Value                   | Required |
| --------------- | ----------------------- | -------- |
| `Authorization` | `Bearer YOUR_API_TOKEN` | Yes      |
| `Content-Type`  | `application/json`      | Yes      |

## Path Parameters

| Parameter | Type    | Required | Description  |
| --------- | ------- | -------- | ------------ |
| `id`      | integer | Yes      | The order ID |

## Request Body

| Parameter | Type    | Required | Description           |
| --------- | ------- | -------- | --------------------- |
| `status`  | integer | No       | New status code (1-6) |

### Status Codes

| Code | Status           |
| ---- | ---------------- |
| `1`  | Awaiting Payment |
| `2`  | Under Review     |
| `3`  | In Progress      |
| `4`  | Completed        |
| `5`  | Cancelled        |
| `6`  | Refunded         |

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://merchant-api.rmz.gg/shawarma/orders/78901" \
    -H "Authorization: Bearer YOUR_API_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"status": 3}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://merchant-api.rmz.gg/shawarma/orders/78901", {
    method: "PUT",
    headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ status: 3 })
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.put(
      "https://merchant-api.rmz.gg/shawarma/orders/78901",
      headers={
          "Authorization": "Bearer YOUR_API_TOKEN",
          "Content-Type": "application/json"
      },
      json={"status": 3}
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  $ch = curl_init("https://merchant-api.rmz.gg/shawarma/orders/78901");
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer YOUR_API_TOKEN",
      "Content-Type: application/json"
  ]);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["status" => 3]));
  $response = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>

## Success Response

```json theme={null}
{
  "message": "Order Has Been Updates",
  "data": null,
  "api": "rmz.shawarma",
  "timestamp": 1699999999
}
```

## Error Responses

| Code  | Description                             |
| ----- | --------------------------------------- |
| `400` | Invalid status transition               |
| `401` | Unauthorized — invalid or missing token |
| `404` | Order not found                         |
| `422` | Validation error — invalid status value |
