getRate
This does not lock a rate for a transfer. You can lock a rate with the getTransferQuote mutation.
⚠️
Sandbox rates do not represent real world pricing Skip link to Sandbox rates do not represent real world pricing
Parameters Skip link to Parameters
| Parameter | Type | Required |
|---|---|---|
| source_currency | ISO4217! | true |
| destination_currency | ISO4217! | true |
query
string
Defaults to {}
``200 200
object
data
object
getRate
object
getRate object
``400 400
NodeShell
xxxxxxxxxx
// query getRate
var axios = require('axios');
var data = JSON.stringify({
query: `query getRate (
$source_currency: ISO4217!
$destination_currency: ISO4217!
) {
getRate (
source_currency: $source_currency
destination_currency: $destination_currency
) {
rate
inverted_rate
source_currency
destination_currency
} } }`,
variables: {"source_currency":"USD","destination_currency":"MXN"}
});
var config = {
method: 'post',
url: 'https://external.routefusion.com/graphql',
headers: {
'Authorization': 'Bearer
'Content-Type': 'application/json'
},
data : data
};
axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); }) .catch(function (error) { console.log(error); });
xxxxxxxxxx
{ "data": { "getRate": { "rate": "20.524800", "inverted_rate": "0.048722", "source_currency": "USD", "destination_currency": "MXN" } } }