GetRates

Purpose

Use this function to get exchange rates.

Mandatory

Yes

Input Parameters

An associative array that contains the plugin configuration data.

Parameter name Description Type
config An associative array that contains configuration parameter data array[ParameterData]

ParameterData

Parameter name Available values Description Type
<name> <value>

Parameter value.
<name> Name of the parameter. Corresponds to parameter name in the configuration Parameter.
<value> Value of the parameter according to defined type and size in the configuration Parameter.


Response

An associative array that contains the following objects:

Parameter name Description Type

<currency_rate>
An exchange rates for the currency. CurrencyExchangeRates

CurrencyExchangeRates

Parameter name Available values Description Type
code USD, GBP, and so on. An 3-letter (ISO) code of a currency that is supported in Billing. This is a base currency code. string
rates
An array of exchange rates. array[ExchangeRate]

ExchangeRate

Parameter name Available values Description Type
code USD, GBP, etc. An ISO 3-letter code of currency that is supported in billing. This is a quote currency code. string
rate
An exchange rate value. number

Example

Input data (request)

Copy
{
    "config": {
        "username": "example_user",
        "password": "example_password"    }
}

function Example_GetRates($params)
{
    return array(
        'code' => 'USD',
        'rates' => array(
            array(
                'code' => 'CAD',
                'rate' => 1.255525),
            array(
                'code' => 'EUR',
                'rate' => 0.908932)
        )
    );
}
CloudBlue, an Ingram Micro business, uses cookies to improve the usability of our site. By continuing to use this site and/or logging in you are accepting the use of these cookies. For more information, visit our Privacy Policy.