Integration with the `Return` object for exchanges
The GraphQL Admin API provides comprehensive access to return and exchange data through the Return object and related fields. This approach eliminates the need for special access requests and provides a unified way to access returns and exchanges data created on both the Shopify admin and POS.
The Return object includes transaction data, simplifying the process of identifying and reconciling payments and refunds associated with exchanges. This document provides details on how to query return and exchange data using the GraphQL Admin API.
For ERP integrations, third-party connectors, or custom integrations of any kind, the recommended approach is to query the Return object because it provides standard API access without requiring special permissions, offers a unified data model for both returns and exchanges, and includes comprehensive transaction data for simplified financial reconciliation.
Querying the Return object is the recommended approach for accessing exchange data. The legacy exchangeV2s field is being phased out in favor of this unified solution.
Querying the Return object is the recommended approach for accessing exchange data. The legacy exchangeV2s field is being phased out in favor of this unified solution.
Anchor to Accessing exchange data through the ,[object Object], objectAccessing exchange data through the Return object
Return objectRefer to our docs for information on how to read exchange returns data, such as:
- Querying returns and exchanges.
- Understanding return and exchange line items.
- Accessing transaction data.
- Working with financial summaries.
- Webhooks.
Anchor to Update your queriesUpdate your queries
If you're currently using the exchangeV2s field, here's how to query the same data:
Anchor to Before, using the ,[object Object], objectBefore, using the ExchangeV2 object
ExchangeV2 objectThis query retrieves the return and exchange line items for the first 10 exchanges associated with a particular order.
Anchor to After, using the ,[object Object], objectAfter, using the Return object
Return objectThis query retrieves the return line items, exchange line items, and transactions for the first 10 returns associated with a particular order.
The transactions connection is populated for the following scenarios:
- POS returns and exchanges: Includes both refunds and captured payments.
- Online returns and exchanges: Includes refunds only.
Read the changelog entry on transaction access for more details.
The transactions connection is populated for the following scenarios:
- POS returns and exchanges: Includes both refunds and captured payments.
- Online returns and exchanges: Includes refunds only.
Read the changelog entry on transaction access for more details.
Query returns on an order
GraphQL query
JSON response
Anchor to Best practicesBest practices
- Use the
Returnobject for all new integrations: It provides comprehensive access without special permissions. - Check for
exchangeLineItemsto identify exchanges: If present, then the return is an exchange. - Use
transactionsfor financial reconciliation: Direct transaction access via theReturnobject eliminates the guesswork involved in matching a transaction from theOrderobject to a specific return or exchange. - Subscribe to return webhooks: Get real-time updates on return and exchange status, for example
returns/process. - Query returns at the order level: Get all returns/exchanges for an order in one query.
Anchor to Additional resourcesAdditional resources
- Learn more about the
Returnobject. - Learn more about accessing the returns for an
Orderobject. - Subscribe to return webhooks for real-time updates.
- Learn how to manage returns.
- Read the changelog entry on transaction access.