Skip to content

GetCurrencyExchangeRate

Arivetti edited this page Aug 8, 2025 · 2 revisions

The GetCurrencyExchangeRate function retrieves the exchange rate between the entity base currency and the given currency.

Declaration

C#

public WSResult2OfArrayOfDecimal GetCurrencyExchangeRate(string token, string currencyCode)

Visual Basic

Public Function GetCurrencyExchangeRate(ByVal token As String, ByVal currencyCode As String) As WSResult2OfArrayOfDecimal

Parameter List

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.

Example

C#

Integration ws = new Integration();

String auth = "";// See Authentication page for more
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
  }
}

Visual Basic

Dim ws As New Integration

Dim auth As String = "" // See Authentication page for more
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

See Also

Clone this wiki locally