> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paynext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Display Local Pricing

> Display both local and payment currencies at checkout with pre-formatted amounts from the API.

Display both local and payment currencies at checkout without managing currency formatting in your codebase. Add new currencies in PayNext Dashboard and they propagate instantly to your checkout.

## Why Localize Pricing

<CardGroup cols={2}>
  <Card title="No currency management" icon="database">
    Don't store currency symbols, decimal places, or formatting rules. PayNext handles it all.
  </Card>

  <Card title="Dashboard-controlled" icon="sliders">
    Update pricing in the Dashboard. Changes propagate instantly to new checkout sessions.
  </Card>

  <Card title="100+ currencies" icon="globe">
    Automatic formatting for all currencies—including zero-decimal (JPY), two-decimal (USD), and three-decimal (IQD).
  </Card>

  <Card title="Better conversion" icon="chart-line">
    Localized pricing and rounded amounts improve checkout conversion rates.
  </Card>
</CardGroup>

## How It Works

1. **Configure your plan** in PayNext Dashboard with pricing and payment currency
2. **Create a client session** with `currency_details: true` and the customer's country
3. **Receive formatted amounts** ready to display—no formatting logic needed
4. **Display in your checkout** using `formatted_amount` values directly

When you update pricing in the Dashboard, your checkout copy adjusts automatically—no code changes required.

## Enable Local Pricing

Add `currency_details: true` to your client session options:

```json theme={"system"}
POST /client-session
{
  "customer": {
    "email": "customer@example.com",
    "country": "US"
  },
  "plan": {
    "id": "plan_7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d"
  },
  "options": {
    "currency_details": true
  }
}
```

<Note>
  Currency details are optional. When disabled, responses remain lightweight without formatting data.
</Note>

## Response Structure

The `currency_details.plan` object contains pricing at two levels:

| Object                 | Contains         | Description                                        |
| ---------------------- | ---------------- | -------------------------------------------------- |
| `plan.payment`         | Payment currency | Plan price in the currency configured in your plan |
| `plan.local`           | Local currency   | Plan price converted to customer's local currency  |
| `plan.due_now.payment` | Payment currency | Amount charged now in plan currency                |
| `plan.due_now.local`   | Local currency   | Amount charged now in local currency               |

### Example: Building Checkout Copy

Use the client session response to build professional checkout copy. Hover over <Tooltip tip="This is a tooltip showing the API field">underlined values</Tooltip> to see which API field they come from.

