What Happens When You Refund and Restock a Return
Updated Sep 30, 2026
When you resolve a return with a refund, Exchange It sends the money back to the customer (or issues store credit) and puts the returned items back into inventory. This article explains the sequence it runs against your Shopify store and what it records.
When it happens
This effect runs when you process a return and choose to issue a refund and restock the returned items — whether you're creating a straightforward refund or finalizing a return resolution that includes a restock.
What Exchange It does
Exchange It opens an authenticated client to your store and then runs the operations for the branch that matches your choices.
For a direct refund, it builds an idempotency key and branches:
- If there's a restock but no refund, it runs the refundCreate mutation to restock the items.
- If there's both a restock and a refund, it runs refundCreate to restock, then either issues store credit with the giftCardCreate mutation or, when no gift card is involved, runs refundCreate again to return the money to the original payment.
For a return resolution, Exchange It first reads the return's current line items with the getReturnLineItemsId query to work against fresh ids. When the newer return-process path applies, it can cancel and rebuild the return using the returnCancel and returnCreate mutations, check remaining exchange items with the getExchangeLineItems query, and then finalize with the returnProcessResolution mutation. If the suggested financial outcome for the return is an invoice outcome (checked via getSuggestedFinancialOutcome), it sends an invoice email to the customer with triggerInvoiceEmail.
It then settles the money and inventory: it issues store credit with the giftCardCreate mutation when a gift card is requested, restocks items with the restockCreate mutation, and either issues store credit or runs the returnRefundCreate mutation to complete the refund.
What gets recorded
Exchange It writes the outcome to the return's log under the restockAndRefund bucket. This includes the restock mutation's payload and response (the reverse-fulfillment disposal), the refund mutation details (the return-refund payload and response, the return-process payload and response, a refund summary, and the gift card payload and response), and the order note payload and response. The log also persists the returned products, the chosen refund method, and the return note.
If it fails
The log carries a refundFailed flag, which defaults to false and is set server-side when the refund or store-credit attempt fails — including gift-card failures that arrive as thrown errors whose details aren't preserved in the stored gift card response. This flag is authoritative: when you later try to close the return, that step reads refundFailed and refuses to resolve a return whose refund never completed.