Refunds when selling in multiple currencies

edgecrusher
New Member
2 0 0

tl;dr Any ideas for how to get refund amount in the shop currency?

 

We have several clients for which we consume shop data and provide some marketing and reporting services on.  A large majority then are US based and only sell in USD but we have a handful of non US clients that support multiple currency selling.  It is these multiple currency selling clients that we are having a hard time figuring out a consistent way to handle refunds for.

 

The gist of the problem is that we make adjustments to our internal order's total_price by deducting the sum of all the refund transaction's `amount` values.  We do this naively, without consideration of the currencies used by the shop and those in the transaction records.  Obviously when the currencies match we can accurately make the adjustments, but when they are not, things can be drastically off.  

 

Strategically we plan to capture the store's current type and use that to drive conversions/calculations, but I'm looking for options (if any) that I can take in the meantime to get a more accurate adjustments.  One idea would be to look at the use the refund line item shop_money.currency_code, and when this was different from the transaction's currency, calc a rate between one of the refund line item's #shop_money.amount and refund_line_items#presentment_money.amount. Obviously this hinges on the refund line items containing records and does not take into account current exchange rates.

 

If there are any other solutions that people have come up with to address this I would love to hear them.  If tactically approach described above is too naive I would love to hear that too.

 

thanks in advance

Sean

 

 

0 Likes
rohitmishra
Shopify Staff
Shopify Staff
20 1 8

Hey Sean,

 


tl;dr Any ideas for how to get refund amount in the shop currency?

You can get the refund amount in shop currency using the order transactions API. You need to pass the "in_shop_currency=true" param. For example on my test store, when you hit

https://multi-currency-core.myshopify.com/admin/api/2020-01/orders/<order id>/transactions.json?in_shop_currency=true

 

this is the response you get for refund transactionCleanShot 2020-06-08 at 18.08.37@2x.png

 

Hope this is helpful.

Product Lead, Global Commerce and Sales Tax
0 Likes
edgecrusher
New Member
2 0 0

Very helpful, thank you.  One follow on question that is a bit of a grasp, is there anyway to have this included as part of the refund webhook payload?  In other words, is there a means by which we wouldn't need to hit the APIs to obtain the converted amount?  The order_adjustments and refund_line_items in the refund payload include both the store and presentment amounts/currencies, it would be real nice (for our purposes) if the transaction records that represent the real exchange of money did too.  Humble feature request ;)

Thanks in advance

0 Likes