What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Alernative to deprecated Order property total_price_usd

Alernative to deprecated Order property total_price_usd

user072319
Shopify Partner
131 0 17

Hello there,

 

We have a live Shopify app. 

 

We were using total_price_usd property in the Order REST API for our app functionality. However, now total_price_usd is deprecated. 

 

Deprecated API calls made by your app - Shopify Partners 2023-01-16 02-33-41.png

 

How else can I get the USD price from the order details?

 

Any pointers would be appreciated. 

 

Thanks in advance

 

 

Replies 3 (3)

ville_k_sizeme
Shopify Partner
4 0 0

Our app has the same issue as it charges a percentage-based commission on certain orders.  The commission is charged using the UsageCharge resource, which always assumes the price field is in USD, while the order amounts are in the store currency.  We have used the total_price_usd for currency conversion. 

 

Shopify makes currency conversions all the time, so how could we access these conversion functions, if the USD value for orders has to be deprecated?  

user072319
Shopify Partner
131 0 17

Hi @ville_k_sizeme 

 

Did you get answer for the alternative for total_price_usd ?

ville_k_sizeme
Shopify Partner
4 0 0

Yes, I got an answer in this thread but in short, they are considering adding some new feature to help with currency conversions.  Meanwhile, we made a quick workaround to this problem by parsing this currencies.js file that Shopify provides in to a local database and using that to convert the sums to and from USD.