Forex
See Foreign exchange for background details.
The forex API client allows a forex rate group to be created as well as retrieving a specific group specific to you. Below are code samples that show how this client can be used.
It is also possible to retrieve indicative rates. For more information, see List indicative foreign exchange rates.
Configure a new forex API client
var config = new Configuration("{api-token}", Environment.Staging);
IForexApiClient forexClient = new ForexApiClient(config);Create forex rate group
var durationInDays = 1;
Response<ForexInfo> response = await forexClient.CreateAsync(durationInDays);Retrieve forex rate group
int rateGroupId = reponse.Resource.RateGroupId;
ForexInfo forexGroup = await forexClient.RetrieveAsync(rateGroupId);Retrieve indicative forex rates
It is possible to retrieve indicative rates for all currencies or a list of currencies.
// retrieve all indicative rates
ForexInfo indicativeRates = await forexClient.GetIndicativeRatesAsync();
// retrieve indicative rates for specific currencies
var currencies = new List<Currency>{ Currency.GBP, Currency.USD };
ForexInfo specificRates = await forexClient.GetIndicativeRatesAsync(currencies);Updated 28 days ago
Did this page help you?