Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Exchange API - createReturn from based on a returnRequest

Exchange API - createReturn from based on a returnRequest

stefan-koblenz
Shopify Partner
22 7 14

1. Expected Behavior vs. Actual Behavior

We are trying to use the new Exchange API, but are failing to make a returnCreate call from a return request. As we show here in detail https://www.youtube.com/watch?v=peTHzR-GQXo
  
2. Timeframe - When did this happen?

We tried it many times, last try was Sunday 14th of July at 14:13pm german summertime. 
It happens the first time, because the feature was only released with the API version (SummerEditions) 2024.  

 

3. Environment & Scope of the Issue - Which app is making the API call? URL of app in Partner Dashboard or Store Admin is best:

- shopify-graphiql-app
- API-Version: 2024-07
- Call made via Graph API (see here https://youtu.be/peTHzR-GQXo?si=zOskTVz29qsL_WA9&t=212
 
What specific part of the official API docs are being followed? 
 
 https://shopify.dev/docs/apps/build/orders-fulfillment/returns-apps/build-return-management#step-4-o...
 
4. Replication and Raw Example

- https://youtu.be/peTHzR-GQXo?si=zOskTVz29qsL_WA9&t=212
 
In Store [https://admin.shopify.com/store/247apps-02]
By App [https://admin.shopify.com/store/247apps-02/apps/shopify-graphiql-app]
For Order [https://admin.shopify.com/store/247apps-02/orders/5658330005740]

 

Screenshot 2024-07-15 at 10.23.56.png

 

Screenshot 2024-07-15 at 10.25.31.png

Screenshot 2024-07-15 at 10.25.35.png

  

It seems there is a endpoint which is missing or only available internally by Shopify:

 

Screenshot 2024-07-15 at 10.58.53.png

which is done by the shopify-admin-ui

 

 

 

 

Screenshot 2024-07-15 at 11.58.02.png

 

But actually not available via the public graph-api

 

 

 

Replies 3 (3)

Liam
Community Manager
3108 344 902

Hi Stefan,

 

Thanks for explaining this very well and including a video too - I've reached out to the product team in this area to assist with troubleshooting this. I will update here when I have more info. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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

Liam
Community Manager
3108 344 902

Hi again Stefan,

 

After connecting with our product team on this, it looks like the issue you're experiencing is because you're creating a return for an item that's already part of another return (in the requested state). In the second example (through the native admin) you're able to complete the flow successfully because the item to be returned is not in another return. You cannot add exchange items to a requested return via API today - instead you should use the returnCreate mutation

 

If this mutation/ flow doesn't work for you, can you explain why you want to add exchange items to a requested return, rather than creating a return given you have a return app that seems to approve/decline the returns?

 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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

stefan-koblenz
Shopify Partner
22 7 14

Hi @Liam , nice to hear from you, maybe you remember we met in Berlin a couple years ago.

 


You cannot add exchange items to a requested return via API today - instead you should use the returnCreate mutation

 


That's the point. It seems there is a endpoint for that. If you have a return request and you accept this one with a exchange item shopify-admin is doing the following call:

Screenshot 2024-07-15 at 10.58.27.png


Exactly this call is essential important to accept a return request via the api and add the exchange informations. But this call/mutation is not available for us partners/dev's.

 

A colleague of you also mentioned there exist this mutation:

 

mutation returnEditAddExchangeLineItems($input: ReturnEditAddExchangeLineItemsInput!) {
  returnEditAddExchangeLineItems(input: $input) {

 

I guess this is internally used but not a public one.

 

Glad to hear from you Liam, have a great day!