Can a refund contains multiple transaction in API

Solved
pooja_zakhariya
Tourist
12 0 3

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,

Accepted Solution (1)
Gregarican
Shopify Partner
1030 86 276

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...

View solution in original post

Replies 7 (7)
Gregarican
Shopify Partner
1030 86 276

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.

pooja_zakhariya
Tourist
12 0 3
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,
Gregarican
Shopify Partner
1030 86 276

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?  

pooja_zakhariya
Tourist
12 0 3
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.
Gregarican
Shopify Partner
1030 86 276

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...

pooja_zakhariya
Tourist
12 0 3

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

 

Thanks for suggestion.

_JB
Shopify Staff
Shopify Staff
836 100 219

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 | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog