Alipay+ DocsAlipay+ Docs

inquiryPaymentAlipay+ → MPP

The inquiryPayment API is used by Alipay+ to query the payment result. 

Note: In the following sections, the Mobile Payment Provider (MPP) is also known as PSP. For example, pspId refers to 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.  

Request parameters

acquirerId String  REQUIRED

The unique ID that is assigned by Alipay+ to identify an Acquiring Service Provider (ACQP). 

More information:

  • Maximum length: 64 characters

pspId String  REQUIRED

The unique ID that is assigned by Alipay+ to identify an MPP. 

More information:

  • Maximum length: 64 characters

paymentRequestId String  REQUIRED

The unique ID that is assigned by Alipay+ to identify a payment order. 

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 return the result, see How to return the result

Show child parameters

paymentResult Result  

The result of the payment. The value of the paymentResult.resultStatus parameter represents the payment status, where S represents success and F represents failure. See the Payment result codes table for more details. 

Return this parameter if the value of the result.resultStatus parameter is S, which means that the inquiry is successful. 

Show child parameters

paymentId String  

The unique ID that is assigned by the MPP to identify a payment order.

Return this parameter if the value of the paymentResult.resultStatus parameter is S, which means that the payment succeeds. 

More information:

  • Maximum length: 64 characters

paymentAmount Amount  

The amount that Alipay+ requests to receive from the MPP. The currency of the amount must be specified to the one that Alipay+ uses to create the payment order. If a promotion exists, this amount does not include the promotion amount.

Return this parameter if the value of the paymentResult.resultStatus parameter is S, which means that the payment succeeds. 

Show child parameters

payToAmount Amount  

The amount that the MPP settles to Alipay+. The currency of the amount is the MPP's currency.

Return this parameter if the value of the paymentResult.resultStatus parameter is S and payToAmount.currency is different from paymentAmount.currency. When this parameter is returned, payToAmount.value is calculated based on paymentAmount.value and paymentQuote.quotePrice by using the rounding mode of HALF EVEN. 

Show child parameters

paymentTime Datetime  

The date and time when the payment order reaches a final state.

Return this parameter if the value of the paymentResult.resultStatus parameter is S, which means that the payment succeeds. 

Show child parameters

customerId String  

The unique ID that is assigned by the MPP to identify a user.

Return this parameter if the value of the paymentResult.resultStatus parameter is S, which means that the payment succeeds. 

More information:

  • Maximum length: 64 characters

customsDeclarationAmount Amount  

The 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.

Return this parameter 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). 

Show child parameters

passThroughInfo String  

The information that is passed through by the MPP to Alipay+. The value of this parameter is in a set of key-value pairs. 

Return this parameter if the MPP wants to pass information to the ACQP. 

More information:

  • Maximum length: 20000 characters
API Explorer

Request

Request Body

Response

Response Body

More information

How to return the result

The MPP needs to return the result (specified on the result and paymentResult parameters) according to the business processing result.

  • If the payment is successful, set the value of result.resultStatus to S and the value of paymentResult.resultStatus to S.
  • If the payment failed, set the value of result.resultStatus to S and the value of paymentResult.resultStatus to F.
  • If the payment is in processing, set the value of result.resultStatus to S and the value of paymentResult.resultStatus to U.
  • If the payment order does not exist, set the value of result.resultStatus to F and the value of result.resultCode to ORDER_NOT_EXIST.
  • If system or network issues exist, set the vaue of result.resultStatus to U, and Alipay+ will retry the inquiry.

For more information about how to define your result codes, see the Result codes section below. 

Result/Error codes

CodeValueMessage
SUCCESSSSuccess
ACCESS_DENIEDFAccess is denied.
INVALID_CLIENTFThe client is invalid.
INVALID_SIGNATUREFThe signature is invalid.
KEY_NOT_FOUNDFThe key is not found.
MEDIA_TYPE_NOT_ACCEPTABLEFThe server does not implement the media type that is acceptable to the client.
METHOD_NOT_SUPPORTEDFThe server does not implement the requested HTTPS method.
NO_INTERFACE_DEFFAPI is not defined.
ORDER_NOT_EXISTFThe order doesn't exist.
PARAM_ILLEGALFIllegal parameters. For example, non-numeric input, invalid date.
PROCESS_FAILFA general business failure occurred. Do not retry.
REQUEST_TRAFFIC_EXCEED_LIMITUThe request traffic exceeds the limit.
UNKNOWN_EXCEPTIONUAn API call failed, which is caused by unknown reasons.

Payment result codes

CodeValueMessage
SUCCESSSSuccess
BUSINESS_NOT_SUPPORTFThe payment business is not supported.
CURRENCY_NOT_SUPPORTFThe currency is not supported.
EXPIRED_CODEFThe code is expired.
INVALID_CODEFThe code is invalid.
INVALID_CONTRACTFThe contract is invalid.
INVALID_TOKENFThe access token is invalid.
MERCHANT_NOT_REGISTEREDFThe merchant is not registered.
ORDER_IS_CLOSEDFThe order is closed.
PAYMENT_AMOUNT_EXCEED_LIMITFThe payment amount exceeds the limit that is specified by Alipay+.
PAYMENT_COUNT_EXCEED_LIMITFThe number of payments exceeds the limit.
PROCESS_FAILFA general business failure occurred. Don't retry.
REGULATION_RESTRICTIONFThe payment failed due to regulatory restriction.
RISK_REJECTFThe request is rejected because of the risk control.
UNAVAILABLE_PAYMENT_METHODFThe payment method is unavailable.
USER_AMOUNT_EXCEED_LIMITFThe payment amount exceeds the payment limit that is specified by the user's digital wallet.
USER_BALANCE_NOT_ENOUGHFThe user balance is not enough for the payment.
USER_KYC_NOT_QUALIFIEDFThe user is not KYC compliant.
USER_NOT_EXISTFThe user does not exist.
USER_PAYMENT_VERIFICATION_FAILEDFUser fails to pass the payment verification in the methods like OPT, PIN, and so on.
USER_STATUS_ABNORMALFThe user status is abnormal.
PAYMENT_IN_PROCESSUThe payment is being processed.