AlipayHK does not support the native Alipay checkout page.
For AlipayHK, merchants typically request a QR code / payment URL and embed it in the merchant page (e.g. as a QR code image or via an
For AlipayHK, merchants typically request a QR code / payment URL and embed it in the merchant page (e.g. as a QR code image or via an
iframe).Overview
Alipay Web Payments allow customers to complete a purchase by scanning a QR code (or opening a hosted payment URL). After payment confirmation, funds are deducted from the customer’s wallet and the result is returned to the merchant system.- Mainland China users pay in CNY; QFPay settles to merchants in the configured settlement currency.
- Hong Kong users pay in HKD.
return_url is provided, the customer is redirected back to the merchant website after payment.
HTTP Request
EndpointPOST /trade/v1/payment
Supported Pay Types
| PayType | Description |
|---|---|
| 801101 | Alipay Web Payment (Overseas) |
| 801514 | Alipay Web Payment (Hong Kong) |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
txamt | Int(11) | Yes | Amount in cents. Suggested > 200 to reduce risk control triggers. |
txcurrcd | String(3) | Yes | Currency (e.g. HKD, CNY). See Currencies. |
pay_type | String(6) | Yes | PayType (see table above). |
out_trade_no | String(128) | Yes | Unique merchant order ID. |
txdtm | String(20) | Yes | Timestamp YYYY-MM-DD HH:mm:ss. |
expired_time | String(3) | No | QR expiry (minutes). 5–120. (MPM only) |
goods_name | String(64) | No | Product name (≤20 chars). Use UTF-8 if Chinese. |
mchid | String(16) | No | Required if provided by QFPay for your store setup. |
udid | String(40) | No | Device ID for reporting. |
return_url | String(512) | No | Redirect URL after successful payment. |
Response Parameters
| Field | Type | Description |
|---|---|---|
respcd | String(4) | Return code. 0000 = success; 1143/1145 = retry needed; others = failed. |
resperr | String(128) | Error details (if any). |
respmsg | String(128) | General response message. |
syssn | String(40) | QFPay transaction ID. |
out_trade_no | String(128) | Merchant order ID. |
txamt | Int(11) | Amount (cents). |
txdtm | String(20) | Request timestamp. |
sysdtm | String(20) | Server timestamp (used for settlement cutoff). |
pay_type | String(6) | PayType used. |
pay_url | String(512) | Payment URL (render as QR code or embed in iframe). |
Code Examples
Use the language tabs below. Replace the placeholders with your own credentials and values.
Sample Response
Notes
If
respcd is 1143 or 1145, retry or query the transaction result using /trade/v1/query.