Localized Prices with Checkout
Tags: webdev, stripe, payments, checkout
Published: 2022-11-02 11:22:27

## Intro

When going through a checkout flow, prospective customers may abandon their cart or order when they see a currency different from their local currency. That can be for a number of reasons. It might be unclear to the customer about the exchange fee implications or whether they might incur extra bank fees when paying in different currencies.

Now with [Checkout](https://stripe.com/docs/payments/checkout/present-local-currencies) and Payment Links, you can use multi-currency Prices to present your customers’ local currency which can help to lower abandonment and increase conversion.

Checkout automatically localizes prices if you’re using multi-currency Prices depending on your customers’ location. You can create multi-currency Prices via the Dashboard and the [API](https://stripe.com/docs/api/prices/create#create_price-currency_options).


## What you’ll learn

In this demo we’ll create a multi-currency Price in the Dashboard and then we’ll demonstrate how to create and test a  Checkout Session that will present a different currency to your customers, based on their location.

If you’d like to learn more about Checkout, see [the list of videos here](https://www.youtube.com/c/StripeDevelopers/search?query=checkout) on our StripeDevelopers YouTube channel.


## Create a multi-currency Price

We'll add a new Product in the [Dashboard](https://dashboard.stripe.com). Now in the Price Information section, there is an option to "+Add more currencies". 

The default price is 10 euros for customers in the EU, and we'll add a second price in USD. Stripe will make a suggestion of the USD price based on current exchange rates but you're free to choose your own amount.


![Create a Product and multi-currency Price](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/akh46r0omnk17q2jan93.jpg)

We’ll copy the Price ID for use later when creating the Checkout Session.


![Copy the Price ID](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/808rsbzcgle3tv1sdvn7.jpg)


## Creating a Checkout Session

Next, we’ll create a Checkout Session with this Price ID, this example is written [in Ruby](https://stripe.com/docs/api/checkout/sessions/create?lang=ruby):



```ruby
session = Stripe::Checkout::Session.create({
  payment_method_types: ['card'],
  line_items: [{
    price: 'price_1LzMQyJyGOmgcJwrvQy3bCLq',
    quantity: 1,
  }],
  mode: 'payment',
  success_url: 'https://example.com/success',
  cancel_url: 'https://example.com/cancel',
  customer_email: 'test+location_FR@example.com'
})

puts session.url
```

Notice that we’ve provided a test email address of the form `test+location_FR.example.com`. This is how we can simulate that customers are arriving at your checkout from different countries. If we change the `FR` part to another [ISO country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes), we can force Checkout to test the currency for that particular country if one is configured for the Price.

We’ll run this code and grab the URL output to the console:


```
https://checkout.stripe.com/c/pay/cs_test_a1U3DAWuKb0QgD33ObzV5riXIzrqzRqtcNLcqbtL3znXXLGU5DA5rA7Kwb#fidkdWxOYHwnPyd1blpxYHZxWjA0SW9vQW5PfEJKaGJmT3J3Q2ZSYjFuTGpsTHVxUUtKMG9cazNhalR2VnE0QzFkbzdWRmdDQDIyQHM0V1F9PWdnPENOd1FWfHV0XUpwPGByczdkVnQ9PWhLNTVuNzJXdEZoTCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl
```

If we follow this URL, we can see that the currency in EUR is displayed for a french customer:


![Currency localized to EU](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jbhkbqwi4ulghcpm0lmz.jpg)

Now, let’s change our Checkout Session to simulate a customer arriving from the US:

```ruby
session = Stripe::Checkout::Session.create({
  payment_method_types: ['card'],
  line_items: [{
    price: 'price_1LzMQyJyGOmgcJwrvQy3bCLq',
    quantity: 1,
  }],
  mode: 'payment',
  success_url: 'https://example.com/success',
  cancel_url: 'https://example.com/cancel',
  customer_email: 'test+location_US@example.com'
})

puts session.url
```

The only change that we’ve made is to change the ISO country code in the customer email address to US.

```
https://checkout.stripe.com/c/pay/cs_test_a1vwLfWUcoaUrxJmWR1vimzsZw7D2cuqWhl1mcmPsb8Y2CXs8MvBDUVVaZ#fidkdWxOYHwnPyd1blpxYHZxWjA0SW9vQW5PfEJKaGJmT3J3Q2ZSYjFuTGpsTHVxUUtKMG9cazNhalR2VnE0QzFkbzdWRmdDQDIyQHM0V1F9PWdnPENOd1FWfHV0XUpwPGByczdkVnQ9PWhLNTVuNzJXdEZoTCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl
```

If we follow this new session URL, we'll see that the local currency is presented in USD:


![Currency localized to US](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6mqfj5b8nrm9vtpnajfd.jpg)

## Combining with Coupons, Stripe Tax and more

Localized pricing works with Coupons, Stripe Tax, and Shipping Rates. Depending on the combination of features that you’re using, you’ll need to make sure that the according currency options are set on those features as well. You can see a list of rules [here](https://stripe.com/docs/payments/checkout/present-local-currencies#checkout-experience).


## Summary

Presenting your customers prices in their local currency will reduce cart abandonment and increase conversion rates. Now with Checkout and Payment Links you can easily support multi-currency Prices by creating them via the Dashboard or API to improve the user experience for your customers.


### About the author

![Matthew Ling](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8rpgkqr91ivs8sxr73g.png) 

Matthew Ling ([@mattling_dev](@mattling_dev)) is a Developer Advocate at Stripe. Matt loves to tinker with new technology, adores Ruby and coffee and also moonlighted as a pro music photographer. His photo site is at [matthewling.com](https://matthewling.com) and developer site is at [mattling.dev](https://mattling.dev).


### Stay connected

In addition, you can stay up to date with Stripe in a few ways:

📣 Follow us on [Twitter](https://twitter.com/StripeDev)
💬 Join the official [Discord server](https://stripe.com/go/developer-chat)
📺 Subscribe to our [Youtube channel](https://www.youtube.com/StripeDevelopers)
📧 Sign up for the [Dev Digest](https://go.stripe.global/dev-digest)