inquiryForeignExchangeQuoteMPP → Alipay+
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.
Response parameters
result Result REQUIRED
The result of the processing, including the result status, result code, and the result message.
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
.
Request
Response
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 Successful Continue processing. Multiple possible values exist, such as Failed Take action based on the result code (specified in result.resultCode ). For more information, see the result codes in below section. Multiple possible values exist, such as Unknown Retry the request.S
SUCCESS
F
PARAM_ILLEGAL
and PROCESS_FAIL
.U
REQUEST_TRAFFIC_EXCEED_LIMIT
and UNKNOWN_EXCEPTION
.
No result received
Unknown
Retry the request.
Result/Error codes
Code | Value | Message |
---|---|---|
SUCCESS | S | Success |
ACCESS_DENIED | F | Access is denied. |
INVALID_API | F | API is invalid or not active. |
INVALID_CLIENT | F | The client is invalid. |
INVALID_SIGNATURE | F | The signature is invalid. |
KEY_NOT_FOUND | F | The key is not found. |
METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTP method. |
MEDIA_TYPE_NOT_ACCEPTABLE | F | The server does not implement the media type that would be acceptable to the client. |
PARAM_ILLEGAL | F | Illegal parameters exist. For example, a non-numeric input or an invalid date. |
PROCESS_FAIL | F | General business failure. Do not retry. |
QUOTE_NOT_FOUND | F | There is no valid quote. |
REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. |
UNKNOWN_EXCEPTION | U | The API call failed because of unknown reasons. |