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

# Quote Currency Conversion

Get real-time currency exchange quotes with secure token-based rates for your international transactions.

The Currency Exchange Quote API allows you to obtain exchange rates between different currencies and receive a secure token that locks in the quoted rate for a specified duration. This ensures rate consistency for your subsequent transactions while protecting against market volatility.

## Prerequisites

Before requesting currency exchange quotes, ensure you have:

* **Valid API credentials** with currency exchange permissions.
* **Active account numbers** for both source and quote currencies.

***

## API Endpoint

To quote an exchange, send a `GET`request to the [Get FX Quote](https://docs.localpayment.com/reference/currency-exchange-quote.md) endpoint.

### Endpoint

```http theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
GET https://api.stage.localpayment.com/api/fx/currency-exchange/{type}
```

Replace `{type}` with the transaction type that matches your use case:

| `{type}` | When to use |
| - | - |
| `payin` | You want to show the exchange rate before receiving a payment |
| `payout` | You want to show the exchange rate before sending a payment |
| `CurrencyExchange` | You want to show the exchange rate before sending a currency conversion. |

### Authentication

Include your access token in the request headers:

```http theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
Authorization: Bearer <your_access_token>
```

### Key Request Parameters

| Parameter | Type | Description |
| - | - | - |
| `sourceCurrency` | string | Currency you want to convert from (e.g., `"ARS"`, `"USDT"`) |
| `quoteCurrency` | string | Currency you want to convert to (e.g., `"USD"`) |
| `accountNumber` | string | Your Localpayment account that holds the **source currency** (the account being debited) |
| `quoteAccountNumber` | string | Your Localpayment account that holds the **target currency** (the account to be credited) |

### Example Request

> [tab] Local currency (PayIn)
>
> ```bash curl theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
> curl --request GET \
>      --url 'https://api.stage.localpayment.com/api/fx/currency-exchange/payin?sourceCurrency=ARS&quoteCurrency=USD&accountNumber={{sourceAccountNumber}}&quoteAccountNumber={{quoteAccountNumber}}' \
>      --header 'Authorization: Bearer <your_access_token>' \
>      --header 'accept: application/json'
> ```

> [tab] Stablecoin (USDC / USDT)
>
> ```bash curl theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
> curl --request GET \
>      --url 'https://api.stage.localpayment.com/api/fx/currency-exchange/CurrencyExchange?sourceCurrency=USDT&quoteCurrency=USD&accountNumber={{sourceAccountNumber}}&quoteAccountNumber={{quoteAccountNumber}}' \
>      --header 'Authorization: Bearer <your_access_token>' \
>      --header 'accept: application/json'
> ```

***

## Response Handling

### Success Response

A successful request returns exchange rate information with a secure token:

> [tab] Local currency (PayIn)
>
> ```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
> {
>   "exchangeRateToken": "5c3q89a7-f1bc-4ba5-a3b5-411ba0d144ca",
>   "transactionType": "PayIn",
>   "accountNumber": "{{sourceAccountNumber}}",
>   "sourceCurrency": "ARS",
>   "creationDate": "2024-12-27T21:33:32.6513692+00:00",
>   "expirationDate": "2024-12-28T05:33:32.6513692+00:00",
>   "quotes": [
>     {
>       "paymentMethodCode": "1005",
>       "rate": 0.0008369108482392735,
>       "quoteCurrency": "USD"
>     },
>     {
>       "paymentMethodCode": "1023",
>       "rate": 0.0008369108482392735,
>       "quoteCurrency": "USD"
>     },
>     {
>       "paymentMethodCode": "1000",
>       "rate": 0.0008369108482392735,
>       "quoteCurrency": "USD"
>     }
>   ]
> }
> ```

> [tab] Stablecoin (USDC / USDT)
>
> ```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
> {
>   "accountNumber": "{{sourceAccountNumber}}",
>   "creationDate": "2026-01-15T21:03:06.2722727Z",
>   "exchangeRateToken": "b4eb8276-8edc-43e6-937d-97ecd98ea902",
>   "expirationDate": "2026-01-15T21:14:06.2722727Z",
>   "quotes": [
>     {
>       "paymentMethodCode": null,
>       "quoteAccountNumber": "{{quoteAccountNumber}}",
>       "quoteCurrency": "USD",
>       "rate": 1
>     }
>   ],
>   "sourceCurrency": "USDT",
>   "transactionType": "CurrencyExchange"
> }
> ```

#### Key Response Fields

| Field | Type | Description |
| - | - | - |
| `exchangeRateToken` | string | Unique token to use in subsequent transactions |
| `transactionType` | string | Type of transaction (PayIn, PayOut) |
| `accountNumber` | string | Source currency account (the account debited) |
| `sourceCurrency` | string | Source currency code |
| `creationDate` | datetime | When the quote was created |
| `expirationDate` | datetime | When the quote expires |
| `quotes` | array | Available payment methods and their rates |

### Error Responses

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "detail": "You do not have permission to perform this action."
}
```

***

## Best Practices

### Security & Performance

* Always use HTTPS for API requests.
* Store access tokens securely and rotate them regularly.
* Monitor token expiration times closely.
* Cache quotes appropriately but respect expiration dates.

### Important: Token Expiration

Exchange rate tokens have limited lifespans. Plan your transaction workflow to complete within the expiration window. The quoted rate is only guaranteed while the token is valid.

> [!NOTE]
>
> **Pro Tip**
>
> Different payment methods may offer different exchange rates. Review all available options in the `quotes` array to select the most favorable rate for your use case.

***

## Integration Workflow

1. **Get Quote**: Request exchange rates for your desired currency pair.
2. **Select Method**: Choose the optimal payment method from the quotes.
3. **Store Token**: Save the `exchangeRateToken` for your transaction.
4. **Execute Transaction**: Use the token in your payment API call.
5. **Monitor Expiry**: Complete the transaction before the `expirationDate`.

***

## Next Steps

> [card] [Payin Processing](https://docs.localpayment.com/reference/payins.md)
>
> Process payins using your converted currency.

> [card] [Payout Processing](https://docs.localpayment.com/reference/create-a-payout.md)
>
> Process payouts using your converted currency.

> [card] [Execute Currency Exchange](https://docs.localpayment.com/reference/exchange-bulk.md)
>
> Use your exchange rate token to execute the currency conversion.

> [!NOTE]
>
> **Pro Tip**
>
> Test your workflow thoroughly in our sandbox environment. This ensures your integration handles rate fluctuations, token expiration, and error scenarios correctly before going live.

***

> [!NOTE]
>
> **Need Help?**
>
> Contact our [support team](mailto:support@localpayment.com) if you experience any issues or need assistance for integration.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.