POST
Approve a requested exchange

Authorizations

Authorization
string
header
required

A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.

Headers

Idempotency-Key
string
required

A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.

Path Parameters

exchangeId
string
required

Body

application/json

Takes no parameters, and an empty body is expected. Moves an exchange from requested to approved and does nothing else: no stock is reserved, no stock is restocked, and no money moves. The price difference settles on SHIP, which this API does not publish, so an approval promises money later and moves none now. LEGAL ONLY FROM requested. An exchange that is already approved, received, shipped or cancelled answers 409 invalid_transition, so this is not idempotent by shape: a replayed Idempotency-Key answers the stored response, and a FRESH key on an already-approved exchange answers 409 rather than 200. Read the exchange back to see where it is. THE BODY IS READ ONLY TO REFUSE IT. reason, note and cancel_reason are refused BY NAME because the exchange row has no column for prose, so text sent here would be accepted, dropped, and unreadable through any route afterwards. restock and location_id are refused because choosing where returned goods land is write_inventory's authority, and neither published transition moves stock. refund, refund_to, amount, difference_total and difference_total_minor are refused because no money moves here at all, and the figure is a snapshot taken when the exchange was opened that no transition re-prices. status is refused because the route in the url is the transition. The provenance keys (id, store_id, order_id, created_by, created_at, updated_at) are refused for the usual reason: the server owns them. The response is the WHOLE exchange in the shape GET /api/v1/exchanges/{exchangeId} serves, so treat it as a fresh read rather than following it with a GET.

Response

Success

data
object