<Tabs>
  <Tab title="Show both currencies">
    Show the customer their local currency equivalent and inform them they'll be charged in your payment currency:

    Your subscription will renew at <Tooltip tip="currency_details.plan.local.formatted_amount">\$17.40</Tooltip> <Tooltip tip="currency_details.plan.local.currency">USD</Tooltip> every <Tooltip tip="plan.interval_count">1</Tooltip> <Tooltip tip="plan.interval">month</Tooltip> (charged <Tooltip tip="currency_details.plan.payment.formatted_amount">€15.00</Tooltip> <Tooltip tip="currency_details.plan.payment.currency">EUR</Tooltip>) automatically until you cancel.

    **Total Today:** <Tooltip tip="currency_details.plan.due_now.local.formatted_amount">\$1.16</Tooltip> <Tooltip tip="currency_details.plan.due_now.local.currency">USD</Tooltip> for <Tooltip tip="plan.trial.interval_count">7</Tooltip> <Tooltip tip="plan.trial.interval">Day</Tooltip> Trial\
    You'll be charged <Tooltip tip="currency_details.plan.due_now.payment.formatted_amount">€1.00</Tooltip> <Tooltip tip="currency_details.plan.due_now.payment.currency">EUR</Tooltip>. Full price starts after your trial ends on <Tooltip tip="calculated from plan.trial.interval_count">January 4, 2025</Tooltip>.
  </Tab>

  <Tab title="Hide redundant currency">
    When `local.currency` equals `payment.currency`, hide the charged amount—it's redundant:

    Your subscription will renew at <Tooltip tip="currency_details.plan.local.formatted_amount">€15.00</Tooltip> <Tooltip tip="currency_details.plan.local.currency">EUR</Tooltip> every <Tooltip tip="plan.interval_count">1</Tooltip> <Tooltip tip="plan.interval">month</Tooltip> automatically until you cancel.

    **Total Today:** <Tooltip tip="currency_details.plan.due_now.local.formatted_amount">€1.00</Tooltip> <Tooltip tip="currency_details.plan.due_now.local.currency">EUR</Tooltip> for <Tooltip tip="plan.trial.interval_count">7</Tooltip> <Tooltip tip="plan.trial.interval">Day</Tooltip> Trial\
    Full price starts after your trial ends on <Tooltip tip="calculated from plan.trial.interval_count">January 4, 2025</Tooltip>.
  </Tab>

  <Tab title="Show only local">
    Display the local currency equivalent to help users understand the cost, and charge in your payment currency behind the scenes:

    Your subscription will renew at <Tooltip tip="currency_details.plan.local.formatted_amount">\$17.40</Tooltip> <Tooltip tip="currency_details.plan.local.currency">USD</Tooltip> every <Tooltip tip="plan.interval_count">1</Tooltip> <Tooltip tip="plan.interval">month</Tooltip> automatically until you cancel.

    **Total Today:** <Tooltip tip="currency_details.plan.due_now.local.formatted_amount">\$1.16</Tooltip> <Tooltip tip="currency_details.plan.due_now.local.currency">USD</Tooltip> for <Tooltip tip="plan.trial.interval_count">7</Tooltip> <Tooltip tip="plan.trial.interval">Day</Tooltip> Trial\
    Full price starts after your trial ends on <Tooltip tip="calculated from plan.trial.interval_count">January 4, 2025</Tooltip>.
  </Tab>
</Tabs>

### Exchange Rates

Exchange rates are **markup-free** and **updated automatically** by PayNext. You don't need to manage exchange rate data in your application.

### Rounded Prices

Rounded prices improve conversion rates. For example, `$0.99` converts better than `$0.71`.

The `local` object returns both options:

```json theme={"system"}
{
  "local": {
    "formatted_amount": "$17.38",
    "formatted_amount_rounded": "$17.99"
  }
}
```

| Field                      | Example | Use case                                            |
| -------------------------- | ------- | --------------------------------------------------- |
| `formatted_amount`         | \$17.38 | Exact conversion—use when precision matters         |
| `formatted_amount_rounded` | \$17.99 | Rounded price—**recommended** for better conversion |

<Tip>
  We recommend using `formatted_amount_rounded` for checkout displays. Rounded prices feel more intentional and typically have higher conversion rates.
</Tip>

**Building this in code:**

```javascript theme={"system"}
const { currency_details, plan } = clientSession;
const { local, payment, due_now } = currency_details.plan;

// Check if currencies are different
const showPaymentCurrency = local.currency !== payment.currency;

// Calculate trial end date
const trialEndDate = new Date(Date.now() + plan.trial.interval_count * 86400000);
const trialEndDateFormatted = trialEndDate.toLocaleDateString('en-US', { 
  month: 'long', 
  day: 'numeric', 
  year: 'numeric' 
});

// Build renewal text
let renewalText = `Your subscription will renew at ${local.formatted_amount_rounded} ${local.currency} every ${plan.interval_count} ${plan.interval}`;
if (showPaymentCurrency) {
  renewalText += ` (charged ${payment.formatted_amount} ${payment.currency})`;
}
renewalText += ' automatically until you cancel.';

// Build total today text
let totalText = `Total Today: ${due_now.local.formatted_amount_rounded} ${due_now.local.currency} for ${plan.trial.interval_count} ${plan.trial.interval} Trial\n`;
if (showPaymentCurrency) {
  totalText += `You'll be charged ${due_now.payment.formatted_amount} ${due_now.payment.currency}. `;
}
totalText += `Full price starts after your trial ends on ${trialEndDateFormatted}.`;

