Get FX rates
Get FX rates for a particular currency pair.
Definition
URL
GET https://api-test.instarem.com:4803/api/v1/bookfx/rate?sell/currency=USD&buy/currency=INR&type=
Example Request
- Bash
- Javascript
- C#
curl --request get \\
--url "https://api-test.instarem.com:4803/api/v1/bookfx/rate?sell/currency=&buy/currency=&type=" \\
--header 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0OTgxMzQ4OTQsImRhdGEiOnsic3ViIjoiNTk0MjNmMzZjZWEyMTQ2OTI2ODczOWE1IiwiY2xpZW50IjoiNTk0MjNmMzZjZWEyMTQ2OTI2ODczOWExIn0sImlhdCI6MTQ5ODA0ODQ5NH0.pevwSDpk-JDNtVIpqFu_m0Xu1UnDVumrAYStcrxf8sM' \\
--header 'content-type: application/json' \\
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("get", "https://api-test.instarem.com:4803/api/v1/bookfx/rate?sell/currency=&buy/currency=&type=")
xhr.setRequestHeader("authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0OTgxMzQ4OTQsImRhdGEiOnsic3ViIjoiNTk0MjNmMzZjZWEyMTQ2OTI2ODczOWE1IiwiY2xpZW50IjoiNTk0MjNmMzZjZWEyMTQ2OTI2ODczOWExIn0sImlhdCI6MTQ5ODA0ODQ5NH0.pevwSDpk-JDNtVIpqFu_m0Xu1UnDVumrAYStcrxf8sM");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
var client = new RestClient("https://api-test.instarem.com:4803/api/v1/bookfx/rate?sell/currency=&buy/currency=&type=");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0OTgxMzQ4OTQsImRhdGEiOnsic3ViIjoiNTk0MjNmMzZjZWEyMTQ2OTI2ODczOWE1IiwiY2xpZW50IjoiNTk0MjNmMzZjZWEyMTQ2OTI2ODczOWExIn0sImlhdCI6MTQ5ODA0ODQ5NH0.pevwSDpk-JDNtVIpqFu_m0Xu1UnDVumrAYStcrxf8sM");
request.AddHeader("content-type", "application/json");
IRestResponse response = client.Execute(request);
Header Parameters
Parameter | Description | Type | Required |
---|---|---|---|
authorization | auth token | String | Yes |
content-type | The Content-Type entity header is used to indicate the media type of the resource. Expected value is application/json. | String | Yes |
X-CLIENT-ID | Unique id for client generated by Nium, Required only in case of partner based model (E.g. 593feb7c7c52bb2357b2df6c). | String | No |
Query Parameters
Parameter | Description | Type | Required |
---|---|---|---|
sell_currency | Return sell currency (3-letter ISO-4217 code) | String | Yes |
buy_currency | Return buy currency (3-letter ISO-4217 code) | String | Yes |
type | One of ["", PREFUNDING, SCHEDULED1, SCHEDULED2]. If left empty, this field defaults to PREFUNDING | String | No |
Example Response
{
"sell_currency": "USD",
"buy_currency": "INR",
"fx_rate": 64.5132,
"margin": 0.5,
"instarem_fx_rate": 64.1874,
"expiry_at": ""
}
Response Parameters
Parameter | Description | Type |
---|---|---|
sell_currency | Return sell currency (3-letter ISO-4217 code) | String |
buy_currency | Return buy currency (3-letter ISO-4217 code) | String |
fx_rate | Returns real time FX provider rate | Number |
margin | Returns margin percent as specified in the agreement for the Book FX pair | Number |
instarem_fx_rate | Returns Instarem FX rate. | Number |
expiry_at | expiry time of a potential scheduled FX if booked now | String |