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 GETrequest to the Get FX Quote endpoint.
Endpoint
GET https://api.stage.localpayment.com/api/fx/currency-exchange/{type}Replace {type} with your transaction type (e.g., payin, payout).
Authentication
Include your access token in the request headers:
Authorization: Bearer <your_access_token>Key Request Parameters
| Parameter | Type | Description |
|---|---|---|
sourceCurrency | string | 3-letter currency code (e.g., "ARS") |
quoteCurrency | string | 3-letter currency code (e.g., "USD") |
accountNumber | string | Source currency account identifier |
quoteAccountNumber | string | Target currency Localpayment account identifier |
Example Request
curl --request GET \
--url 'https://api.stage.localpayment.com/api/fx/currency-exchange/payin?sourceCurrency=ARS"eCurrency=USD&accountNumber=032.840.00000001"eAccountNumber=032.840.00000002' \
--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:
{
"exchangeRateToken": "5c3q89a7-f1bc-4ba5-a3b5-411ba0d144ca",
"transactionType": "PayIn",
"accountNumber": "032.840.00000001",
"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"
}
]
}Key Response Fields
| Field | Type | Description |
|---|---|---|
exchangeRateToken | string | Unique token to use in subsequent transactions |
transactionType | string | Type of transaction (PayIn, PayOut) |
accountNumber | string | Localpayment account identifier |
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
{
"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.
Pro Tip
Different payment methods may offer different exchange rates. Review all available options in the
quotesarray to select the most favorable rate for your use case.
Integration Workflow
- Get Quote: Request exchange rates for your desired currency pair.
- Select Method: Choose the optimal payment method from the quotes.
- Store Token: Save the
exchangeRateTokenfor your transaction. - Execute Transaction: Use the token in your payment API call.
- Monitor Expiry: Complete the transaction before the
expirationDate.
Next Steps
Execute Currency Exchange
Use your exchange rate token to execute the currency conversion.
Payin Processing
Process payins using your converted currency.
Payout Processing
Process payouts using your converted currency.
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.
Need Help?
Contact our support team if you experience any issues or need assistance for integration.
Updated about 2 hours ago
