Payment Quote
Can use these endpoints to get a payment quote.
Generate Payment Quote
This endpoint is used to get a payment quote including FX and other fees. The endpoint is as follows:
POST https://sandbox-api.veem.com/veem/v1.2/exchangerates/{quote}
Headers
There are 2 headers necessary for the use of this endpoint:
- X-request-id: This is a number unique to the current API request, and follows the UUID format. Reusing this header without changing the value will result in a 409 (Conflict) status. An example X-request-id is as follows:
48855846-628d-4177-b071-80332a116f0a
- Authorization: This header holds the bearer token required to use Veem's public API. Failure to use a valid bearer token will result in a 404 (Not Found) status. An example of a valid token is as follows:
Bearer d49e7fd4-2600-4dd4-a572-118668febbe7
Request Payload
When fetching a payment quote, one should follow a format similar to the example below:
{
"payerAccountId":11560,
"fromAmount":100,
"fromCurrency":"USD",
"fromCountry":"US",
"toCountry":"DE",
"toCurrency":"EUR",
"bruid":"25ef26da-0c69-3ebd-ae31-18aee238a692"
}
Request Parameters
The following table contains detailed information on the payload's parameters, such as the parameter name, whether it is mandatory or not, formatting (if applicable), and size of the parameter
Parameter | Mandatory? | Format/Values | Size/Type |
---|---|---|---|
payerAccountId | Yes | Account ID in Veem's system | Long |
fromAmount | Yes (If toAmount is not provided) | BigDecimal | |
toAmount | Yes (if fromAmount is not provided) | BigDecimal | |
fromCurrency | Yes | Currency Code (ISO 4217) | 3 characters |
fromCountry | Yes | ISO 3166-1 alpha-2 standard | 2 characters |
toCountry | Yes | ISO 3166-1 alpha-2 standard | 2 characters |
bruid | No | String | 36 characters |
Notes:
- When fromAmount is provided - meaning this exact amount will be sent
- When toAmount is provided - meaning this exact amount will be received
- Only one of fromAmount/toAmount can be set
For extra information, you can find some resources here:
Currency Codes (ISO 4217): https://www.iban.com/currency-codes
ISO 3166-1 alpha-2 standard: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
Response Payload
Once a valid request has been sent, a response payload of this format should be expected:
{
"payerAmount": {
"number": 100,
"currency": "USD"
},
"payeeAmount": {
"number": 85.43,
"currency": "EUR"
},
"usdAmount": {
"number": 100,
"currency": "USD"
},
"veemRate": 0.854302,
"bruid": "25ef26da-0c69-3ebd-ae31-18aee238a692"
}
Note: Since the BRUID field is optional, if it is not provided or it has expired, the quote will be based on real-time FX rates values instead
Possible errors
When trying to access the payment quote, one may encounter several errors if an invalid parameter/header is used
- Invalid ClientID - Status 400 (Bad Request)
- The token is invalid or expired - Status 401 (Unauthorized)
- The token owner lacks permission to operate the current API - Status 403 (Forbidden)
- Resource not found - Status 404 (Not Found)
- Status 500 (Internal Server Error)
Generate Bulk Payment Quote
This endpoint is used to get bulk payment quotes, which include FX and other fees. The endpoint is as follows:
POST https://sandbox-api.veem.com/veem/v1.2/exchangerates/{quote}/bulk
Headers
The headers are the exact same as generating regular payment quotes, and can be reused
Request Payload
When fetching bulk payment quotes, one should follow a format similar to the example below:
{
"requests": [
{
"payerAccountId": 11560,
"fromAmount": 100,
"fromCurrency": "USD",
"fromCountry": "US",
"toCountry": "DE",
"toCurrency": "EUR",
"bruid": "25ef26da-0c69-3ebd-ae31-18aee238a692"
},
{
"payerAccountId": 11560,
"fromAmount": 100,
"fromCurrency": "USD",
"fromCountry": "US",
"toCountry": "CA",
"toCurrency": "CAD",
"bruid": "25ef26da-0c69-3ebd-ae31-18aee238a692"
}
]
}
Request Parameters
The request parameters are identical to regular payment quotes, and can be reused
Response Payload
Once a valid request has been sent, a response payload of this format should be expected:
[
{
"payerAmount": {
"number": 100,
"currency": "USD"
},
"payeeAmount": {
"number": 129.10,
"currency": "CAD"
},
"usdAmount": {
"number": 100,
"currency": "USD"
},
"veemRate": 1.290984,
"bruid": "25ef26da-0c69-3ebd-ae31-18aee238a692"
},
{
"payerAmount": {
"number": 100,
"currency": "USD"
},
"payeeAmount": {
"number": 88.75,
"currency": "EUR"
},
"usdAmount": {
"number": 100,
"currency": "USD"
},
"veemRate": 0.887471,
"bruid": "25ef26da-0c69-3ebd-ae31-18aee238a692"
}
]
Note: Since the BRUID field is optional, if it is not provided or it has expired, the quote will be based on real-time FX rates values instead
Possible errors
When trying to access the bulk payment quotes, one may encounter several errors if an invalid parameter/header is used
- Invalid ClientID - Status 400 (Bad Request)
- The token is invalid or expired - Status 401 (Unauthorized)
- The token owner lacks permission to operate the current API - Status 403 (Forbidden)
- Resource not found - Status 404 (Not Found)
- Status 500 (Internal Server Error)
Generate Enhanced Payment Quote
This endpoint is used to get the precise payment quote, taking into account both payer and payee account settings and funding methods. This endpoint returns the FX rate as well as fixed fee amounts (e.g. card fee) for both parties, if applicable. The endpoint is as follows:
POST https://sandbox-api.veem.com/veem/1.2./exchangerates/quote/enhanced
Headers
The headers are the exact same as generating regular payment quotes, and can be reused
Request Payload
When fetching enhanced payment quote, one should follow a format similar to the example below:
{
"from": {
"amount": 100
"currency": "USD"
"accountId": 11560,
"fundingMethodType": "Card",
"fundingMethodId": 55085
},
"to": {
"accountId": 944269,
"fundingMethodType": "Bank",
"fundingMethodId": 5231
}
}
Request Parameters
The following table contains detailed information on the payload's parameters, such as the parameter name, whether it is mandatory or not, formatting (if applicable), and size of the parameter
Parameter | Mandatory? | Format/Values | Size/Type |
---|---|---|---|
from.amount | Yes (If toAmount is not provided) | Number | BigDecimal |
from.currency | Yes (If toAmount is not provided) | Currency Code (ISO 4217) | 3 characters |
from.accountId | Yes | Number | Long |
from.fundingMethodType | Yes | "Bank", "Card", "Wallet", etc. | String |
from.fundingMethodId | Yes | Number | Long |
to.amount | Yes (If fromAmount is not provided) | Number | BigDecimal |
to.currency | Yes (If fromAmount is not provided) | Currency Code (ISO 4217) | 3 characters |
to.accountId | Yes | Number | Long |
to.fundingMethodType | Yes | "Bank", "Card", "Wallet", etc. | String |
to.fundingMethodId | Yes | Number | Long |
bruid | No | String | 36 characters |
Response Payload
Once a valid request has been sent, a response payload of this format should be expected:
{
"from" : {
"amount": 100,
"currency": "USD"
}
"to": {
"amount": 129.50,
"currency": "CAD",
"fixedFee": {
"amount":0.96,
"currency" : "CAD",
},
"fxRate": 1.305086
}
}
Possible errors
When trying to access the enhanced payment quote, one may encounter several errors if an invalid parameter/header is used
- from: or/and to: objects are missing (code 50009044) - Status 400 (Bad Request)
- from.accountId: or/and to.accountId are missing (code 50009048) - Status 400 (Bad Request)
- at least one of from.amount: or to.amount is required (code 50001403) - Status 400 (Bad Request)
- only one of from.amount: or to.amount is required (code 50001402) - Status 400 (Bad Request)
- from.currency: or to.currency is missing (code 50009043) - Status 400 (Bad Request)
- from.fundingMethodId or to.fundingMethodId is missing (code 50009047) - Status 400 (Bad Request)
- from.fundingMethodType or to.fundingMethodType is missing (code 50009046) - Status 400 (Bad Request)
- The token is invalid or expired - Status 401 (Unauthorized)
- The token owner lacks permission to operate the current API - Status 403 (Forbidden)
- Resource not found - Status 404 (Not Found)
- Status 500 (Internal Server Error)
Updated 3 days ago