Skip to content

Update one of your orders

PATCH
/orders/{id}
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.

id
required
integer

Identifier of the order.

Example

4242
Media typeapplication/json
object
order

Optional wrapper: when present, the fields are read from it instead of the top level.

object
status

New status of the order.

string
Allowed values: draft pending new accepted shipped service_provided customer_confirmed supplier_confirmed declined completed failed canceled
fulfillment_status

New fulfillment status of the order.

string
nullable
Allowed values: started scheduled prepared shipped in_transit available delivered executed canceled error
order_items

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.

Array<object>
object
id
required
integer
key
additional properties
any

Example

{
"status": "accepted",
"fulfillment_status": "scheduled"
}

Outcome of the update.

Media typeapplication/json
object
success

Whether the order was saved.

boolean
message

Order updated on success, Error. No update. otherwise.

string

Example

{
"success": true,
"message": "Order updated"
}

No signed-in member.

Media typeapplication/json

Error body returned by the Front API when it refuses a request.

object
code

HTTP status code, repeated in the body.

integer
status
string
message

Human-readable reason.

string

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).