Skip to Content
StarsellDocs
API referenceRefunds

Create a refund

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

Refund units of lines, shipping and/or an amount. Each unit goes back in stock at most once, and money back never passes what the customer still has paid in. The order becomes partially_refunded, or refunded once nothing is left. 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<>
shipping_minor?integer

Shipping to give back, with its VAT when VAT was added on top

amount_minor?integer

Your own amount. Leave out for what the lines and shipping are worth

reason?string
restock?boolean

Put the refunded units back in stock (units already back are skipped)

to_store_credit?boolean

Add it to the customer's store credit instead of the card

return_id?string

The return this refund is for: it gets linked to it

Formatuuid

Response Body

Created

application/json
  1. response
data*
Example Request
curl -X POST 'https://starsell.app/api/v1/stores/string/orders/string/refunds' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "order_id": "93101167-9065-4b9c-b98b-5d789a3ed9fe",    "amount_minor": 0,    "shipping_minor": 0,    "currency": "string",    "lines": [      {        "order_item_id": "c3e40b5c-b9ae-413a-b96e-5aa0514f5ae6",        "quantity": 0,        "amount_minor": 0,        "restocked": 0      }    ],    "reason": "string",    "restocked": true,    "to_store_credit": true,    "created_at": "2019-08-24T14:15:22Z"  }}