Create or cancel a return order on a Sales Order
You call thissales:orders:self
const url = 'https://api.zentail.com/v1/salesOrder/1/returnOrder';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"channelReturnId":"example","requestTs":{},"cancelled":true,"returnItems":[{"lineItemId":"example","quantity":1,"refundReason":"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/returnOrder \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "channelReturnId": "example", "requestTs": {}, "cancelled": true, "returnItems": [ { "lineItemId": "example", "quantity": 1, "refundReason": "example" } ] }'Creates a return order for a return the buyer requested on the sales channel, keyed on channelReturnId. A re-send of the same return changes nothing. Send cancelled: true once the channel cancels or rejects the return; it cancels the return order unless the seller has already completed or cancelled it in Zentail. 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 return details in a JSON object in the body of the request.
object
The unique identifier for the return in the sales channel. A re-send with the same value changes nothing.
The time the buyer requested the return. In ISO-8601 format. Defaults to now.
Send true once the channel cancels or rejects the return. It cancels an open return order. A return order the seller already completed or cancelled is left as it is.
The line items being returned. Required to create a return order, 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 being returned.
Why the buyer is returning the item.
Responses
Section titled “ Responses ”Success
object
The unqiue identifier for the return order in Zentail
The unqiue identifier for the return order in the sales channel
The time that the return order was requested. In ISO-8601 format
Indicates the return request has been cancelled
The time the seller completed the return in Zentail, or null while it is still open. In ISO-8601 format
The line items that makeup the return order
object
The unique identifier for this line item
The SKU that is being returned
The amount that is being returned
The original quantity that was ordered
The amount of payment that is being refunded
Examplegenerated
{ "returnOrderId": 1, "channelReturnId": "example", "requestTs": "2026-04-15T12:00:00Z", "cancelled": true, "completedTs": "2026-04-15T12:00:00Z", "returnItems": [ { "returnOrderItemId": 1, "SKU": "example", "quantity": 1, "originalQuantity": 1, "refundAmount": 1 } ]}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}