Knowledge Center

Knowledge Center > API > REST API > REST API Reference > Custom Exchange Rate > Get Custom Foreign Currency Exchange Rates

Get Custom Foreign Currency Exchange Rates

This feature is in Limited Availability. If you wish to have access to the feature, submit a request at Zuora Global Support

This reference describes how to query custom foreign exchange rates from Zuora. You can use this API method to query exchange rates only if you use a custom exchange rate provider and upload rates with the Import Foreign Exchange Rates mass action. If you want to get exchange rates for the default exchange rate provider, Oanda, see Foreign Currency Conversion for Data Source Exports.

For more information about currency conversion in Zuora, see Foreign Currency Conversion.

Request

  • Production: GET https://api.zuora.com/rest/v1/custom-exchange-rates/{currency}
  • API Sandbox: GET https://apisandbox-api.zuora.com/rest/v1/custom-exchange-rates/{currency}

Request Header

The Accept request header is optional. Only JSON is returned.

Request Path Parameter

Specify the following parameter in the URL path of the request.

currency

required

The target currency. The exchange rates in the response are calculated in relation to the target currency.

The value must be a three-letter currency code, for example, USD. See ISO Currency Codes for a full list of currency codes.

Request Query Parameters

Specify the following parameters in the URL query string of the request.

startDate

required

Start date of the date range for which you want to get exchange rates.

The date must be in yyyy-mm-dd format, for example, 2016-01-15. The start date cannot be later than the end date.

endDate

required

End date of the date range for which you want to get exchange rates.

The date must be in yyyy-mm-dd format, for example, 2016-01-16. The end date can be a maximum of 90 days after the start date.

Response

Response Body Parameters

success

Returns true if the request is successful. Otherwise, returns false.

 

processId

The internal process ID used to assist Zuora support. Returned only if success is false.

 

reasons

Information describing the reason for the result. Returned only if success is false.

code

An eight-digit numeric error code.

message

A description of the error.

 

inverse

  • If true, the exchange rate in the response is an inverse exchange rate.
  • If false, the exchange rate in the response is not an inverse exchange rate.

The value is determined by the Use inverse rate checkbox in your Z-Finance Manage Currency Conversion settings.

 

rates

Container for exchange rate data. Contains a set of fields that provide exchange rate data for each day between the specified startDate and endDate (inclusive). 

<date>

Container for exchange rate information on a given date. The field name is the date in yyyy-mm-dd format, for example, 2016-01-15.

providerExchangeRateDate

The date of the exchange rate used. The date is in yyyy-mm-dd format.

Corresponds to the value specified in the Provider Exchange Rate Date column in the Import Foreign Exchange Rates template when you uploaded the rates through the Mass Updater.

<currency>

The exchange rate on the providerExchangeRateDate. The field name is the ISO currency code of the currency, for example, EUR.

There may be more than one currency returned for a given providerExchangeRateDate. If the rate for a certain currency is not available on the providerExchangeRateDate, the currency is not returned in the response.

 
 

Example

Request

GET https://apisandbox-api.zuora.com/rest/v1/custom-exchange-rates/USD?startDate=2016-01-15&endDate=2016-01-16

Response

{
    "success": true,
    "inverse": true, 
    "rates": {
        "2016-01-15": {
            "providerExchangeRateDate”: "2016-01-14", 
            "JPY": 0.0084,
            "EUR": 1.0815,
            "GBP": 1.4472
        },
        "2016-01-16": {
            "providerExchangeRateDate": "2016-01-15",
            "JPY": 0.0085,
            "EUR": 1.0827,
            "GBP": 1.4634
        }
    }
}
Last modified

Tags

Classifications

(not set)