Skip to content

Swap at door

POST/admin/v1/stores/{store_id}/returns/{return_id}/swap
  • orders:write
  • Idempotency-Key supported

Swaps at the door: books the replacement order's delivery with a carrier that collects the return's items in the same trip, and approves the return with that shipment.

Path parameters

  • store_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

  • return_idstringrequired

    The return's ID, like rtn_01k8qs5s….

Headers

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • order_idstringrequired

    The order with the replacement items, the same customer's and not yet shipped.

  • carrier_account_idstringrequired

    An account whose carrier swaps items at the door (capabilities.exchanges).

  • weight_gramsinteger · or null

    Defaults to the products' weights.

  • parcelsinteger · or null

    Defaults to 1.

Returns

200 Approved, with the exchange shipment.

Errors

  • 409Not open, a label already booked, another customer's order, or the carrier refused.
  • 422validation_failedThe same order, or a carrier that doesn't swap items (exchange_unsupported).