Update an Order
PUT/api/orders/{id}
Headers
| Field | Type | Description |
|---|---|---|
| authtoken | String | Authentication token, generated from admin area |
Parameters
| Field | Type | Description |
|---|---|---|
| id | Number | Order unique ID |
| order_date | string | optional Optional Order date to update |
| status_id | number | optional Optional Status ID to update |
| note | string | optional Optional Note to update |
| items | Object[] | optional Optional replacement order lines, in the same shape GET /api/orders/:id/items returns. When present the existing lines are replaced; when absent the lines are left untouched. An empty array is rejected with a 400 instead of clearing the order. |
| items.title | String | Mandatory line title. A description is accepted instead. |
| items.description | String | optional Optional line description |
| items.quantity | Number | Mandatory quantity, numeric |
| items.rate | Number | Mandatory unit rate, numeric |
| items.unit_type | String | optional Optional unit type, maximum 20 characters |
| items.sort | Number | optional Optional display order. Defaults to the array position. |
| items.item_id | Number | optional Optional items library ID |
curl -X PUT "https://yoursite.com/api/orders/123" \
-H "authtoken: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "items.title": "...", "items.quantity": "...", "items.rate": "..." }' Success-Response:
HTTP/1.1 200 OK
{
"status": 200,
"messages": {"success": "Order update success"}
}