Processing Returns and Exchanges

What Happens When You Resolve (Close) a Return

Updated Sep 30, 2026

When you resolve a return, Exchange It finishes it off in Shopify: it clears out any leftover exchange line items and then closes the return so it no longer shows as open.

When it happens

This runs when you resolve (close) a return in Exchange It — the final step that marks the return as done once its refund or exchange work has been handled.

What Exchange It does

Exchange It uses a single Shopify client for every call in this step (both reconciliation and close). The sequence is:

  1. Reconciliation check. If there is an existing log for the return, Exchange It reads the live Shopify state with the return reconciliation query — pulling the return's status and per-item processable and refunded quantities — and evaluates whether the refund is reconcilable. This lets it tell "already processed elsewhere" apart from "nothing moved." Note that store credit issued through the store-credit-account API does not create a Shopify Refund, so those items read as unrefunded here and fall through to the audited manual path rather than auto-reconciling.
  2. Clear unprocessed exchange items. Exchange It fetches the return's exchange line items and filters for any with a processable quantity still greater than zero. If any remain, it runs the removeFromReturn mutation to strip those exchange line items off the return.
  3. Close the return. It then reads the return's line items and current status. If the return is not already CLOSED, it runs the returnClose mutation against the return to close it.

What gets recorded

The outcome of the close step is written to the return's log under the returnClose bucket in mutationsAndCalls, capturing the returnClose result recorded for this return.

If it fails

The removeFromReturn mutation returns userErrors; when those are present, Exchange It logs the error rather than silently succeeding. Before closing, Exchange It also classifies any prior refund failure and uses the live reconciliation state to decide whether it is safe to resolve — cases where the work can't be verified against the return's items fail closed to the audited manual override instead of auto-reconciling. The returnClose mutation only runs when the return's status is not already CLOSED.

Related articles