Returns (RMA)
Customers can request returns on delivered orders. Admins approve/deny, track the return, process refunds, and restock inventory.
Where to find it
Storefront (customer): /account/returns — list of their returns, request new
Storefront (per order): "Request Return" button on delivered order detail
Admin: /commerce/returns
Customer flow
- Customer views a delivered order
- Clicks "Request Return"
- Selects which items + reason (defective, wrong item, changed mind, etc.)
- Adds an optional note
- Submits — return is created with status
requestedand RMA number (format:RMA-YYYYMMDD-####) - Customer receives email notifications as status changes
Admin flow
/commerce/returns shows all returns with status filters. Click a return to:
- View items + reason
- Change status (see lifecycle below)
- Add admin notes
- Process refund (triggers Stripe/PayPal refund API)
- Restock inventory back to available
Status lifecycle
requested → approved → shipped_back → received → refunded
↓
denied| Status | What happens |
|---|---|
requested | Initial state. Customer gets confirmation email. |
approved | Customer gets approval email with shipping instructions. |
denied | Customer gets denial email. End state. |
shipped_back | Customer has sent the items back. |
received | Admin received and inspected items. |
refunded | Refund processed. Inventory restocked. Customer gets refund email. |
Refund processing
When status → refunded:
- Calls Stripe Refund API or PayPal refund (whichever was used for the original order)
- Updates order
payment_statustorefundedorpartially_refunded - Restocks inventory (releases reservations, restores
quantity_available) - Syncs back to
ehs__orderswarehouse record - Sends email notification
Webhooks
Each transition fires a webhook: return.requested, return.approved, return.refunded, etc.