Shopify API Refund to Credit Card for order with multiple gateways including Gift Card

2 0 1
Hi Support,
We are using a private app to manage fulfilments and refunds. When an order is placed using a gift card AND another payment method, if we are refunding part of that order we want to refund cash to the other payment method before the gift card.
For example: 
In our staging environment we have an order for £100 paid for by gift card and credit card. 
The customer has sent back 1 item worth £24 for a refund.
If we are processing the order manually in back office we can choose to refund the £24 to their credit card. 
Is there a way to do the same use using an API call? Currently when we make a refund call it refunds the gift card first be default, and we want it to be refund the other payment method first.
Replies 3 (3)

2 0 1

Still looking for possible solutions on this, any response or indication to a similar issue will be appreciated. 

1 0 0


I am actually just going to implement the very same thing and the only solution which came to my mind is to:
--> get the transactions related to the order (GET Transactions for specific orderId)

--> in case there are multiple gateways used (giftcard, creditcard...) decide which one I wanna refund at first.

--> send the initial refund to the "prioritized" gateway (transaction.Kind = "refund", transaction.parentId=<giftcardID OR captureTransactionID)

--> send the rest of the refund to the other gateway


If there is some better solution, preferably using the standard "calculate" endpoint, it would be nice to know.


Shopify Partner
2 0 0

Hi there, 
we have the exact same issue, it is interesting that Shopify defaults to the refund on the gift card instead to the other payment methods which seems more logical.
We are probably going to implement it as NekomGmbH described... since this triggers money transactions, it would be really nice if Shopify could offer an easier and less error-prone solution here.