GetCurrencyExchangeRate
PatrickLane edited this page Oct 29, 2014
·
1 revision
The GetCurrencyExchangeRate
function retrieves the exchange rate between the entity base currency and the given currency.
public WSResult2OfArrayOfDecimal GetCurrencyExchangeRate(string token, string currencyCode)
Public Function GetCurrencyExchangeRate(ByVal token As String, ByVal currencyCode As String) As WSResult2OfArrayOfDecimal
Parameter | Type | Description |
---|---|---|
token | String | The session token retrieved during authentication. |
currencyCode | String | The code of the currency for which the exchange rate is being requested. |
Integration ws = new Integration();
String auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
WSResult2OfArrayOfDecimal xrate = ws.GetCurrencyExchangeRate(auth, "GBP");
if (xrate.Status == OperationStatus.Success)
{
// Do something with the exchange rate
}
else
{
// Examine ErrorCode to get more information on the failure
}
}
Dim ws As New Integration
Dim auth As String = ws.Login(entityID, partnerKey, userKey)
If (Not Me.auth Is Nothing) Then
Dim xrate As WSResult2OfArrayOfDecimal = Me.ws.GetCurrencyExchangeRate(Me.auth, "GBP")
If (xrate.Status = OperationStatus.Success) Then
' Do something with the currency exchange rate
Else
' Examine ErrorCode to get more information on the failure
End If
End If