Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions documentation/build/discounts-dependable-on-currency.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
title: "Create discounts dependable on currency"
description: "Use dynamic discounts to apply discount values based on customer currency"
keywords: ['dynamic discounts', 'currency', 'metadata', 'discounts', 'campaigns']
---

When you sell in multiple currencies, a fixed amount discount may not have the same value for every customer. For example, a \$20 discount in USD may need an equivalent value in EUR, GBP, or another currency.

With dynamic discounts, you can set different discount values based on customer currency metadata. You can use discounts dependable on currency with every discount type that supports dynamic discounts, including product-specific promotions.

## Configure currency metadata

Voucherify needs to receive the customer currency value before it can use it in a dynamic discount formula. The metadata definition and data flow should be handled by your integration team. Learn more about [metadata](/prepare/metadata).

In this example, create customer metadata in **Project settings** > **Metadata schema** with the following settings:

- **Property name (key)**: `Currency`
- **Requirement**: optional
- **Value**: single
- **Type**: String
- **Allowed values**: `USD`, `EUR`, `GBP`

The discount formula uses this metadata to return the correct discount value for each currency.

## Create a dynamic discount

Create a discount and use a dynamic formula to calculate the discount value based on customer currency metadata.

In this example, create an amount discount with `$20` off the entire order as the default discount. Currency cases in the formula change this value when the customer metadata matches a supported currency.

<Steps>
<Step title="Select amount discount">
In the discount builder, select an amount discount.

In **Discount Type**, select **Amount discount: Apply to whole cart**.
</Step>

<Step title="Build formula">
Enter the default discount value for the campaign.

Use **Build formula** next to **Discount Amount (USD)**.
</Step>

<Step title="Select switch operator">
Use the `switch` logical operator in the dynamic discount formula.

Set the switch expression to the customer metadata `Currency`.
</Step>

<Step title="Add currency cases">
Add one case for each currency you support.

In this example:

- `USD` returns `20`
- `EUR` returns `15`
- `GBP` returns `17`
</Step>

<Step title="Set the formula fallback value">
Set the fallback value to `20`.

The fallback value is used when none of the currency cases match.
</Step>
</Steps>

After you save the formula, Voucherify applies the discount value that matches the customer's currency metadata. Each currency can have a different discount value that is equivalent to the default currency discount.

## Example use cases

You can use discounts dependable on currency in scenarios such as:

- promotions run in different countries with multiple currencies
- POS and online shopping
- product-specific promotions
- customer segments based on preferences or profile data

## Related features

<AccordionGroup>
<Accordion title="Dynamic formula builder">
Use [dynamic formula builder](/optimize/dynamic-formula-builder) to calculate discount values from metadata and logical operators, such as `switch`.
</Accordion>
</AccordionGroup>
1 change: 1 addition & 0 deletions documentation/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
"build/create-discount-coupons",
"build/create-discount-promotions",
"build/discount-types-and-effects",
"build/discounts-dependable-on-currency",
"build/discount-code-import",
"build/product-bundles"
]
Expand Down
Loading