API Method to trigger Return Items

VishalMarya
Tourist
5 0 1

 

For a Shopify order we can do a "Return Items" action as seen in image below. 

I am looking for correct API method to achieve this

return.png

return1.png

Replies 6 (6)
Greg_Kujawa
Shopify Partner
1016 83 249

If you haven't already created a fair amount of code that relies on the REST API, I would start off using the GraphQL API. Here is the documentation detailing how a new refund is created --> https://shopify.dev/docs/admin-api/graphql/reference/orders/refundcreate. Although I'm not sure if this endpoint allows the API consumer to pass along a refund reason. Whereas the REST API does appear to include this --> https://shopify.dev/docs/admin-api/rest/reference/orders/refund#create-2020-10

Hope this helps a little! 

VishalMarya
Tourist
5 0 1

Hi Greg,

Thanks for your reply.

I am not looking to create a refund but to replicate behavior of "return items" action using API.

Greg_Kujawa
Shopify Partner
1016 83 249

Right, but this is essentially the same animal that you are skinning. See here for more info --> https://community.shopify.com/c/Shopify-APIs-SDKs/Return-API/td-p/640771

VishalMarya
Tourist
5 0 1

I have seen that post, but not sure what to make it.

Is the post suggesting that there is not API method to achieve "Return Items" or I should use "Refund" method ?

I have tried refund method with 0.00 amount. The result is not same as when I use Shopify user interface to do a "Return Items" . May be I am not passing the right parameters.

From Shopify UI :From Shopify API :
return_UI.pngreturn_API.png

 

VishalMarya
Tourist
5 0 1

I have opened ticket with Shopify, went on to chat. No solution on how to replicate "Return Items" action using API.

tolgapaksoy
Shopify Partner
86 7 46

Hi Vishal,

This is simply not possible yet. You cannot replicate the "Return Items" functionality using the REST Admin or GraphQL Admin APIs. Shopify mentioned they are working on expanding their API to expose this functionality, but no timeline is given.

Until then, we are forced to use refunds with restock_type: "return".