inquiryQuote

POST: /aps/api/business/quote/inquiryQuote

Signature required

For cross-currency transfers, the Partner can use this API to inquire the currency exchange rates.

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

Field

Data type

Required

Description

transferFactor

TransferFactor object

Yes

Indicates different scenarios for the transfer, such as: remitting to China in CNY, or remitting to countries/regions other than China.

More information:

  • This field is required when you need to support more than one remittance scenarios (transferFactor.transferFundType has more than one value)

sellCurrency

String

Yes

3 character ISO-4217 currency code of the currency that the Partner intends to convert from.

More information:

  • Maximum length: 3 characters

buyCurrency

String

Yes

3 character ISO-4217 currency code of the currency that the Partner intends to convert to.

More information:

  • Maximum length: 3 characters

sellAmount

Amount object

Yes(Conditional)

Amount of the currency sold in sellCurrency.

Note:

  • sellAmount and buyAmount cannot both be empty.

buyAmount

Amount object

Yes(Conditional)

Amount of the currency sold in buyCurrency.

Note:

  • sellAmount and buyAmount cannot both be empty.

Response parameters

Field

Data type

Required

Description

result

Result object

Yes

Indicates whether this API is called successfully.

transferFactor

TransferFactor object

Yes

Indicates different scenarios for the transfer, such as: remitting to China in CNY, or remitting to countries/regions other than China.

foreignExchangeQuote

Quote object

Yes

Information about the quote, such as the currency pair of the quote, quote ID, etc.

sellAmount

Amount object

No

Amount of the currency sold in sellCurrency.

Note:

  • sellAmount and buyAmount cannot both be empty.

buyAmount

Amount object

No

Amount of the currency sold in buyCurrency.

Note:

  • sellAmount and buyAmount cannot both be empty.

Result processing logic

After calling the API, a response is returned. The possible responses for result.resultStatus are:

Result status

Description

S

This indicates the API call succeeded.

F

This indicates the API call failed. For more information on why the call failed, see result.resultCode.

U

This indicates the API call result is unknown. The Partner can make another API call.

Use the following query strategy:

  • A Partner can make 7 queries at maximum.
  • Intervals between queries: 5m, 10m, 20m, 40m, 80m, 160m, and 320m.

If none of the queries is successful, contact WorldFirst(Alipay) Technical Support.

Result codes

result.resultCode

resultCode

resultStatus

resultMessage

Further action

SUCCESS

S

Success

PROCESS_FAIL

F

A general business failure occurred. Do not retry.

Human intervention is usually needed. It is recommended that you contact WorldFirst Technical Support to resolve the issue.

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.

REQUEST_TRAFFIC_EXCEED_LIMIT

U

The request traffic exceeds the limit.

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

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. For more details, refer to the following chapter:

METHOD_NOT_SUPPORTED

F

The server does not implement the requested HTTP method.

Ensure the HTTP method is POST.

UNKNOWN_EXCEPTION

U

The API call is failed, which is caused by unknown reasons.

The service might be down, retry later. If the issue persists, contact WorldFirst Technical Support.

UN_SUPPORT_BUSINESS

F

Unsupported business.

Invalid parameters are used e.g. currency is incorrect. Retry with the correct information.

Samples

Request

copy
{
  "buyCurrency": "CNY",
  "sellAmount": {
    "currency": "USD",
    "value": "2135"
  },
  "sellCurrency": "USD",
  "transferFactor": {
    "transferFundType": "GLOBAL_CNH_CN"
  }
}

Response

copy
{
  "buyAmount": {
    "currency": "CNY",
    "value": "13837"
  },
  "foreignExchangeQuote": {
    "baseCurrency": "USD",
    "quoteCurrencyPair": "USD/CNY",
    "quoteExpiryTime": "2022-01-01T00:00:00+08:00",
    "quoteId": "2022******",
    "quotePrice": "6.48118695",
    "quoteUnit": "1"
  },
  "result": {
    "resultCode": "SUCCESS",
    "resultMessage": "success.",
    "resultStatus": "S"
  },
  "sellAmount": {
    "currency": "USD",
    "value": "2135"
  },
  "transferFactor": {
    "transferFundType": "GLOBAL_CNH_CN"
  }
}

@2024 WorldFirst