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

ParameterTypeDescription
sourceCurrencystring3-letter currency code (e.g., "ARS")
quoteCurrencystring3-letter currency code (e.g., "USD")
accountNumberstringSource currency account identifier
quoteAccountNumberstringTarget currency Localpayment account identifier

Example Request

curl --request GET \
     --url 'https://api.stage.localpayment.com/api/fx/currency-exchange/payin?sourceCurrency=ARS&quoteCurrency=USD&accountNumber=032.840.00000001&quoteAccountNumber=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

FieldTypeDescription
exchangeRateTokenstringUnique token to use in subsequent transactions
transactionTypestringType of transaction (PayIn, PayOut)
accountNumberstringLocalpayment account identifier
sourceCurrencystringSource currency code
creationDatedatetimeWhen the quote was created
expirationDatedatetimeWhen the quote expires
quotesarrayAvailable 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 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

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.