Alipay+ DocsAlipay+ Docs

consultPayment (Cashier Payment)

POST /aps/api/v1/payments/consultPayment

The consultPayment API is used by the Acquiring Partner (ACQP) to retrieve available payment methods from Alipay+

When a consumer places an order and gets redirected to the cashier page, the merchant must display the available payment methods to the consumer. The ACQP sends a request to Alipay+ on behalf of the merchant to consult the available payment methods. After receiving the response, the ACQP returns the payment method list to the merchant, who then displays the available payment methods on the cashier page.

Structure

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

Note:

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

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

Request parameters

paymentAmount Amount object REQUIRED

The amount that the ACQP requests to receive from Alipay+. The currency of the amount must be specified to the one that the ACQP uses to create the payment order.

Note: If the payment amount cannot be provided, set the value of the paymentAmount.value parameter to 0 and specify a value for the paymentAmount.currency parameter.

Show child parameters

paymentFactor PaymentFactor object REQUIRED

Factors that impact payment-related items such as service fee, interchange fee (also known as interpartner fee), and regulatory reporting. This parameter is used to identify the payment scenario.

Note: In the Cashier Payment scenario, the following child parameters must be set to the specific values as shown below:

  • isInStorePayment: set the value to false
  • isCashierPayment: set the value to true
  • presentmentMode: set the value to UNIFIED.
Show child parameters

settlementStrategy SettlementStrategy object REQUIRED

The settlement strategy that is applied to the payment order, for example, the currency that the ACQP wants to be settled against.

Show child parameters

merchant Merchant object REQUIRED

The merchant information, including the merchant ID, merchant name, merchant category code, and so on.

Show child parameters

env Env object REQUIRED

The environment information about the device that is used by the user to place orders.

Note: The following child parameters must be specified as follows:

  • terminalType
  • osType if the value of env.terminalType is APP or WAP
Show child parameters

Response parameters

result Result object REQUIRED

The result of the business processing, including the result status, result code, and the result message. For more information about how to handle the result of the consultPayment API, see Result processing logic.

Show child parameters

paymentOptions Array<PaymentOption> object 

The list of payment options.

Note: Returned by Alipay+ if the value of the result.resultStatus parameter is S, which means that the consultation succeeds. In this case, apart from the required child parameters, the following optional child parameter is also returned: 

  • brandName

More information:

  • Maximum size: 1 element
Show child parameters
API Explorer
Sample CodesRun in Sandbox

Request

URL
Request Body

Response

Response Body

More information 

Request conditionality

The following parameters must be specified to the same values as those of the parameters specified in the pay API request: the paymentAmount.currency, settlementStrategy, and env parameters.

Result processing logic

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

result.resultStatus

result.resultCode

Payment status

Actions

S

SUCCESS

The consultation initiation succeeds. The

paymentOptions parameter that contains the Alipay+ payment method information is returned in the response.

Render the merchant's cashier page.

F

...

Consultation fails.

Take actions according to the result code (specified on the result.resultCode parameter). For more information, see the Result code section.

U

...

Consultation is in processing.

Retry the same request. Ensure that the parameters are the same as the previous ones.

No result received

Unknown.

Retry the same request. Ensure that the parameters are the same as the previous ones.

Sample

Request

The Acquiring Partner sends a request to Alipay+.

Sample Code

Response

Response of a successful inquiry if no aggregated logos are preconfigured. In this case, the default Alipay+ logo is returned. 

Sample Code

Response of a successful inquiry if aggregated logos are preconfigured. In this case, a list of aggregated logos is returned. 

Sample Code

Response of a failed query, where the value of result.resultStatus is U, and resultCode and resultMessage indicate the detailed reason for the failure: 

Sample Code

Result/Error codes

CodeValueMessageFurther action
SUCCESSSSUCCESS.

Render the merchant's cashier page.

ACCESS_DENIEDFAccess is denied.

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

INVALID_CLIENTFThe client is invalid.

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

INVALID_SIGNATUREFThe signature is invalid.

Check whether the public key, signed message, and signature algorithm are as expected.

KEY_NOT_FOUNDFThe key is not found.

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

MEDIA_TYPE_NOT_ACCEPTABLEFThe server does not implement the media type that is acceptable to the client.

Use a media type that is accepted by Alipay+.

METHOD_NOT_SUPPORTEDFThe server does not implement the requested HTTPS method.

Ensure the HTTP method is POST.

NO_INTERFACE_DEFFAPI is not defined.

Check whether the request URL is correct. Ensure that the endpoint of the called API is correct.

NO_PAY_OPTIONSFNo payment option exists.

N/A

PARAM_ILLEGALFIllegal 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 the Structure section of the specific API reference topic.

PROCESS_FAILFA 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_LIMITUThe request traffic exceeds the limit.

Reduce the frequency of API calls.

UNKNOWN_EXCEPTIONUAn API call failed, which is caused by unknown reasons.

Try to recall the API.