---
title: "Create or cancel a return order on a Sales Order"
method: POST
path: "/salesOrder/{orderNumber}/returnOrder"
tags: ["SalesOrder"]
---

# Create or cancel a return order on a Sales Order

`POST /salesOrder/{orderNumber}/returnOrder`

## Request

- Base URL: `https://api.zentail.com/v1`
- URL: `https://api.zentail.com/v1/salesOrder/{orderNumber}/returnOrder`
- Auth: API key in header `AUTHORIZATION`

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.

## Path parameters

- `orderNumber` number, required

## Request body

- ReturnOrderPostData
  - `channelReturnId` string, required: The unique identifier for the return in the sales channel. A re-send with the same value changes nothing.
  - `requestTs` string, date-time: The time the buyer requested the return. In [ISO-8601 format](/getting-started/api-basics/timestamps). Defaults to now.
  - `cancelled` boolean: 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.
  - `returnItems` ReturnOrderPostItem[]: The line items being returned. Required to create a return order, and ignored once it exists.
    - `lineItemId` string, required: The channel's identifier for the line item, as sent in `lineItemId` when the sales order was created.
    - `quantity` integer, required: The quantity being returned.
    - `refundReason` string: Why the buyer is returning the item.

## Response `200`

Success

- ReturnOrderData
  - `returnOrderId` number: The unqiue identifier for the return order in Zentail
  - `channelReturnId` string: The unqiue identifier for the return order in the sales channel
  - `requestTs` string, date-time: The time that the return order was requested. In [ISO-8601 format](/getting-started/api-basics/timestamps)
  - `cancelled` boolean: Indicates the return request has been cancelled
  - `completedTs` string, date-time: The time the seller completed the return in Zentail, or null while it is still open. In [ISO-8601 format](/getting-started/api-basics/timestamps)
  - `returnItems` ReturnOrderDataItem[]: The line items that makeup the return order
    - `returnOrderItemId` number: The unique identifier for this line item
    - `SKU` string: The SKU that is being returned
    - `quantity` number: The amount that is being returned
    - `originalQuantity` number: The original quantity that was ordered
    - `refundAmount` number: The amount of payment that is being refunded

## Other responses

- `400`: Bad Request
- `403`: Permission Denied
- `404`: Not Found
- `500`: Zentail Error
- `503`: Zentail Error

---

[API](https://skmtc.dev/zentail/apis/zentail-api.md) - [All operations](https://skmtc.dev/zentail/apis/zentail-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zentail/apis/zentail-api/revisions/55e43cb43caf?raw)
