Alipay+ DocsAlipay+ Docs

notifyPaymentAlipay+ ACQP

The notifyPayment API is used by Alipay+ to notify the payment result to the Acquiring Service Provider (ACQP) after payment processing reaches a final state of success or failure. 

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

Table3

1

sjg.,

  • aqweretrytuli
    • rtyukbnvc
    • 3w45uyk
      ewrrytuoyil
  • aesrtryu

2

sfggh

zmm,

Request parameters

paymentResult Result object REQUIRED

The result of the payment. The value of the paymentResult.resultStatus parameter represents the payment status, where S represents success and F represents failure. The value of the paymentResult.resultStatus parameter cannot be U when this API is called to send the payment result. See the Payment result codes table below for details.

Show child parameters

paymentRequestId String  REQUIRED

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

More information:

  • Maximum length: 64 characters

paymentId String  

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

This parameter is specified 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 specified. 

More information:

  • Maximum length: 64 characters

acquirerId String  REQUIRED

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

More information:

  • Maximum length: 64 characters

pspId String  

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

This parameter is specified by Alipay+ if the value of the paymentResult.resultStatus parameter is S, which means that the payment succeeds. 

More information:

  • Maximum length: 64 characters

customerId String  

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

This parameter is specified 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 specified by Alipay+ if the value of the paymentResult.resultStatus parameter is S, which means that the payment succeeds. 

More information:

  • Maximum length: 128 characters

paymentAmount Amount object REQUIRED

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 specified by Alipay+ if the value of the paymentResult.resultStatus parameter is S, which means that the payment succeeds. 

Show child parameters

paymentTime Datetime object 

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

This parameter is specified by Alipay+ if the value of the paymentResult.resultStatus parameter is S, which means that the payment succeeds. 

Show child parameters

settlementAmount Amount object 

The gross amount that Alipay+ settles to the ACQP. If the settlement currency (specified on the settlementAmount.currency parameter) is the same as the payment currency (specified on the paymentAmount.currency parameter), also known as transaction currency, the settlement amount is the same as the payment amount (specified on the paymentAmount.value parameter); otherwise, the settlement amount is calculated based on the paymentAmount and settlementQuote parameters.

This parameter is specified by Alipay+ if the value of the paymentResult.resultStatus parameter is S, which means that the payment succeeds. 

Show child parameters

settlementQuote Quote object 

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 specified by Alipay+ if the value of the paymentResult.resultStatus parameter is S and the settlement currency is different from the payment currency. 

Show child parameters

customsDeclarationAmount Amount object 

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 specified 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). 

Show child parameters

mppPaymentId String  

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

This parameter is specified by Alipay+ if the value of the paymentResult.resultStatus parameter is S, which means that the payment succeeds.

More information:

  • Maximum length: 64 characters

Response parameters

result Result object REQUIRED

The result of the business processing, including the result status, result code, and result message. For more information about how to respond to the notification of the notifyPayment API, see How to return the result

Show child parameters
API Explorer

Request

Request Body

Response

Response Body

More information

How to return the result

The ACQP needs to return the result (specified in the result parameter) according to the business processing result.

  • If you received the notification successfully, set the value of result.resultStatus to S and the value of result.resultCode to SUCCESS.
  • If you failed to receive the notification, set the value of result.resultStatus to F or U and specify the value of result.resultCode according to the failure reason. Alipay+takes the notification delivery as unsuccessful and retries sending the notification up to 7 times. The intervals between two consecutive times are as follows: 2min, 10min, 10min, 1h, 2h, 6h, and 15h. Note that Alipay+ does not retry to send the notification if you test Alipay+ APIs in the sandbox environment.  

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

CodeValueMessageFurther action
SUCCESSSSuccess

Update the status from the ACQP side. 

BUSINESS_NOT_SUPPORTFThe 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_SUPPORTFThe 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_CODEFThe code is expired.

Instruct the user to refresh the payment code. 

INVALID_CONTRACTFThe 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_TOKENFThe access token is invalid.

Instruct the user to authorize again. 

ORDER_IS_CLOSEDFThe order is closed.

Close the order at the ACQP side. 

PAYMENT_AMOUNT_EXCEED_LIMITFThe payment amount exceeds the limit that is specified by Alipay+.

It is recommended that you inform the user of the error. 

PAYMENT_COUNT_EXCEED_LIMITFThe number of payments exceeds the limit.

Wait until the MPP server allows more requests. 

PROCESS_FAILFA general business failure occurred. Do not retry.

It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue.

RISK_REJECTFThe request is rejected because of the risk control.

It is recommended that you inform the user of the error. 

UNAVAILABLE_PAYMENT_METHODFThe payment method is unavailable.

It is recommended that you inform the user of the error. 

USER_AMOUNT_EXCEED_LIMITFThe 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_ENOUGHFThe user balance is not enough for the payment.

It is recommended that you inform the user of the error. 

USER_NOT_EXISTFThe user does not exist.

It is recommended that you inform the user of the error. 

USER_STATUS_ABNORMALFThe user status is abnormal.

It is recommended that you inform the user of the error.