Retrieve historical FX ratesSignature required
The Partner can call this API to get a list of FX rates at a designated time frame. Both market rates and quoted rates are returned if the call is successful.
Structure
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
Request parameters
customerId String REQUIRED
The unique ID that is assigned by WorldFirst to identify a Customer.
startTime Long REQUIRED
The starting time of the queried FX rates.
This is a 13-digit timestamp parameter, for example: 1728576000000
The gap between startTime and endTime must not exceed 30 days.
endTime Long REQUIRED
The ending time of the queried FX rates.
This is a 13-digit timestamp parameter, for example: 1729180800000
The gap between startTime and endTime must not exceed 30 days.
sellCurrency String REQUIRED
3 character ISO-4217 currency code of the currency that the Partner intends to convert from.
More information:
- Maximum length: 3 characters
buyCurrency String REQUIRED
3 character ISO-4217 currency code of the currency that the Partner intends to convert to.
More information:
- Maximum length: 3 characters
Response parameters
result Result REQUIRED
The result of the API call.
sellCurrency String REQUIRED
3 character ISO-4217 currency code of the currency that the Partner intends to convert from.
This field is returned only when the value of result.resultStatus is S
.
More information:
- Maximum length: 3 characters
buyCurrency String REQUIRED
3 character ISO-4217 currency code of the currency that the Partner intends to convert to.
This field is returned only when the value of result.resultStatus is S
.
More information:
- Maximum length: 3 characters
currentRate RateDetails
The current FX rates.
This field is returned only when the value of result.resultStatus is S
.
historicalRates Array<RateDetails>
The historical FX rates per hour.
This field is returned only when the value of result.resultStatus is S
.
Request
Response
Result processing logic
After calling the API, a response is returned. Possible values for result.resultStatus are:
result.resultCode
Code | Value | Message | Further action |
---|---|---|---|
SUCCESS | S | Success | |
PARAM_ILLEGAL | F | Illegal parameters exist. For example, a non-numeric input, or an invalid date. | Check and verify whether the request fields, including the header fields and body fields, are correct and valid. For details on the fields of each API, see the specific API Structure section. |
PROCESS_FAIL | F | A general business failure occurred. Do not retry. | Human intervention is usually needed. It is recommended that you contact our Technical Support Team to resolve the issue. |
UNKNOWN_EXCEPTION | U | API failed due to unknown reason. | The service might be down, retry later. If the issue persists, contact the WorldFirst Technical Support Team. |
REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. | Call the interface again to resolve the issue. If the issue persists, contact our Technical Support Team. |
OAUTH_FAIL | F | OAuth process failed. | Contact our Technical Support Team for detailed reasons. |
INVALID_API | F | The called API is invalid or not active. | Check whether the correct API is being called. |
INVALID_CLIENT | F | The client is invalid. | The Client ID does not exist or is invalid. |
INVALID_SIGNATURE | F | The signature is invalid. | Make sure the request is properly signed with a valid signature. |
METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTP method. | Ensure the HTTP method is |
CONTRACT_CHECK_FAIL | F | The contract check failed. | Check the contract status with us before retrying. |
SYSTEM_ERROR | F | System error. | Do not retry, and contact our Technical Support Team for more details. |
USER_NOT_EXIST | F | The user does not exist. | Retry with the correct user information. |
AUTHORIZATION_NOT_EXIST | F | The authorization does not exist. | Retry the authorization process. If the issue persists, contact our Technical Support Team. |
CURRENCY_NOT_SUPPORTED | F | Currency not supported | Make sure the currency input is correct and try again. |