Update an order
const url = 'https://acme.mykreezalid.com/api/partners/v1/orders/1';const options = { method: 'PATCH', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"status":"accepted","fulfillment_status":"shipped","order_items":[{"id":4242}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://acme.mykreezalid.com/api/partners/v1/orders/1 \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "status": "accepted", "fulfillment_status": "shipped", "order_items": [ { "id": 4242 } ] }'Updates one of the orders received by your vendor account, typically its status or fulfillment_status. PUT /orders/{id} behaves the same. Send the order fields to change, at the top level of the body or wrapped in an order object. The order always stays yours. To update order items, send them in order_items (or items), each with the id of an existing item of this order; every item of the list is updated.
Only these order fields can be changed: status, fulfillment_status, tracking_number, shipping_carrier, refusal_reason, external_id, note, note_attributes, tags, meta_data; and on an order item: status, refusal_reason, external_id. Amounts (total, fees, payout, item prices) and every other field are read-only: a request carrying one is refused whole with HTTP status 403, and nothing is written.
status must be one of: draft, pending, new, accepted, shipped, service_provided, customer_confirmed, supplier_confirmed, declined, completed, failed, canceled. fulfillment_status must be empty or one of: started, scheduled, prepared, shipped, in_transit, available, delivered, executed, canceled, error. Any other value is refused with HTTP status 404.
When the order cannot be saved, the response still has HTTP status 200, with success: false. No notification is sent.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Order’s unique identifier
Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
acceptedExample
shippedOrder items to update, each identified by its id; only status, refusal_reason and external_id can be changed.
object
Example
4242Responses
Section titled “Responses”Success
object
Order updated, or Error. No update.
Example
{ "success": true, "message": "Order updated"}Missing or wrong API credentials, a field that cannot be changed (the message lists them), or a status change your vendor account is not allowed to make. The only allowed changes are: new to accepted or declined; accepted to canceled, shipped or service_provided; shipped or customer_confirmed to service_provided.
No order of yours has this ID, or status / fulfillment_status is not a valid value.