# Apply per-currency discounts with Shopify Markets

> In this tutorial, let's use Shopify Markets and Talon.One to apply a discount that depends on the customer's currency.

> For the complete documentation index, see [llms.txt](https://docs.talon.one/llms.txt).

Let's imagine you want to give customers paying in Argentine Peso (ARS) a 20% discount,
and customers paying in all other currencies a 10% discount. You can do this by creating a
market in Shopify and a rule in Talon.One that checks the customer's market currency.

## Talon.One requirements

- You are an [admin](/docs/product/account/account-settings/manage-roles.md#admin-role)
  user.
- You have set up an [Application](/docs/product/applications/create-and-manage-applications.md) and a
  [campaign](/docs/product/campaigns/create-and-manage-campaigns.md).

## Shopify requirements

:::important
- Discount effects require [network access for Shopify Functions](https://shopify.dev/docs/apps/build/functions/input-output/network-access),
  which is available with [Shopify for enterprise](https://www.shopify.com/enterprise).
  Shopify [support](https://help.shopify.com/en/) must explicitly enable network access for Shopify Functions.
- Discounts are applied via the [Storefront API](https://shopify.dev/docs/api/storefront)
  using the [`@defer` directive](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/defer).
  If a store uses the [Ajax API](https://shopify.dev/docs/api/ajax) to manage the cart, discounts won't be visible until the customer reaches checkout.
- Discounts are managed in Talon.One and not synchronized to Shopify. They are
  applied and displayed in the storefront, but won't appear in the **Discounts** section of the Shopify admin.
- The Shopify integration only supports case insensitive coupons. In the Application
  settings, ensure the **Case Insensitive, stored in uppercase (recommended)**
  [option](/docs/product/applications/manage-general-settings#code-case-sensitivity) is
  selected.
- You cannot apply multiple coupons offering the same type of discount to the same order.
  For example, you cannot apply two coupons that both offer shipping discounts to the same order.
- If you are using both shipping and order/item discounts, ensure your
  [campaign evaluation order](/docs/product/applications/manage-campaign-evaluation)
  is set up so that shipping discounts are evaluated after order/item discounts.
:::

- You are an
  [administrator](https://help.shopify.com/en/manual/your-account/users/roles/roles-managed-by-shopify/administrator-roles)
  user.
- You have completed the [basic setup](set-up-shopify-app.md) of the Talon.One Shopify app
  and [enabled](/docs/dev/technology-partners/shopify/set-up-shopify-app.md#enable-markets-support) Shopify Markets support.

## Set up the integration

<StepsContainer>

### Set up markets in Shopify

Ensure your markets are set up in Shopify. You can use existing markets or create
new ones as needed.

1. In Shopify, open **Settings > Markets**.
1. Review or create markets with the currencies you want to target. For this example,
   ensure you have a market that uses the **Argentine Peso (ARS $)** currency.

### Create rules in Talon.One

Let's create two rules in Talon.One that apply a discount depending on the customer's currency.

The currency is stored as a three-letter currency code, so we check for `ARS` to apply the
discount for Argentine Peso.

1. Create a [rule](/docs/product/rules/create-and-manage-rules.md) that applies a 20% discount
   to customers paying in Argentine Peso:

   | What           | Name                   | Properties                                                                                                                                  |
   | -------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Conditions** | Check attribute value  | <Attribute name="shopify currency (Current Session)" type="custom" /> **is equal to** `ARS`                                        |
   | **Effects**    | Discount session total | **Discount name**: `ARS discount`**Discount value**: <Attribute name="[Session.Total]" type="builtin" /> `* 20%` |

1. Create another rule that applies a 10% discount to customers paying in all other currencies:

   | What           | Name                   | Properties                                                                                                                                               |
   | -------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Conditions** | Check attribute value  | <Attribute name="shopify currency (Current Session)" type="custom" /> **is not equal to** `ARS`                                                 |
   | **Effects**    | Discount session total | **Discount name**: `Other currencies discount`**Discount value**: <Attribute name="[Session.Total]" type="builtin" /> `* 10%` |

1. Save the rules.
1. [Activate](/docs/product/campaigns/create-and-manage-campaigns.md#activate-a-campaign) the campaign.

### Test the integration

1. In Shopify, add a product to your cart and proceed to checkout.
1. Set your checkout address to a market that uses Argentine Peso (ARS) currency.
1. Verify that the 20% discount is applied to your order.
1. Repeat the checkout with an address in a market that uses a different currency and
   verify that the 10% discount is applied instead.

</StepsContainer>
