BEFORE A PAYMENT Currency Exchange Quote Get a response with the FX rate and the time duration plus a token. You will be able to send it in the payment request in order to trace and assure the FX rate.
The FX rate is updated every 60 seconds by default. If you need a different configuration, please request a custom frecuency to our team.
The exchange rate token can be configured to have a lifetime of between 1 minute and up to 1 day. The expiration is to request a transaction within that time range, once the transaction has been created with the exchange rate token, the quoted FX will appear in the payment and also the payments will have their own, unrelated expiration time with the expiration of the exchange rate token.
Currency Exchange Quote
GET
{{api_environment_url}}/api/fx/currency-exchange/:type
This endpoint allows you to get FX quotes.
Path Parameters
Mandatory. Add the transaction type: payin
or payout
Query Parameters
Mandatory. The currency that you use to fund a currency conversion
Mandatory. The quote currency which is the second currency appearing in a currency pair quotation
Mandatory. The Localpayment account which you are working with
Mandatory. Bearer JWT token in format Bearer eyJ0...
. For more information about authentication, please refer to Authentication
200 400 Error 401
Copy [
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"transactionType": "payin",
"accountNumber": "032.840.00000001",
"sourceCurrency": "USD",
"createdOn": "2021-06-01T13:48:00.441+00:00",
"expiredOn": "2021-06-01T13:49:00.441+00:00",
"quotes": [
{
"paymentMethodCode": "1004",
"rate": 94.721048,
"quoteCurrency": "ARS"
},
{
"paymentMethodCode": "1008",
"rate": 94.721048,
"quoteCurrency": "ARS"
}
]
}
]
Copy {
"timestamp": "2021-06-01T13:55:35.999+00:00",
"status": 400,
"error": "Bad Request",
"message": "Required String parameter 'source' is not present",
"path": "/fx/currency-exchange/currency-layer"
}
Copy {
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
Example: Currency Exchange Quote for PAYINS
Request Status Ok
Copy curl --location \
--request GET '{{api_environment_url}}/api/fx/currency-exchange/payin?sourceCurrency=USD"eCurrency=ARS&accountNumber= 032.840 . 00000001 ' \
--header 'Authorization: Bearer {{token}}'
Copy {
"exchangeRateToken" : "ba60cbfe-5faa-41d5-991e-5ffe5e63e43c" ,
"transactionType" : "PayIn" ,
"accountNumber" : "074.840.00000001" ,
"sourceCurrency" : "USD" ,
"creationDate" : "2022-04-07T18:16:43.6498861+00:00" ,
"expirationDate" : "2022-04-07T18:46:43.6498861+00:00" ,
"quotes" : [
{
"paymentMethodCode" : "1314" ,
"rate" : 4.819123 ,
"quoteCurrency" : "BRL"
}
]
}
Example: Currency Exchange Quote for PAYOUTS
Request Status Ok
Copy curl --location \
--request GET '{{api_environment_url}}/api/fx/currency-exchange/payout?sourceCurrency=USD"eCurrency=ARS&accountNumber= 032.840 . 00000017 ' \
--header 'Authorization: Bearer {{token}}'
Copy {
"exchangeRateToken" : "14b23df8-f87f-4495-b6ee-7db71a17bfcd" ,
"transactionType" : "PayOut" ,
"accountNumber" : "032.840.00000017" ,
"sourceCurrency" : "USD" ,
"creationDate" : "2023-01-31T13:48:17.3005611+00:00" ,
"expirationDate" : "2023-01-31T16:00:17.3005611+00:00" ,
"quotes" : [
{
"paymentMethodCode" : "0010" ,
"rate" : 178.996012 ,
"quoteCurrency" : "ARS"
}
]
}
Last updated 9 months ago