About GetDynamicExchangeRateQuote
Use this API to retrieve the current Bill.com foreign exchange rate.
Since the Bill.com foreign exchange rate changes periodically, use this API to retrieve a current exchangeRate
and batchId
value:
exchangeRate
is required while creating bills and vendor credits for international vendors. See Bill and VendorCredit for information about usingexchangeRate
.batchId
is required while making bill payments to international vendors via international ePayments. See PayBills for information about usingbatchId
.
In your GetDynamicExchangeRateQuote.json
request, set type
as the code for currency and currency type. See the parameters table below for details about the type
values you can set.
In this example for a Canadian vendor, type
is set as POC3
to specify that the bill or vendor credit is for a foreign currency and the payment is made in the same foreign currency.
Note: With the vendorData
array, you can retrieve the exchangeRate
and batchId
for multiple international vendors in a single GetDynamicExchangeRateQuote.json
call.
Example
Request
<API_URL_EndPoint>/GetDynamicExchangeRateQuote.json
data={
"vendorData" : [ {
"vendorId" : "00901PUSPHXRWUMQ6su1",
"totalAmount" : "5.00",
"type" : "POC3"
} ]
}
In response, a batchId
is retrieved for the Bill.com CAD (Canadian Dollar) exchange rate at the time of the request.
Response
{
"response_status" : 0,
"response_message" : "Success",
"response_data" : {
"batchId" : 908,
"exchangeRates" : [
{
"paymentCurrency" : "CAD",
"exchangeRate" : 1.23943521,
"validFrom" : 0.00,
"validTo" : null,
"vendorId" : "00901PUSPHXRWUMQ6su1"
} ]
}
}
Resources
Parameters
Field Name | Description | Required? |
---|---|---|
vendorData | Array of one or more vendors (up to 200) | Yes |
vendorId | System generated ID of the vendor to be paid | Yes |
totalAmount | Bill amount to be paid in foreign currency | Yes |
type |
Code for currency & currency type
|
Yes |