update checkout buyer identity

update checkout buyer identity

closettechic
Visitor
1 0 1

Hello I'm building an app using shopify storefront api, I want to create a currency selector, but haven't found a way to update checkout currency code. 

Seems that the only way to set up checkout currency is to pass in buyer identity when creating a checkout. 

Is there any way to update checkout buyer identity or currency code?

Replies 4 (4)

Luke_K
Shopify Staff
402 66 102

Hey @closettechic 

It's possible to call the checkoutCreate mutation passing it a currency that's been enabled on a store using  presentmentCurrencyCode - feel free to check out here for more info.

There's a mutation to associate customers to the checkout - checkoutcustomerassociatev2 -  that you might like to check out here.

There's a recently released mutation on Storefront API  to update Buyer Identity on the Cart too (docs), though the Cart API is unstable at the moment. Not sure if the latter quite fits your use case. Hope that helps at least!

 

 

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
tejaspatel
Shopify Partner
4 0 2

@Luke_K 

How would you change the buyer's Identity or country connected to checkout or Presentment currencies(going to be deprecated)  after checkout is created? 

The use case is User added a product to the cart (checkoutCreate Mutation) and then decided to change the country/currency.

 

 

Luke_K
Shopify Staff
402 66 102

Hey @tejaspatel 

International Pricing supercedes the deprecated Presentment Currencies which will be deprecated July 2022.

In terms of checkout creation with the newer International Pricing features, you'd be using the @incontext directive (which takes a Country Code Argument) on a mutation or query to run the mutation/query in context of the country code. 

As International Pricing is determined on the Shipping Address, if customer changes to a different country checkoutShippingAddressv2 should return the new country's prices  - or if a country is not enabled in the store, the store's default price.  

You may also wish to checkout the Price List API too, which is another means of controlling Pricing based on a buyers location. I'd encourage you to check out those docs I've linked above. Hope that helps!

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
pinktonio
Shopify Partner
4 0 4

Changing the country in the shippingAddress for checkoutShippingAddressv2 did not change the currency for me. I ended up creating a new cart with a different @inContext directive language and the same line items as in the previous cart.