> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.coi.co.il/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.coi.co.il/_mcp/server.

# Update an order

PATCH https://www.your-store.co.il/api/v1/orders/{id}
Content-Type: application/json

Status, paid, tracking number and notes - what the admin order screen changes. Requires `orders:write`.

Reference: https://docs.coi.co.il/orders/update-order

## Authentication

- `Authorization` header (bearer token, required) — An API key from the store's admin: חנות > API ומפתחות. Send it as `Authorization: Bearer coi_sk_...` (or `X-Api-Key: coi_sk_...`). Never in the URL - `?apikey=` is refused with 400.

## Request

### Path parameters

- `id` (integer, required)

### Body (application/json)

This endpoint expects an OrderUpdate.

- `status` (integer, optional) — One of the store's status ids (see `status.id` on orders; a wrong id is answered with the list).
- `paid` (boolean, optional)
- `trackingNumber` (string, optional, nullable) — null clears it. Shown in the admin order screen and in the status email.
- `adminNotes` (string, optional, nullable)
- `notifyCustomer` (boolean, optional, default: false) — Email the customer that the status changed (with the tracking number when there is one). Sent only when the status really changed, is not 1 or 2, the order has an email, and "notify customers of status changes" is on in the store settings. `customerNotified` in the answer says whether it was sent.

## Response

### 200

The updated order, plus `customerNotified`.

## Errors

### 400 Bad Request Error

The request is not valid - a field of the wrong type, a missing field, a bad parameter.

- `ok` (false, optional)
- `error` (ErrorError, optional)

### 401 Unauthorized Error

Missing, invalid, revoked or expired API key. The same answer for all of them.

- `ok` (false, optional)
- `error` (ErrorError, optional)

### 403 Forbidden Error

The key lacks the permission (`insufficient_scope`), or the site's plan does not include the API (`plan_required`).

- `ok` (false, optional)
- `error` (ErrorError, optional)

### 404 Not Found Error

No such row in this store (ids of another store are never found).

- `ok` (false, optional)
- `error` (ErrorError, optional)

### 429 Too Many Requests Error

More than 120 requests a minute with one key. Wait `Retry-After` seconds.

- `ok` (false, optional)
- `error` (ErrorError, optional)

## Types

### ErrorError

- `code` (string, optional) — Stable, machine-readable: `unauthorized`, `insufficient_scope`, `plan_required`, `invalid_field`, `invalid_parameter`, `invalid_json`, `json_required`, `not_found`, `method_not_allowed`, `nothing_to_update`, `plan_limit`, `email_taken`, `registration_disabled`, `rate_limited`, `too_many_failures`, `https_required`, `key_in_url`, `server_error`.
- `message` (string, optional) — What went wrong, in English, for a person.

## Examples

**Request**

```json
{
  "status": 7,
  "trackingNumber": "RR123456789IL",
  "notifyCustomer": true
}
```

**Response**

```json
{
  "data": {
    "adminNotes": null,
    "coupon": {
      "amount": -900,
      "code": "SUMMER",
      "description": "מבצע קיץ"
    },
    "createdAt": "2026-09-24T15:14:00+03:00",
    "customer": {
      "address": "הרצל 13 תל אביב",
      "email": "israel@example.com",
      "id": null,
      "name": "ישראל ישראלי",
      "phone": "0501234567"
    },
    "customerNotes": "להשאיר ליד הדלת",
    "customerNotified": true,
    "delivery": {
      "name": "משלוח: איסוף עצמי",
      "price": 0
    },
    "fields": [
      {
        "name": "שם מלא",
        "value": "ישראל ישראלי"
      },
      {
        "name": "עיר",
        "value": "תל אביב"
      }
    ],
    "id": 4203,
    "invoice": {
      "number": 10231,
      "url": "https://..."
    },
    "items": [
      {
        "name": "טלפון סלולרי 256GB",
        "options": [
          {
            "name": "צבע: שחור",
            "price": 600
          }
        ],
        "optionsPrice": 600,
        "price": 3000,
        "productId": 1180,
        "quantity": 1,
        "sku": "886886000028",
        "total": 3600,
        "unitName": null,
        "unitPrice": 3600,
        "vatFree": false
      }
    ],
    "newsletter": false,
    "number": 67,
    "paid": true,
    "payType": "credit_card",
    "payments": null,
    "paypalFee": null,
    "promotions": [
      {
        "amount": -360,
        "name": "הנחה על הסל",
        "productId": null
      }
    ],
    "status": {
      "id": 7,
      "name": "בדרך ללקוח"
    },
    "total": 2340,
    "trackingNumber": "RR123456789IL",
    "updatedAt": null,
    "vat": null
  },
  "ok": true
}
```

**SDK Code**

```python Orders_updateOrder_example
import requests

url = "https://www.your-store.co.il/api/v1/orders/1"

payload = {
    "status": 7,
    "trackingNumber": "RR123456789IL",
    "notifyCustomer": True
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Orders_updateOrder_example
const url = 'https://www.your-store.co.il/api/v1/orders/1';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"status":7,"trackingNumber":"RR123456789IL","notifyCustomer":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Orders_updateOrder_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://www.your-store.co.il/api/v1/orders/1"

	payload := strings.NewReader("{\n  \"status\": 7,\n  \"trackingNumber\": \"RR123456789IL\",\n  \"notifyCustomer\": true\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Orders_updateOrder_example
require 'uri'
require 'net/http'

url = URI("https://www.your-store.co.il/api/v1/orders/1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"status\": 7,\n  \"trackingNumber\": \"RR123456789IL\",\n  \"notifyCustomer\": true\n}"

response = http.request(request)
puts response.read_body
```

```java Orders_updateOrder_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://www.your-store.co.il/api/v1/orders/1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": 7,\n  \"trackingNumber\": \"RR123456789IL\",\n  \"notifyCustomer\": true\n}")
  .asString();
```

```php Orders_updateOrder_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://www.your-store.co.il/api/v1/orders/1', [
  'body' => '{
  "status": 7,
  "trackingNumber": "RR123456789IL",
  "notifyCustomer": true
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Orders_updateOrder_example
using RestSharp;

var client = new RestClient("https://www.your-store.co.il/api/v1/orders/1");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": 7,\n  \"trackingNumber\": \"RR123456789IL\",\n  \"notifyCustomer\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Orders_updateOrder_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "status": 7,
  "trackingNumber": "RR123456789IL",
  "notifyCustomer": true
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://www.your-store.co.il/api/v1/orders/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```