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. Order fields other than the ones listed below (for instance tracking_number or refusal_reason) are written as sent; the customer, the vendor and the payment-provider identities of the order cannot be changed and are ignored. 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.
New fulfillment status of the order.
Items of the order to update, each identified by its id; the other keys are written to that item. 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.
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).