Can a refund contains multiple transaction in API

Solved
pooja_zakhariya
Tourist
12 0 2

Hello,

 

is there possibility a refund has multiple transactions?

We are integrating shopify with ERP so we were checking for unique id so we wanted to confirm if a refund has one transaction always of kind refund or multiple. Also refund created_at and transaction created_at will be always same?

 

Thanks,

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 226

I would assume that one refund can only be processed for one order. Although an order can have multiple line items that are refunded, as far as I'm aware a single refund can't be created against multiple orders.

0 Likes
pooja_zakhariya
Tourist
12 0 2
Hello,

I mean one refund is for one order only but will that refund can have
multiple transactions in API data as the transaction is of type list under
refunds.

Thanks,
Greg_Kujawa
Shopify Partner
1016 83 226

I see what you mean now. If you have a test or development store then you can try some different scenarios with refunds in the web admin and see how they look when querying via the API. One scenario that would break a one-to-one relationship would be if an order was paid with multiple payment types. A refund generated against the same payment types I would assume appear in an array of transactions, right?  

0 Likes
pooja_zakhariya
Tourist
12 0 2
Yes it is an array of transaction types but I see only one transaction for
most of the refunds so I wanted to confirm it.
0 Likes
Greg_Kujawa
Shopify Partner
1016 83 226

This is an accepted solution.

Since most orders are paid for with a single payment type (e.g. - a single credit card). To validate the various scenarios it would be advisable to go into a test or development store, create an order paid for with multiple payment types, and then process the refund against the same payment types. See how that looks in the API when you query the refund...

_JB
Shopify Staff
Shopify Staff
809 95 176

Hey @pooja_zakhariya,

Orders can definitely contain multiple refund transactions, so you'll need to account for multiple refunds in your app.

This is a use-case that's happened a few times with my own store:

- Customer complains because shipment is delayed, I offer discount on shipping cost (by refunding shipping amount)

- Package gets lost or customer changes their mind, so I process a full refund for the remaining amount

 

JB | Developer Support @ 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

0 Likes
pooja_zakhariya
Tourist
12 0 2

Yes, In case of multiple payment there are multiple transaction  under single refund.

 

Thanks for suggestion.