Update one of your orders
const url = 'https://acme.mykreezalid.com/front_api/v1/orders/4242';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"status":"accepted","fulfillment_status":"scheduled"}'};
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/front_api/v1/orders/4242 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "status": "accepted", "fulfillment_status": "scheduled" }'Updates an order of the signed-in member, who must be its customer or its vendor. PUT is accepted too and behaves the same. Send the fields to change, at the top level or wrapped in an order object. The customer may only set status to customer_confirmed. The vendor may set status to accepted, declined, shipped, service_provided, supplier_confirmed or canceled, and change fulfillment_status, tracking_number, shipping_carrier, refusal_reason, external_id, note, note_attributes, tags and meta_data; on items, status, refusal_reason and external_id. No amount can be changed. Any other field or status answers 403. Otherwise the response is 200 whether or not the order was saved: read success.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Identifier of the order.
Example
4242Request Bodyrequired
Section titled “Request Bodyrequired”object
Optional wrapper: when present, the fields are read from it instead of the top level.
object
New status of the order: customer_confirmed for the customer, the others for the vendor.
New fulfillment status of the order.
Vendor only. Items of the order to update, each identified by its id, with status, refusal_reason or external_id. items is accepted as an alias. Items that do not belong to the order are ignored.
object
Example
{ "status": "accepted", "fulfillment_status": "scheduled"}Responses
Section titled “Responses”Outcome of the update.
object
Whether the order was saved.
Order updated on success, Error. No update. otherwise.
Example
{ "success": true, "message": "Order updated"}No signed-in member, or a field or status the member may not change (the message names it).
Error body returned by the Front API when it refuses a request.
object
HTTP status code, repeated in the body.
Human-readable reason.
Example
{ "code": 403, "status": "error", "message": "Token not found in request"}The order does not exist, the signed-in member is neither its customer nor its vendor, or status or fulfillment_status holds an unknown value (the message lists the valid ones).