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. Query returnableItems 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. Query returnReasons for the resolution type (return or cancel_items) to get the reason ids to choose from.
  3. Raise the return. Call createCustomerReturn 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 customerReturnMessages and add messages with createCustomerReturnMessage.
  5. Cancel, reopen or close. Use cancelCustomerReturn, reopenCustomerReturn or closeCustomerReturn 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 returnableItems). You can never return more units than were ordered and are still eligible.

Endpoints

OperationGraphQL fieldDescription
List own returnscustomerReturnsPaginated list of the customer's own returns.
View one returncustomerReturnA single return the customer owns.
List returnable itemsreturnableItemsReturn-eligible items of one of the customer's orders.
List return reasonsreturnReasonsActive reasons for a resolution type.
List return messagescustomerReturnMessagesThe conversation thread of a return.
Raise a returncreateCustomerReturnCreate a new return for one order item.
Cancel a returncancelCustomerReturnCancel the customer's own return.
Reopen a returnreopenCustomerReturnReopen a canceled/declined return.
Close a returncloseCustomerReturnMark a return solved.
Send a messagecreateCustomerReturnMessageAdd a message to the return conversation.

Released under the MIT License.