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.

Re: Unexpected behavior after calling shipping rates API endpoint

Unexpected behavior after calling shipping rates API endpoint

OscarCBB
Shopify Partner
1 0 2

Hello, 

 

We use the Shipping Rates endpoint of the Shopify AJAX API at

https://shopify.dev/docs/api/ajax/reference/cart#generate-shipping-rates to show all shipping rates available.

The problem is this call (/services/currency/update?) is unexpectedly modifying the store currency when you launch a request for that Shipping Rates endpoint

 

That call changes the store currency, probably unintentionally, to the currency of the country chosen to collect the shipping rates.

 

I think this behavior did not occur before, this is a bug or incorrect behavior and this call should update the currency (referring to the shipping address) only on the checkout page.

Because if it works, as it does now, on every store page, any app that makes a request to the Shipping Rates endpoint for an specific country automatically causes the entire store's currency to change to this country currency.

Can someone from Shopify confirm that they are aware of the issue and working on a solution?

We have an app with more than 5,700 merchants depending on that feature.

 

Thanks in advance.

Reply 1 (1)

Liam
Community Manager
3108 344 904

Hi OscarCBB,

 

This looks like a duplicate of this post: https://community.shopify.com/c/shopify-functions/unexpected-behavior-after-calling-shipping-rates-a...

 

Our team are aware of this issue and are investigating, I'll update in the linked post.

Liam | Developer Advocate @ 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