Alipay+ DocsAlipay+ Docs

placeOrder

Overview

The placeOrder API enables Alipay+ to send payment order requests to the Acquiring Service Provider (ACQP).

Sample

Request

copy
{
  "acquirerId": "1020000000000000001",
  "pspId": "1020000000000000001",
  "codeValue": "281004132828992222233",
  "paymentId": "2010000000000000000000000007771",
  "paymentAmount": {
    "value": "100",
    "currency": "CNY"
  },
  "settlementAmount": {
    "value": "100",
    "currency": "CNY"
  },
  "merchant": {
    "referenceMerchantId": "M00000000001",
    "merchantName": "UGG",
    "merchantMCC": "5411",
    "merchantAddress": {
      "region": "JP",
      "city": "xxx"
    },
    "store": {
      "referenceStoreId": "S00000000001",
      "storeName": "UGG-2",
      "storeMCC": "5411"
    }
  },
  "customerId": "210282121122",
  "env": {
    "userAgent": "Mozilla/5.0 (Linux; Android 9; MI 9 SE Build/PKQ1.181121.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/90.0.4430.66 Mobile Safari/537.36 Language/en Ariver/2.22.0.2 Griver/2.24.0 AppContainer/10.5.10 AlipayConnect AlipayConnect"
  }
}

Response

copy
{
  "result": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
  },
  "paymentRequestId":"2010000000000000000000000007771"
}

Structure

A message consists of a header and body. The following sections focus 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".
  1. 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

Field

Description

acquirerId

Required String (64)

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

pspId

Required String (64)

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

codeValue

Required String (512)

The code value that the user scans.

paymentId

Required String (64)

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

More information about this parameter:

  • This field is an API idempotency field. For requests that are initiated with the same paymentId, regard them as repeated and process them only once. Check the consistency of the following key request parameters: paymentRequestId, paymentAmount, and settlementAmount. If any values differ from the previous request, return the REPEAT_REQ_INCONSISTENT result code.

paymentRequestId

Optional String (64)

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

This parameter is specified by Alipay+ if the ACQP has returned the value of this parameter to Alipay+ after decoding the QR code.

customerId

Optional String (64)

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

This parameter is specified by Alipay+ if the relevant information is passed in by the MPP.

paymentAmount

Required Amount

The amount that the ACQP requests from Alipay+. Its currency must match the currency that the ACQP uses to create the payment order.

settlementAmount

Required Amount

The gross amount Alipay+ settles to the ACQP. When the settlement and payment currencies match, the amounts are identical. Otherwise, the settlement amount is calculated based on the paymentAmount and settlementQuote parameters.

settlementQuote

Optional Quote

The exchange rate between the settlement currency and the payment currency.

This parameter is specified by Alipay+ if the settlement currency differs from the payment currency.

merchant

Required Merchant

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

env

Required Env

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

passThroughInfo

Optional String (2000)

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

This parameter is specified by Alipay+ if the MPP wants to pass information to the ACQP.

Response

Field

Description

result

Required Result

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.

paymentRequestId

Optional String (64)

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

Return this parameter if the value of the result.resultCode parameter is SUCCESS, which means that the order is placed successfully.

passThroughInfo

Optional String (2000)

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

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

More information

How to return the result

  • If the order is placed successfully, set the value of result.resultStatus to S and the value of result.resultCode to SUCCESS.
  • If the order fails to be placed, set the value of result.resultStatus to F.
  • If the result is unknown, set the value of result.resultStatus to U and the value of result.resultCode to UNKNOWN_EXCEPTION.

Result code

Result code (resultCode)

Result status (resultStatus)

Result message (resultMessage)

SUCCESS

S

Success

ACCESS_DENIED

F

Access is denied.

BUSINESS_NOT_SUPPORT

F

The payment business is not supported.

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_MERCHANT_STATUS

F

The merchant status is abnormal due to restrictions, for example, the merchant's operation has been suspended.

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_KYB_NOT_QUALIFIED

F

The merchant's KYB failed or KYB level is not high enough.

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

The order is closed.

PARAM_ILLEGAL

F

Illegal parameters. For example, non-numeric input, invalid date.

PAYMENT_AMOUNT_EXCEED_LIMIT

F

The payment amount exceeds the limit that is specified by the ACQP.

PAYMENT_AMOUNT_INVALID

F

Payment amount is invalid.

PAYMENT_COUNT_EXCEED_LIMIT

F

The number of payments exceeds the limit.

PROCESS_FAIL

F

A general business failure occurred. Do not retry.

REPEAT_REQ_INCONSISTENT

F

Repeated requests are inconsistent.

RISK_REJECT

F

The request is rejected because of the risk control.

PAYMENT_IN_PROCESS

U

The payment is being processed.

REQUEST_TRAFFIC_EXCEED_LIMIT

U

The request traffic exceeds the limit.

UNKNOWN_EXCEPTION

U

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