Build self-serve returns using the Customer Account API
Using the Customer Account API, third-party (3P) developers can seamlessly build return apps on new customer accounts without needing additional app authorizations. Partners can query existing returns, create new return requests, and customize the experience for customers.
Additionally, these APIs provide Partners with visibility into an order line item's return eligibility, which incorporates Shopify's Return rules for merchants with this feature enabled. Partners can determine which items can be returned and the expected refund amount, as well as why items are not returnable.
This guide shows you how to use the order
query to get the information you need regarding returns and how to request returns on behalf of customers using the Customer API.
Anchor to RequirementsRequirements
- Your app can make authenticated requests to the Customer Account API.
- Your store has existing orders that have been fulfilled. You can return only items that have been fulfilled. If you need to make changes to an unfulfilled item, then you can edit an order.
- You're using the
2025-04
version of the Customer API or higher.
- You've met Shopify's protected customer data requirements.
Anchor to Step 1: Query for the return eligibility of an orderStep 1: Query for the return eligibility of an order
If an Order
doesn't contain any items eligible for return, then the nonReturnableSummary
field on the returnInformation
will specify the reason for ineligibility. If the order is eligible for return, then this field will be null
.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL query
GraphQL input
JSON response
Anchor to Step 2: Get the returnable and non-returnable line items of an orderStep 2: Get the returnable and non-returnable line items of an order
You can use the returnInformation
field of an Order
to get both the returnableLineItems
and the nonReturnableLineItems
.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL query
GraphQL input
JSON response
Anchor to Step 3: Get the calculated return amountStep 3: Get the calculated return amount
Use the returnCalculate
query to calculate financial outcome of a return based on the line items requested for return. It includes a detailed ReturnFinancialSummary
that breaks down the restocking and shipping fees
, return subtotal
, subtotal with cart discounts
, total return amount
, and total tax
, all presented in both customer-facing (presentmentMoney
) and internal shop (shopMoney
) currency formats. Additionally, the query retrieves detailed information about each return line item
, including current total price, quantity, and associated financial details like subtotal and total tax.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL mutation
GraphQL input
JSON response
Anchor to Step 4: Create the return requestStep 4: Create the return request
Use the orderRequestReturn
mutation to send a return request to the merchant. As the name implies, this mutation doesn't directly create a return. Instead, it submits a request that the merchant can approve or reject.
POST https://{shop}.myshopify.com/api/{api_version}/graphql.json
GraphQL mutation
GraphQL input
JSON response
Anchor to Next stepsNext steps
Using the GraphQL Admin API, you can lean how to do the following:
- Manage exchanges
- Preview and refund duties
- Manage reverse fulfillment orders
- Manage reverse deliveries