inquiryPaymentACQP → Alipay+
TestTest
The inquiryPayment API is used by the Acquiring Service Provider (ACQP) to query the payment result if no payment result is received after a certain period of time.
Note: In the following sections, Mobile Payment Provider (MPP) is also known as Payment Service Provider. For example, the pspId parameter specifies the ID that identifies an MPP.
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. Examples:
- 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.
Table1
Table2
1
sjg.,
- aqweretrytuli
- rtyukbnvc
- 3w45uyk
ewrrytuoyil
- aesrtryu
2
sfggh
zmm,
Request parameters
paymentRequestId String
The unique ID that is assigned by the ACQP to identify a payment order.
Specify this parameter if the paymentId parameter is not specified.
More information:
- Maximum length: 64 characters
paymentId String
The unique ID that is assigned by Alipay+ to identify a payment order.
Specify this parameter if the paymentRequestId parameter is not specified.
More information:
- Maximum length: 64 characters
Response parameters
result Result REQUIRED
The result of the business processing, including the result status, result code, and result message. For more information about how to handle the result of the inquiryPayment API, see How to handle the result.
paymentResult Result
The result of the payment. See the Payment result codes table below for details.
This parameter is returned by Alipay+ if the value of the result.resultStatus parameter is S
, which means that the inquiry is successful.
acquirerId String
The unique ID that is assigned by Alipay+ to identify an ACQP.
This parameter is returned by Alipay+ if the value of the result.resultStatus parameter is S
, which means that the inquiry is successful.
More information:
- Maximum length: 64 characters
pspId String
The unique ID that is assigned by Alipay+ to identify an MPP.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
, which means that the payment succeeds.
More information:
- Maximum length: 64 characters
paymentRequestId String
The unique ID that is assigned by the ACQP to identify a payment order.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
, which means that the payment succeeds.
More information:
- Maximum length: 64 characters
paymentId String
The unique ID that is assigned by Alipay+ to identify a payment order.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
, which means that the payment succeeds; otherwise, this parameter may or may not be returned.
More information:
- Maximum length: 64 characters
paymentAmount Amount
The amount that the ACQP requests to receive from Alipay+. The currency of the amount is the same as the one that the ACQP uses to create the payment order.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
, which means that the payment succeeds.
paymentTime Datetime
The date and time when the payment order reaches a final state.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
, which means that the payment succeeds.
customerId String
The unique ID that is assigned by Alipay+ to identify an MPP user.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
and the MPP provides a unique ID that identifies the user.
More information:
- Maximum length: 64 characters
walletBrandName String
The brand name of the MPP that is displayed to the customer.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
, which means that the payment succeeds.
More information:
- Maximum length: 128 characters
transactions Array<Transaction>
The list of refund transactions that are related to the queried payment order.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
.
More information:
- Maximum size: Unlimited
settlementAmount Amount
The gross amount that Alipay+ settles to the ACQP. When the settlement currency (specified on the settlementAmount.currency parameter) is different from payment currency (specified on the paymentAmount.currency parameter), also known as transaction currency, the settlement amount that is specified on the settlementAmount.value parameter is calculated based on the paymentAmount and settlementQuote parameters.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
, which means that the payment succeeds.
settlementQuote Quote
The exchange rate between the settlement currency (specified on the settlementAmount.currency parameter) and the payment currency, (specified on the paymentAmount.currency parameter).
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
and the settlement currency is different from the payment currency.
customsDeclarationAmount Amount
The maximum amount that is to be declared by the ACQP to customs. The currency of the amount is the currency used by the MPP's user. For example, if the user uses ALIPAY_CN to pay, the currency is CNY.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
and customs declaration is required by the MPP's local authority (for now this only includes the Chinese Mainland).
mppPaymentId String
The unique ID that is assigned by the MPP to identify a payment order.
This parameter is returned by Alipay+ if the value of the paymentResult.resultStatus parameter is S
, which means that the payment succeeds.
More information:
- Maximum length: 64 characters
Request
Response
More information
How to handle the result
Alipay+ returns the following two kinds of results:
- result: specifies whether the inquiryPayment API request is received successfully.
- paymentResult: specifies the payment result.
You might receive different results from Alipay+. Follow the instructions below to handle the result.
result.resultStatus paymentResult.resultStatus Payment status Actions Payment succeeds. Update the status from your server side. If paymentResult.resultCode is Take actions according to the result code (specified on the result.resultCode parameter). For more information, see the Result codes section below. Payment is in processing. Keep inquiring within the payment expiry time. For more information about inquiry rules for different products, see the Payment result inquiry rules section below. If you still receive the same payment result of The payment fails or the payment order does not exist. If you still receive the same payment result of Unknown exception Keep inquiring within the payment expiry time. For more information about inquiry rules for different products, see the Payment result inquiry rules section below. If you still receive the same payment result of No result received Unknown Keep inquiring within the payment expiry time. For more information about inquiry rules for different products, see the Payment result inquiry rules section below. If you still receive no payment result after the payment expires or after your inquiry times exceed the maximum limit, call the cancelPayment API to cancel the payment.S
S
S
F
ORDER_IS_CLOSED
, the payment order is closed or canceled; otherwise, the payment fails.S
U
U
after the payment expires or after your inquiry times exceed the maximum limit, call the cancelPayment API to cancel the payment.F
F
U
after the payment expires or after your inquiry times exceed the maximum limit, call the cancelPayment API to cancel the payment.U
U
U
after the payment expires or after your inquiry times exceed the maximum limit, call the cancelPayment API to cancel the payment.
Payment result inquiry rules
The following table lists the payment result inquiry rules for different products.
Product | Inquiry frequency | Default payment expiry time |
Cashier Payment | An incremental frequency within the payment expiry time | 10 minutes |
Auto Debit | 10 to 20 times within the payment expiry time | 60 seconds |
User-presented Mode Payment | 10 to 20 times within the payment expiry time | 60 seconds |
Merchant-presented Mode Payment | 30 to 60 times within the payment expiry time | 180 seconds |
Table1
Table2
1
sjg.,
- aqweretrytuli
- rtyukbnvc
- 3w45uyk
ewrrytuoyil
- aesrtryu
2
sfggh
zmm,
Result/Error codes
Code | Value | Message | Further action |
---|---|---|---|
TestCode2 | 2 | EEEE | |
TestCode1 | 1 | EEE | SeeXX |
SUCCESS | S | Success | Check the paymentResult parameter for more information. |
ACCESS_DENIED | F | Access is denied. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
INVALID_CLIENT | F | The client is invalid. |
It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
INVALID_SIGNATURE | F | The signature is invalid. |
Check whether the public key, signed message, and signature algorithm are as expected. |
KEY_NOT_FOUND | F | The key is not found. |
It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
MEDIA_TYPE_NOT_ACCEPTABLE | F | The server does not implement the media type that is acceptable to the client. |
Use a media type that is accepted by Alipay+. |
METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTPS method. | Ensure the HTTP method is POST. |
NO_INTERFACE_DEF | F | API is not defined. | Check whether the request URL is correct. Ensure that the endpoint of the called API is correct. |
ORDER_NOT_EXIST | F | The order doesn't exist. |
Close the order at the ACQP side and call the cancelPayment API. |
PARAM_ILLEGAL | F | Illegal parameters. For example, non-numeric input, invalid date. |
Check whether the request parameters, including the header parameters and body parameters, are correct and valid. For more information about the parameters of each API, see Structure of the specific API reference topic. |
PROCESS_FAIL | F | A general business failure occurred. Do not retry. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. |
Reduce the frequency of API calls. |
UNKNOWN_EXCEPTION | U | An API call failed, which is caused by unknown reasons. | Try to recall the API. |
Result11
Code | Value | Message | Further action |
---|---|---|---|
TestCode3 | 3 | EEEEE | qe |
Payment result codesXXX
Code | Value | Message | Further action |
---|---|---|---|
SUCCESS | S | Success | Update the status from the ACQP side. |
BUSINESS_NOT_SUPPORT | F | The payment business is not supported. |
Check whether the parameter values in the request message, such as merchant ID and payment currency, conform to the contract. If yes, it is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue; otherwise, correct the parameters to align with the contract. |
CURRENCY_NOT_SUPPORT | F | The currency is not supported. | Ensure the currencies used in the request, such as payment currency and settlement currency, conform to the contract. If the issue persists, it is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
EXPIRED_CODE | F | The code is expired. | Instruct the user to refresh the payment code. |
INVALID_CONTRACT | F | The contract is invalid. |
Check whether the parameter values in the request message, such as merchant ID and payment currency, conform to the contract. If yes, it is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue; otherwise, correct the parameters to align with the contract. |
INVALID_TOKEN | F | The access token is invalid. |
Instruct the user to authorize again. |
ORDER_IS_CLOSED | F | The order is closed. |
Close the order at the ACQP side. |
PAYMENT_AMOUNT_EXCEED_LIMIT | F | The payment amount exceeds the limit that is specified by Alipay+. | It is recommended that you inform the user of the error. |
PAYMENT_COUNT_EXCEED_LIMIT | F | The number of payments exceeds the limit. |
Wait until the MPP server allows more requests. |
RISK_REJECT | F | The request is rejected because of the risk control. |
It is recommended that you inform the user of the error. |
PROCESS_FAIL | F | A general business failure occurred. Do not retry. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
UNAVAILABLE_PAYMENT_METHOD | F | The payment method is unavailable. |
It is recommended that you inform the user of the error. |
USER_AMOUNT_EXCEED_LIMIT | F | The payment amount exceeds the payment limit that is specified by the user's digital wallet. |
It is recommended that you inform the user of the error. |
USER_BALANCE_NOT_ENOUGH | F | The user balance is not enough for the payment. |
It is recommended that you inform the user of the error. |
USER_NOT_EXIST | F | The user does not exist. |
It is recommended that you inform the user of the error. |
USER_STATUS_ABNORMAL | F | The user status is abnormal. |
It is recommended that you inform the user of the error. |
PAYMENT_IN_PROCESS | U | The payment is being processed. |
Call the inquiryPayment API to inquire about the payment result. |