Report a buyer's cancel request on a Sales Order
You call thissales:orders:self
const url = 'https://api.zentail.com/v1/salesOrder/1/buyerCancelRequest';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"channelCancelId":"example","status":"PENDING","requestTs":{},"respondByTs":"2026-04-15T12:00:00Z","items":[{"lineItemId":"example","quantity":1}],"refuseReasons":[{"code":"example","label":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.zentail.com/v1/salesOrder/1/buyerCancelRequest \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "channelCancelId": "example", "status": "PENDING", "requestTs": {}, "respondByTs": "2026-04-15T12:00:00Z", "items": [ { "lineItemId": "example", "quantity": 1 } ], "refuseReasons": [ { "code": "example", "label": "example" } ] }'Records a request the buyer made on the sales channel to cancel some or all of an order, keyed on channelCancelId, so the merchant can accept or refuse it in Zentail. Send it with status: PENDING first. A re-send changes nothing except refuseReasons, which are replaced until the merchant answers. Send CANCELLED or CLOSED once the channel settles the request; neither is ever undone. Read the merchant’s answer from decision. Every lineItemId is checked first, so one unknown line rejects the whole request with a 400 and writes nothing.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Zentail Order Number
Request Body
Section titled “Request Body”Place all of the cancel request details in a JSON object in the body of the request.
object
The unique identifier for the cancel request in the sales channel.
PENDING to report the request. Send CANCELLED once the channel cancels the units, or CLOSED once the request ends any other way. Neither is ever undone.
The time the buyer asked to cancel. In ISO-8601 format. Defaults to now.
The time the channel needs an answer by. In ISO-8601 format.
The line items and quantities being cancelled. Required to report a new request, and ignored once it exists.
object
The channel’s identifier for the line item, as sent in lineItemId when the sales order was created.
The quantity the buyer asked to cancel.
The reasons the channel accepts for refusing the request. Replaced on each send until the merchant answers.
object
The channel’s code for the reason, sent back to the channel when the merchant picks it.
The reason as the merchant should read it.
Responses
Section titled “ Responses ”Success
object
The unique identifier for the cancel request in Zentail
The unique identifier for the cancel request in the sales channel
PENDING while the channel waits for an answer, CANCELLED once the channel cancelled the units, CLOSED once it ended any other way
The time the buyer asked to cancel. In ISO-8601 format
The time the channel needs an answer by, if it set one. In ISO-8601 format
The line items and quantities the buyer asked to cancel
object
The reasons the channel accepts for refusing this request
object
The merchant’s answer in Zentail: ACCEPT, REFUSE, or null while unanswered
The code of the refuse reason the merchant picked, when the decision is REFUSE
The time the merchant answered. In ISO-8601 format
Example
{ "status": "PENDING", "decision": "ACCEPT"}Bad Request
object
Example
{ "errorCode": 400}Permission Denied
object
Example
{ "errorCode": 403}Not Found
object
Example
{ "errorCode": 404}Zentail Error
object
Example
{ "errorCode": 500}Zentail Error
object
Example
{ "errorCode": 503}