To update an existing order, send a PUT request to the endpoint with the order ID in the URL.
PUT /api/orders/98
Include the order details in the HTTP request body according to the specified Content-Type
. None of the fields are required.
By default, changing an order status via the API does not send email notifications. You can use these optional notification flags:
Parameter | Type | Description |
---|---|---|
notify_user |
string | Set to "1" to send notification to the customer |
notify_department |
string | Set to "1" to send notification to the order department |
notify_vendor |
string | Set to "1" to send notification to the vendor |
{ "status": "P", "notify_user": "1", "notify_department": "1", "notify_vendor": "1" }
This request sets the order status to P
(Processed) and sends email notifications to the customer, vendor, and order department.
{ "products": { "1": { "product_id": "12", "amount": "1" }, "3": { "product_id": "241", "amount": "1", "product_options": { "12": "44", "13": "48" } } } }
This request changes the products assigned to the order. The original order had one product with product_id=12
and two products with product_id=13
. After this update, the order will have one product with product_id=12
and one product with product_id=241
.
The product with ID 241 also has option variants selected:
products
object with a PUT request, you must specify all products that should be in the order. Any products not included in the request will be removed from the order. The same applies to product option variants.
{ "total": "100", "user_data": { "email": "customer@example.com", "b_firstname": "John", "b_lastname": "Doe", "s_firstname": "John", "s_lastname": "Doe" } }
This request:
total
and other parameters that would affect it (like discount
or subtotal_discount
) in the same request, the total
field will always take priority. You can specify total
, but not subtotal
in the same request.
{ "order_id": "98" }
Status Code | Description |
---|---|
200 OK |
Order updated successfully |
400 Bad Request |
Invalid request parameters |
404 Not Found |
Order with the specified ID does not exist |