Retrieve historical FX ratesSignature required

POST /amsin/api/v1/business/fund/queryRateHistory

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.

Show child parameters

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.

Show child parameters

historicalRates Array<RateDetails>  

The historical FX rates per hour.

This field is returned only when the value of result.resultStatus is S.

Show child parameters
API Explorer

Request

URL
Request Body

Response

Response Body

Result processing logic

After calling the API, a response is returned. Possible values for result.resultStatus are:

Result status

Description

S

Indicates that the API call succeeded.

F

Indicates that the API call failed. For additional information on the failure, refer to result.resultCode.

U

Indicates that the API call result is unknown. If this status is returned, the Partner may make a query. The querying strategy is as follows:

  • Maximum 7 queries are allowed. 
  • Intervals between queries: 5 min, 10 min, 20 min, 40 min, 80 min, 160 min, and 320 min.

If no query succeed, contact our Technical Support Team.

result.resultCode

CodeValueMessageFurther action
SUCCESSSSuccess
PARAM_ILLEGALFIllegal 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_FAILFA 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_EXCEPTIONUAPI 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_LIMITUThe request traffic exceeds the limit.

Call the interface again to resolve the issue. If the issue persists, contact our Technical Support Team.

OAUTH_FAILFOAuth process failed.

Contact our Technical Support Team for detailed reasons.

INVALID_APIFThe called API is invalid or not active.

Check whether the correct API is being called.

INVALID_CLIENTFThe client is invalid.

The Client ID does not exist or is invalid.

INVALID_SIGNATUREFThe signature is invalid.

Make sure the request is properly signed with a valid signature.

METHOD_NOT_SUPPORTEDFThe server does not implement the requested HTTP method.

Ensure the HTTP method is ​POST​.

CONTRACT_CHECK_FAILFThe contract check failed.

Check the contract status with us before retrying.

SYSTEM_ERRORFSystem error.

Do not retry, and contact our Technical Support Team for more details.

USER_NOT_EXISTFThe user does not exist.

Retry with the correct user information.

AUTHORIZATION_NOT_EXISTFThe authorization does not exist.

Retry the authorization process. If the issue persists, contact our Technical Support Team.

CURRENCY_NOT_SUPPORTEDFCurrency not supported

Make sure the currency input is correct and try again.

@2024 WorldFirst