Skip to Content
StarsellDocs
API referenceReturns

Create a return

POST
/stores/{storeId}/orders/{orderId}/returns

Open a return: the units coming back and why, a note, and what the customer gets in exchange. Units can not pass what was bought and not refunded or on another return. Needs a key that can edit. Send an Idempotency-Key to make a retry safe: a repeat within 24 hours gets the first answer back instead of running again.

Authorization

storeKey
headerAuthorizationBearer <vtk_...>

A store API and MCP key

Path Parameters

storeId*string

The store id

orderId*string

The order id, or its number (1042)

Header Parameters

Idempotency-Key?string

Makes a retry safe: the first call with this key runs, and a repeat within 24 hours (same path and body) gets the same answer back without running again. Per store. A call that failed keeps nothing, so its repeat runs again. The same key with another path or body is refused with 422.

Match^[!-~]+$
Length1 <= length <= 255

Request Body

application/json
  1. body
lines*array<>
note?string
exchange_lines?array<>
tracking?string

Response Body

Created

application/json
  1. response
data*
Example Request
curl -X POST 'https://starsell.app/api/v1/stores/string/orders/string/returns' \  -H 'Content-Type: application/json' \  -d '{  "lines": [    {      "order_item_id": "c3e40b5c-b9ae-413a-b96e-5aa0514f5ae6",      "quantity": 1,      "reason": "size"    }  ]}'
Example Response
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "order_id": "93101167-9065-4b9c-b98b-5d789a3ed9fe",    "number": 0,    "label": "string",    "status": "requested",    "lines": [      {        "order_item_id": "c3e40b5c-b9ae-413a-b96e-5aa0514f5ae6",        "quantity": 0,        "reason": "size",        "note": "string",        "restocked": 0      }    ],    "exchange_lines": [      {        "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",        "variant_id": "8a2d415d-59aa-4132-bef3-011f97c4a0f6",        "title": "string",        "variant_name": "string",        "quantity": 0,        "price_minor": 0      }    ],    "customer_note": "string",    "tracking": "string",    "refund_id": "63c72644-8ac7-4527-8b49-bb7e9f190cb0",    "exchange_order_id": "fada7d0f-ca50-498f-8ea8-24ba1cc005e1",    "closed_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  }}