Alipay+ DocsAlipay+ Docs

inquiryForeignExchangeQuoteMPP Alipay+

POST /aps/v1/payments/inquiryForeignExchangeQuote

The inquiryForeignExchangeQuote API allows Mobile Payment Partners (MPPs) to query the foreign exchange rate between a pair of currencies. The exchange rate returned by Alipay+ is for reference only.

Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:

Note: 

1. Set the data type of each parameter (except array) as String. This means that you must use double quotation marks (" ") to enclose the parameter value. For example:

  • If the data type of a parameter is Integer and its value is 20, set it as "20".
  • If the data type of a parameter is Boolean and its value is true, set it as "true". 

2. For optional parameters that are not required in your case, you can take one of the following actions:

  • Exclude the parameters from the request body.
  • Set the parameter values as null (without the double quotation marks). 

Do NOT leave the optional parameters empty by setting their values as ""; otherwise, an error might occur. 

Request parameters

sellCurrency string  REQUIRED

The currency that Alipay+ sells on behalf of the user.

The value of this parameter must be an alphabetic code that follows the ISO 4217 standard, for example, "EUR" for Euros.

More information:

  • Maximum length: 3 characters

buyCurrency string  REQUIRED

The currency that Alipay+ buys on behalf of the user.

The value of this parameter must be an alphabetic code that follows the ISO 4217 standard, for example, "EUR" for Euros.

More information:

  • Maximum length: 3 characters

paymentFactor PaymentFactor  

Factors that impact the payment, such as the quote price, fees, and regulatory reporting.

Show child parameters

Response parameters

result Result  REQUIRED

The result of the processing, including the result status, result code, and the result message.

Show child parameters

foreignExchangeQuote Quote  

The exchange rate between sellCurrency and buyCurrency.

Note:

This parameter is returned by Alipay+ if the value of the result.resultCode parameter is SUCCESS.

Show child parameters
API Explorer

Request

Request Body

Response

Response Body

More information

How to handle the result

You might receive different results from Alipay+. Follow the instructions below to handle the result.

result.resultStatus

result.resultCode

Request status

Actions

S

SUCCESS

Successful

Continue processing.

F

Multiple possible values exist, such as

PARAM_ILLEGAL and

PROCESS_FAIL.

Failed

Take action based on the result code (specified in result.resultCode ). For more information, see the result codes in below section.

U

Multiple possible values exist, such as

REQUEST_TRAFFIC_EXCEED_LIMIT and

UNKNOWN_EXCEPTION.

Unknown

Retry the request.

No result received

Unknown

Retry the request.

 

Result/Error codes

CodeValueMessage
SUCCESSSSuccess
ACCESS_DENIEDFAccess is denied.
INVALID_APIFAPI is invalid or not active.
INVALID_CLIENTFThe client is invalid.
INVALID_SIGNATUREFThe signature is invalid.
KEY_NOT_FOUNDFThe key is not found.
METHOD_NOT_SUPPORTEDFThe server does not implement the requested HTTP method.
MEDIA_TYPE_NOT_ACCEPTABLEFThe server does not implement the media type that would be acceptable to the client.
PARAM_ILLEGALFIllegal parameters exist. For example, a non-numeric input or an invalid date.
PROCESS_FAILFGeneral business failure. Do not retry.
QUOTE_NOT_FOUNDFThere is no valid quote.
REQUEST_TRAFFIC_EXCEED_LIMITUThe request traffic exceeds the limit.
UNKNOWN_EXCEPTIONUThe API call failed because of unknown reasons.