userInitiatedPay (Merchant-presented Mode Payment - Private Order Code)Alipay+ → ACQP
The userInitiatedPay API is used when the user initiates a payment request by scanning an order code that is issued by the Acquiring Service Provider (ACQP). Alipay+ calls this API to send the decoding request to the ACQP and then processes the payment according to the response returned by the ACQP.
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:
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
acquirerId String
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.
More information:
- Maximum length: 64 characters
codeValue String REQUIRED
The code value that the user scans.
More information:
- Maximum length: 512 characters
customerId String
The unique ID that is assigned by Alipay+ to identify an MPP user.
Note: Specified by Alipay+ if the relevant information is passed in by the MPP.
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 of the userInitiatedPay API, see How to return the result.
codeType String
The type of code that the user scans.
Note: In the Merchant-presented Mode Payment Order Code scenario, the value of this parameter must be set to ORDER_CODE
if the value of the result.resultCode parameter is SUCCESS
, which means that the decoding succeeds.
paymentRequestId String
The unique ID that is assigned by the ACQP to identify a payment order.
Note: Required if the value of the result.resultCode parameter is SUCCESS
, which means that the decoding succeeds.
More information:
- Maximum length: 64 characters
order Order
The order details that are agreed upon by the buyer and the merchant, including the information about the buyer, the merchant, the goods, the initial order amount, and so on. The order details are displayed in purchase records and used for risk and regulatory reporting.
Note:
In the Merchant-presented Mode Payment Order Code scenario, if the value of the result.resultCode parameter is SUCCESS
, apart from the required child parameters, the following child parameter must be returned:
- merchant.store
The following child parameters are recommended to be returned:
- env.storeTerminalId
- env.storeTerminalRequestTime
paymentFactor PaymentFactor
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 Merchant-presented Mode Payment Order Code scenario, if the value of the result.resultCode parameter is SUCCESS
, the following parameters must be returned and set to the specific values as shown below:
- isInStorePayment: set the value to
true
- isCashierPayment: set the value to
true
- inStorePaymentScenario: set the value to
OrderCode
paymentAmount Amount
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: Required if the value of the result.resultCode parameter is SUCCESS
, which means that the decoding succeeds.
paymentNotifyUrl URL REQUIRED
The URL that is used to receive the payment result notification from Alipay+.
More information:
- Maximum length: 2048 characters
paymentRedirectUrl URL
The URL where the user is redirected to after the payment order is completed.
Note: Required if the value of the result.resultCode parameter is SUCCESS
and the user needs to be redirected from the MPP's payment result page to a predetermined page, for example, the merchant result page.
More information:
- Maximum length: 2048 characters
paymentExpiryTime Datetime
The time after which the payment order is expired. If the payment transaction is not completed before the time that is specified for this parameter, Alipay+ closes the order and calls the notifyPayment API to notify the ACQP of the payment result.
Note:
- Required if the value of the result.resultCode parameter is
SUCCESS
and the ACQP wants the payment transaction to be completed before a specific time. - In the Merchant-presented Mode Payment Order Code scenario, the default value of this parameter is 3 minutes.
- The specified expiration time must be shorter than the default expiration time; otherwise, the default expiration time takes effect instead of the specified expiration time.
More information:
- The value follows the ISO 8601 standard format. For example, "2019-11-27T12:01:01+08:00".
settlementStrategy SettlementStrategy
The settlement strategy that is applied to the payment order, for example, the currency that the ACQP wants to be settled against.
Note: Required if the value of the result.resultCode parameter is SUCCESS
and the settlement currency is different from the payment currency that is specified for the paymentAmount.currency parameter.
splitSettlementId String
The unique ID that is assigned by Alipay+ to the ACQP for multi-batch reconciliation. For each unique value of this parameter, Alipay+ performs a batch of clearing and settlement, and transfers a batch of funds to the ACQP's bank account.
Note: Required if the ACQP needs to split its settlement for transactions in one region and one currency into multiple batches.
More information:
- Maximum length: 16 characters
Request
Response
More information
How to return the result
- If the decoding succeeds, set the value of result.resultStatus to
S
and value of result.resultCode toSUCCESS
. - If the decoding fails, set the value of result.resultStatus to
F
. - If the decoding result is unknown, set the value of result.resultStatus to
U
and the value of result.resultCode toUNKNOWN_EXCEPTION
.
Result/Error codes
Code | Value | Message |
---|---|---|
SUCCESS | S | Success |
ACCESS_DENIED | F | Access is denied. |
CURRENCY_NOT_SUPPORT | F | The currency is not supported. |
EXPIRED_CODE | F | The code is expired. |
INVALID_CLIENT | F | The client is invalid. |
INVALID_CODE | F | The code is invalid. |
INVALID_CONTRACT | F | The contract is invalid. |
INVALID_SIGNATURE | F | The signature is invalid. |
KEY_NOT_FOUND | F | The key is not found. |
MEDIA_TYPE_NOT_ACCEPTABLE | F | The server does not implement the media type that is acceptable to the client. |
MERCHANT_NOT_REGISTERED | F | The merchant is not registered. |
METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTPS method. |
NO_INTERFACE_DEF | F | API is not defined. |
ORDER_IS_CLOSED | F | order has been cancelled |
PARAM_ILLEGAL | F | Illegal parameters. For example, non-numeric input, invalid date. |
PAYMENT_AMOUNT_INVALID | F | Payment amount is invalid. |
PROCESS_FAIL | F | A general business failure occurred. Do not retry. |
REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. |
UNKNOWN_EXCEPTION | U | An API call failed, which is caused by unknown reasons. |