const checkoutCopy = `${renewalText}\n\n${totalText}`;
```

**API response:**

```json theme={"system"}
{
  "currency_details": {
    "plan": {
      "payment": { "formatted_amount": "€15.00", "currency": "EUR" },
      "local": { "formatted_amount": "$17.40", "formatted_amount_rounded": "$17.99", "currency": "USD" },
      "due_now": {
        "payment": { "formatted_amount": "€1.00", "currency": "EUR" },
        "local": { "formatted_amount": "$1.16", "formatted_amount_rounded": "$1.49", "currency": "USD" }
      }
    }
  },
  "plan": {
    "interval": "month",
    "interval_count": 1,
    "trial": {
      "interval": "days",
      "interval_count": 7
    }
  }
}
```

## Currency Formatting Reference

Different currencies have different formatting rules. PayNext handles this automatically:

<CodeGroup>
  ```json Zero-Decimal (JPY, KRW) theme={"system"}
  {
    "amount": 2000,
    "currency": "JPY",
    "currency_decimals": 0,
    "currency_symbol": "¥",
    "formatted_amount": "¥2000"
  }
  // 2000 minor units = ¥2000
  ```

  ```json Two-Decimal (USD, EUR, GBP) theme={"system"}
  {
    "amount": 1999,
    "currency": "USD",
    "currency_decimals": 2,
    "currency_symbol": "$",
    "formatted_amount": "$19.99"
  }
  // 1999 minor units = $19.99
  ```

  ```json Three-Decimal (IQD, KWD) theme={"system"}
  {
    "amount": 1500,
    "currency": "IQD",
    "currency_decimals": 3,
    "currency_position": "right",
    "currency_symbol": "د.ع",
    "formatted_amount": "1.500د.ع"
  }
  // 1500 minor units = 1.500 IQD
  ```
</CodeGroup>

## Response Fields Reference

<ResponseField name="currency_details" type="object">
  Currency-specific pricing and display information.

  <Expandable title="Properties">
    <ResponseField name="plan" type="object">
      Pricing information for the plan.

      <Expandable title="Properties">
        <ResponseField name="payment" type="object" required>
          Plan price in payment currency—the recurring amount for future renewals.

          <Expandable title="Properties">
            <ResponseField name="amount" type="integer">
              Amount in minor units (e.g., 1999 = \$19.99).
            </ResponseField>

            <ResponseField name="currency" type="string">
              ISO 4217 currency code (e.g., "USD", "EUR").
            </ResponseField>

            <ResponseField name="currency_decimals" type="integer">
              Decimal places for this currency (0, 2, or 3).
            </ResponseField>

            <ResponseField name="currency_position" type="string">
              Symbol position: "left" or "right".
            </ResponseField>

            <ResponseField name="currency_symbol" type="string">
              Currency symbol (e.g., "\$", "€", "¥").
            </ResponseField>

            <ResponseField name="formatted_amount" type="string">
              Ready-to-display formatted amount.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="local" type="object">
          Local currency equivalent (included when customer's country differs from payment currency).

          <Expandable title="Properties">
            <ResponseField name="amount" type="integer">
              Amount in local currency minor units.
            </ResponseField>

            <ResponseField name="currency" type="string">
              Local currency code.
            </ResponseField>

            <ResponseField name="currency_exchange_rate" type="number">
              Exchange rate from payment to local currency.
            </ResponseField>

            <ResponseField name="formatted_amount" type="string">
              Formatted local amount.
            </ResponseField>

            <ResponseField name="formatted_amount_rounded" type="string">
              Rounded formatted amount for cleaner display.
            </ResponseField>
          </Expandable>
        </ResponseField>

        <ResponseField name="due_now" type="object">
          Amount charged now—trial price if enabled, or same as `payment` if no trial.

          <Expandable title="Properties">
            <ResponseField name="payment" type="object">
              Due now in payment currency (same structure as `plan.payment`).
            </ResponseField>

            <ResponseField name="local" type="object">
              Due now in local currency (same structure as `plan.local`).
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>
