Skip to content

Returns (RMA)

Returns — also called RMA (Return Merchandise Authorization) — let a logged-in customer ask the store to take back or cancel an item they ordered. A customer can raise a return for an eligible item, converse with the store about it through a message thread, and cancel, reopen or close the request. Every return is scoped to the customer who owns it; a customer can only ever see and act on their own returns.

Authentication

All return endpoints require an authenticated customer — provide the storefront key and a customer Bearer token. See the Authentication page for how to obtain and send them.

How a return works

  1. Find eligible items. Call GET /api/shop/returnable-items for an order to see which items are still within their return window and how many units can be returned or canceled.
  2. Pick a reason. Call GET /api/shop/return-reasons for the resolution type (return or cancel_items) to get the reason ids to choose from.
  3. Raise the return. Call POST /api/shop/returns with the order, the item, a quantity, the resolution type and a reason id. The return starts in a Pending status.
  4. Converse. Read the thread with GET /api/shop/return-messages and add messages with POST /api/shop/return-messages.
  5. Cancel, reopen or close. Use cancel, reopen or close to change the state of the request.

Status flags

Each return carries three action flags that tell a client which operations are currently allowed:

FlagMeaning
canCloseThe return can be closed (marked solved) by the customer.
canReopenThe return can be reopened back to pending.
isExpiredThe return is past its allowed action window.

These flags are populated on the single-return view; on the list they come back null.

Quantity caps are enforced by the store

When raising a return, the quantity you send is capped server-side by the trusted quantity a customer is actually allowed to return or cancel for that item (forReturnQuantity / forCancelQuantity from returnable-items). You can never return more units than were ordered and are still eligible.

Endpoints

OperationMethod & PathDescription
List own returnsGET /api/shop/returnsThe customer's own returns, newest first.
View one returnGET /api/shop/returns/{id}A single return the customer owns.
Raise a returnPOST /api/shop/returnsCreate a new return for one order item.
Cancel a returnPOST /api/shop/returns/{id}/cancelCancel the customer's own return.
Reopen a returnPOST /api/shop/returns/{id}/reopenReopen a canceled/declined return.
Close a returnPOST /api/shop/returns/{id}/closeMark a return solved.
List returnable itemsGET /api/shop/returnable-itemsReturn-eligible items of one of the customer's orders.
List return reasonsGET /api/shop/return-reasonsActive reasons for a resolution type.
List return messagesGET /api/shop/return-messagesThe conversation thread of a return.
Send a messagePOST /api/shop/return-messagesAdd a message to the return conversation.

Released under the MIT License.