pay

1. Overview

Endpoint: https://open.alipay.hk/aps/api/intl/wallet/v1/payments/pay

Use this interface to send a payment transaction request.

2. Sample

  1. Issuing Participant sends the payment request to AlipayHK.
copy
{
  "productCode": "IN_STORE_PAYMENT",
  "paymentNotifyUrl": "http://xmock.inc.alipay.net/api/Ipay/globalSite/automtion/paymentNotify.htm",
  "paymentRequestId": "pay_1089760038715669_102775745075669",
  "paymentFactor": {
    "inStorePaymentScenario": "PaymentCode"
  },
  "order": {
    "referenceOrderId": "102775745075669",
    "orderDescription": "Mi Band 3 Wrist Strap Metal Screwless Stainless SteelXiaomi MiBand 3 ",
    "orderAmount": {
      "currency": "HKD",
      "value": "50000"
    },
    "merchant": {
      "referenceMerchantId": "seller231117459@login.com",
      "merchantName": "cup Hu",
      "merchantMCC": "1234",
      "store": {
        "referenceStoreId": "S0000000001",
        "storeName": "UGG-2",
        "storeMcc": "1405"
      }
    }
  },
  "paymetAmount": {
    "currency": "HKD",
    "value": "50000"
  },
  "paymentMethod": {
    "paymentMethodType": "CONNECT_WALLET",
    "paymentMethodId": "281006020000000000125733"
  }
}
  1. AlipayHK returns the payment result to Issuing Participant.
copy
{
  "result": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
  },
  "paymentRequestId": "pay_1089760038715669_10277574507XXXX",
  "paymentId": "2019060811401080010018882020035XXXX",
  "paymentAmount": {
    "value": "5000",
    "currency": "USD"
  },
  "actualPaymentAmount": {
    "value": "50000",
    "currency": "CNY"
  },
  "paymentTime": "2019-06-01T12:01:01+08:00",
  "paymentCreateTime": "2019-06-01T12:01:00+08:00",
  "pspCustomerInfo": {
    "pspName": "ALIPAY_CN",
    "pspCustomerId": "2088111111XXXX",
    "displayCustomerId": "test***@xxx.com"
  }
}

3. Structure

3.1 Request

No.

Field

Description

1

acquirerId

Optional String (64)

The unique ID that is assigned by AlipayHK to identify an Acquirer

2

pspId

Optional String (64)

The unique ID that is assigned by AlipayHK to identify a Issuing Participant

3

order

Required Order

Order details agreed by the buyer and the merchant, such as buyer information, merchant information, goods information, and payment amount. Order details are used for display, or risk and regulatory reporting. See Order for details.

4

paymentRequestId

Required String (64)

The unique ID that is assigned by the payment initiator to identify an order payment

5

paymentAmount

Required Amount

The amount that is collected by the payment executor. See Amount for details.

6

payToAmount

Required Amount

The amount that is paid by the payment executor. See Amount for details.

7

paymentMethod

Required PaymentMethod

The payment method that is used to collect the payment by the payment executor. See PaymentMethod for details.

8

paymentFactor

Required PaymentFactor

Factors that impact the payment related items such as the quote price, fee, and regulatory reporting. See PaymentFactor for details.

9

paymentQuote

Optional Quote

The exchange rate between paymentAmount and payToAmount. See Quote for details.

10

paymentExpiryTime

Optional Datetime

The payment expiration time

11

paymentNotifyUrl

Optional Url

The URL to receive the payment notification

12

paymentRedirectUrl

Optional Url

The URL that the user is redirected to after the payment is completed

13

paymentPromoInfo

Optional PaymentPromoInfo

Payment promotion information. See PaymentPromoInfo for details.

14

surchargeInfo

Optional SurchargeInfo

Surcharge information. See SurchargeInfo for details.

15

authorizationInfo

Optional AuthorizationInfo

Authorization information. See AuthorizationInfo for details.

16

otpVerification

Optional OtpVerification

An object that contains the OTP verification response. See OtpVerification for details.

17

passThroughInfo 

Optional String (2048)

Passthrough information in the set of key-value pairs that is transmitted between AlipayHK and participants 

2.2 Response

No.

Field

Description

1

result

Required Result

Request result, which contains information such as status and error codes. See Result for details.

2

acquirerId

Optional String (64)

The unique ID that is assigned by AlipayHK to identify an Acquirer

3

pspId

Optional String (64)

The unique ID that is assigned by AlipayHK to identify a Issuing Participant

4

paymentId

Optional String (64)

The unique ID that is assigned by the payment executor to identify a payment

5

paymentUrl

Optional Url

The URL for the user to pay

6

paymentTime

Optional Datetime

The date and time when the payment reaches a final state of success or failure

7

paymentAmount

Optional Amount

The amount that is collected by the payment executor. See Amount for details.

8

payToAmount

Optional Amount

The amount that is paid by the payment executor. See Amount for details.

9

customerId

Required String (64)

The unique ID that is assigned by the Issuing Participant to identify a customer

10

authExpiryTime

Optional Datetime

The date and time when the authorization payment expires

11

passThroughInfo

Optional String (2048)

Passthrough information in the set of key-value pairs that is transmitted between AlipayHK and participants

4. Result code

No.

resultCode

resultStatus

resultMessage

1

SUCCESS

S

Success

2

INVALID_CONTRACT

F

The contract is invalid.

3

INVALID_CODE

F

The code is invalid.

4

INVALID_TOKEN

F

The access token is invalid.

5

EXPIRED_CODE

F

The code is expired.

6

CURRENCY_NOT_SUPPORT

F

The currency is not supported.

7

USER_BALANCE_NOT_ENOUGH

F

The user balance is not enough for the payment.

8

USER_NOT_EXIST

F

The user does not exist.

9

USER_STATUS_ABNORMAL

F

The user status is abnormal.

10

USER_AMOUNT_EXCEED_LIMIT

F

The payment amount exceeds the user payment limit.

11

PAYMENT_AMOUNT_EXCEED_LIMIT

F

The payment amount exceeds the limit.

12

PAYMENT_COUNT_EXCEED_LIMIT

F

The number of payments exceeds the limit.

13

UNAVAILABLE_PAYMENT_METHOD

F

The payment method is unavailable.

14

REPEAT_REQ_INCONSISTENT

F

Repeated requests are inconsistent.

15

ORDER_IS_CLOSED

F

The order is closed.

16

PARAM_ILLEGAL

F

Illegal parameters exist. For example, a non-numeric input, or an invalid date.

17

BUSINESS_NOT_SUPPORT

F

The payment business is not supported.

18

RISK_REJECT

F

The request is rejected because of the risk control.

19

PROCESS_FAIL

F

A general business failure occurred. Don't retry.

20

KEY_NOT_FOUND

F

The key is not found.

21

ACCESS_DENIED

F

The access is denied.

22

REQUEST_TRAFFIC_EXCEED_LIMIT

U

The request traffic exceeds the limit.

23

INVALID_API

F

The called API is invalid or not active.

24

INVALID_CLIENT

F

The client is invalid.

25

INVALID_SIGNATURE

F

The signature is invalid.

26

METHOD_NOT_SUPPORTED

F

The server does not implement the requested HTTP method.

27

MEDIA_TYPE_NOT_ACCEPTABLE

F

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

28

PAYMENT_IN_PROCESS

U

The payment is being processed.

29

UNKNOWN_EXCEPTION

U

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