API UserErrors: Exchange items cannot be added to an order placed via an unsupported source application

Hi everyone,

I’m facing an issue while trying to add exchange items to an existing order via Shopify Admin API, and I’m hoping someone can clarify the limitation or suggest a workaround.


:wrench: What I’m Trying to Do

  • Create or process an exchange for an existing order

  • Add new line items (exchange items) to that order using the Shopify Admin API

  • This is being done from a **custom app (API-based workflow)

    this one working good with development store but not working with live store.**

Hi @sani_kumar

The docs you’ll want to follow for this are:

You can’t directly “add exchange items” to an existing order; instead, Shopify models exchanges through the returns system in the Admin GraphQL API. The supported flow is: query returnableFulfillments for an order’s returnable items, use returnCreate with both returnLineItems (what’s being sent back) and exchangeLineItems (what you want to send out), then use returnProcess to confirm the exchange and create fulfillment orders.

Your mutations likely work on a development store but fail on a live store because of environment differences, not because of the GraphQL syntax. The most common issues are: missing scopes (read_returns / write_returns not granted on the live install), using an older API version in production (you should use 2024-07 or later), and orders on the live store not being in a returnable state (items must be fulfilled to be returned/exchanged).

Another frequent problem is accidentally using IDs from the wrong store (dev IDs in production), or not checking the userErrors returned by Shopify, which will usually tell you exactly what’s wrong (authorization, invalid state, bad IDs, etc.).