A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi,
I know this question has been asked in various forms but was wondering if there is any update on being able to retrieve the return information from Shopify via the API. We seem to have full access to the refund data set but not the return one.
e.g.
If I initiate a return using the return items in the admin I'm able to select the items to return, select a return reason and start the return process.
A webhook is generated saying that the order has been changed but there is no way to actually query that return information through the API. I can see that the Shopify application is querying new data sets that are not available in the API (returns). The only way I can know that a return has been initiated is by looking at the events for the order
e.g.
You created a return #1223-R1 for this order.
or something similar will appear when you query the events for the order.
Until a refund is done for the return there is no way to know what items are being returned. Additionally, there is no way to get the actual return reason that was set when the return was initiated.
Are there plans to add this to the API?
what you describe is very clear🤣,I also found that what about return order information can get is only event msg,detail about item or return reason is no way,I lost day and day to find a solution but has no result
1、Order API:get nothing about return
2、Refund API:when order status is return in process,has no refund
3、Event API:only get a less information tell that order has a return,but has no return detail
4、GraphQL API:just a different way get same thing as Rest API
Did you or your team were able to achieve Return retrieval ? If so, please share the solution.
Hi @tushargtti, @rodschuler, @wzyandi, and @wereacommunity,
I'm happy to let you know that we have since added a bunch of new endpoints and functionality relating to Returns with our Admin API. You can now retrieve returns via the api, as well as subscribe to webhooks to be notified when returns are created.
Specifically you can subscribe to the returns/approve webhook to be notified when returns are created, along with receiving information on the line items returned and the reason for the return. Here's an example payload that this webhook will send:
{
"id": 8244166818,
"admin_graphql_api_id": "gid://shopify/Return/8244166818",
"status": "open",
"order": {
"id": 6421645394082,
"admin_graphql_api_id": "gid://shopify/Order/6421645394082"
},
"total_return_line_items": 1,
"name": "#1023-R1",
"return_line_items": [
{
"id": 11041046690,
"admin_graphql_api_id": "gid://shopify/ReturnLineItem/11041046690",
"fulfillment_line_item": {
"id": 12278438789282,
"admin_graphql_api_id": "gid://shopify/FulfillmentLineItem/12278438789282",
"line_item": {
"id": 14301075964066,
"admin_graphql_api_id": "gid://shopify/LineItem/14301075964066"
}
},
"quantity": 1,
"return_reason": "unknown",
"return_reason_note": "",
"customer_note": null
}
]
}
Additionally you can retrieve information on returns from the Order object in the Admin API, or by making a query for the return directly
Here's also a guide that we have posted on our Shopify.dev documentation that provides further advice and guidance on how to manage returns with the API.
I hope this helps, and I hope you have a great day 🙂
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
what is the full URL for returns/approve api end point.
Hey @zee-liwa - the returns approval mutation is only available in our GraphQL Admin API at the moment and would just use the following endpoint/request method:
POST https://your-development-store.myshopify.com/admin/api/2024-04/graphql.json
There's a bit more info in our developer documentation here on the returnApproveRequest mutation itself. Hope this helps!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Bumping this post because we are looking for this data to be available. Thank you!