Return order items#
This guide walks through processing a customer return after delivery: receiving the items back, approving the financial settlement, optionally crediting back fees and restocking, then finishing the process. The flow follows a repeating pattern — mutate, inspect order.actions to determine the next required step, and repeat until you call finishOrderItems.
Overview#
- (Bundles/parts only) Announce the return with
returnOrderItems - Receive the items back with
receiveOrderItems - (If required) Approve financials with
approveOrderItems - (Optional) Credit back fees with
addContraFeesToOrderItems - (Optional) Restock items with
restockOrderItems - Finish the process with
finishOrderItems - (Optional) Notify the customer with
sendReturnEmail
Understanding order actions#
After each mutation, the response includes order.actions. This array tells you which step to execute next and which item IDs are involved. Always check it before proceeding.
action value | Next step |
|---|---|
HANDLE_APPROVAL | Call approveOrderItems |
HANDLE_RESTOCK | Call restockOrderItems |
HANDLE_FINISH | Call finishOrderItems |
Understanding contra items#
When you announce a return for a bundle or part item, you create a "contra" version of it. You generate a UUID v4 for contra_item_id yourself before calling the mutation (if you leave it empty one is generated for you, but then you won't know the ID). This ID is what you pass to subsequent steps (receive, approve, restock, finish) instead of the original item_id. Standard return items don't need a contra item — use their original item_id throughout.
Step 1 — (Bundles and parts only) Announce the return#
For items of type OFFER, PART, PRICED_PART, or ASSEMBLE_BUNDLE, announce the return before receiving. For standard RETURN or LOOSE_RETURN items, skip to step 2 and use the original item_id directly.
Input: ReturnOrderItemsInput!
| Name | Type | Required | Description |
|---|---|---|---|
order_id | String! | Required | ID of the order. |
items | [ReturnItemInput!]!▾ | Required | Items to announce. |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money! | Required | Total value |
currency | Currency! | Required | Currency code |
Generate one UUID per item before the request and store them locally — you will need the
contra_item_id values in every step that follows.
Step 2 — Receive the items#
Register the physical arrival of the returned goods. For standard return items use the original item_id; for announced items (step 1) use their contra_item_id.
Input: ReceiveOrderItemsInput!
| Name | Type | Required | Description |
|---|---|---|---|
order_id | String! | Required | ID of the order. |
items | [ReceiveItemInput!]!▾ | Required | Items being received. |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money! | Required | Total value |
currency | Currency! | Required | Currency code |
Check order.actions in the response to determine which step comes next.
Step 3 — (If required) Approve financials#
If order.actions contains HANDLE_APPROVAL, approve the financial settlement of the returned items using the IDs listed in that action entry. The response includes the current fees on the order and the next required action.
Input: ApproveOrderItemsInput!
| Name | Type | Required | Description |
|---|---|---|---|
order_id | String! | Required | ID of the order. |
items | [String!]! | Required | The item IDs from the HANDLE_APPROVAL action entry. |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money! | Required | Total value |
currency | Currency! | Required | Currency code |
Check order.actions again before proceeding.
Step 3b — (Optional) Credit back fees#
If the order had fees (e.g. payment or shipping costs) that should be credited back to the customer, add contra entries for them. Only include fee IDs that are still present in the approveOrderItems response — the available fee IDs are returned under order.fees.
Input: AddContraFeesToOrderItemsInput!
| Name | Type | Required | Description |
|---|---|---|---|
item_ids | [String!]! | Required | The item IDs being returned. |
fees | [ContraFeeInput!]!▾ | Required | Fees to credit back. |
Returns: AddContraFeesToOrderItemsPayload
| Name | Type | Required | Description |
|---|---|---|---|
items | [CollectionItem!]!▾ | Required | Contra items the fees were attached to |
amount is in cents — 595 means € 5,95.Step 4 — (Optional) Restock items#
If order.actions contains HANDLE_RESTOCK, call this mutation to return the items to inventory. You can skip restocking by not calling this mutation — the items will not be added back to stock.
Input: RestockOrderItemsInput!
| Name | Type | Required | Description |
|---|---|---|---|
order_id | String! | Required | ID of the order. |
items | [RestockItemInput!]!▾ | Required | Items to restock. |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money! | Required | Total value |
currency | Currency! | Required | Currency code |
After restocking, order.actions will contain HANDLE_FINISH.
Step 5 — Finish#
Completes the return. The items are fully processed after this call.
Input: FinishOrderItemsInput!
| Name | Type | Required | Description |
|---|---|---|---|
order_id | String! | Required | ID of the order. |
items | [String!]! | Required | All item IDs processed in this return. |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money! | Required | Total value |
currency | Currency! | Required | Currency code |
The return is now complete.
Step 6 — (Optional) Send return email#
Input: SendReturnEmailInput!
| Name | Type | Required | Description |
|---|---|---|---|
order_id | String! | Required | ID of the order. |
item_ids | [String!]! | Required | All item IDs processed in this return. |
Returns: Order
| Name | Type | Required | Description |
|---|---|---|---|
id | ID! | Required | The ID |
number | String! | Required | Order number |
total | Money! | Required | Total value |
currency | Currency! | Required | Currency code |
The customer receives a return confirmation for the processed items.
Notes#
finishOrderItemsmust always be the last call — it locks the processed items and closes the flow.- Steps marked (Optional) can be skipped; the flow will continue to
finishOrderItemswithout them. amountvalues in fee inputs are integers in cents — e.g.595means € 5,95.- The
order.actionsarray drives which steps are required. Its contents depend on the order's configuration (e.g. whether inventory tracking is enabled). Always read it rather than assuming a fixed sequence. reasonvalues are enums — see the fullReturnReasonvalue list in the schema reference.- To look up available inventory locations for restocking, query
inventoryLocations. - For cancelling items before shipment, see Cancel order items.
- See Authentication for how to pass your API key.