Skip to content

Pay

Updated: 7/26/26, 9:23:52 PM

Description

Create a payment order. The system returns a payment payload (payBody) that the merchant frontend uses to invoke payment or display a QR code.

Use this endpoint when the merchant backend has already determined the channel and payment method. For platform-hosted cashier or aggregate QR scenarios, use Gateway Pre-pay instead.

Request

POST /unipay/pay

  • Auth: RSA signature (@PaymentVerify)
  • Response: DaxResult<NormalPayResult>

Parameters

Common Parameters (shared by all /unipay/* endpoints)

Inherited from PaymentCommonParam / MerchantPaymentCommonParam:

ParameterTypeRequiredMaxDescription
mchNostringYes32Merchant number
appIdstringNo32Application ID
channelMchNostringNo32Channel merchant number (for debugging or direct channel routing; leave empty for normal routing)
reqIdstringYes64Unique request ID
nonceStrstringNo32Random string
signstringYes1024RSA signature (Base64)
reqTimestringYesRequest time (yyyy-MM-dd HH:mm:ss, GMT+8)
clientIpstringNo64Client IP

Business Parameters

ParameterTypeRequiredMaxDescription
bizOrderNostringYes100Merchant order number (unique in merchant system)
titlestringYes100Order title
descriptionstringNo50Order description
amountlongYesAmount in cents (min 1, max 9999999999)
productstringNo32Payment product code (auto-routed when empty)
methodstringNo32Payment method, e.g., wechat_qr, alipay_pc (see table below)
capabilitystringNo32Payment capability code (used as input when channel is directly specified)
openIdstringNo128User identifier (required for WeChat jsapi/mini)
channelAppIdstringNo128Channel App ID (forces use if non-empty, must be pre-configured)
authCodestringNo128Authorization code (required for barcode/merchant-scan)
limitPaystring[]No10Restrict payment methods (e.g., no_credit to disable credit cards)
extraParamstringNo2048Channel-specific extra params (JSON)
goodsDetailobject[]No50Order goods detail list (for item-level marketing, e-invoice, etc.)
notifyUrlstringNo200Async notification URL
returnUrlstringNo200Sync redirect URL
attachstringNo500Custom data (returned as-is in callback)
expiredTimestringNoOrder expiry time (yyyy-MM-dd HH:mm:ss, GMT+8; defaults to 30 min)
terminalobjectNoTerminal info (offline POS/cashier scenarios)

When is method required?

Generally required when routing via channel. For merchant-scan (barcode) it can be omitted — pass only authCode and the platform identifies the wallet by prefix. When channelMchNo + capability are directly specified, it can be inferred from capability.

Example

json
{
  "mchNo": "M200000001",
  "appId": "APP001",
  "reqId": "REQ20241201001",
  "nonceStr": "5K8264ILTKCH16CQ2502SI8ZNMTM67VS",
  "reqTime": "2024-12-01 12:00:00",
  "sign": "Base64Signature",
  "bizOrderNo": "ORDER20241201001",
  "title": "Test Product",
  "amount": 100,
  "method": "wechat_qr",
  "notifyUrl": "https://your-domain.com/notify",
  "returnUrl": "https://your-domain.com/return"
}

Response

DaxResult<NormalPayResult>, data fields:

FieldTypeDescription
orderIdlongOrder ID
bizOrderNostringMerchant order number
orderNostringPlatform order number
tradeNostringFund trade number
statusstringPayment status (PayStatusEnum)
payBodystringPayment payload (QR content, SDK params, or redirect URL)
payBodyTypestringPayload type (PayBodyTypeEnum)

payBodyType Values

Maps to backend enum PayBodyTypeEnum:

TypeDescriptionpayBody Example
linkPayment link (redirect)https://open.weixin.qq.com/...
jsapiJSAPI invocation paramsJSON string for frontend SDK
fromForm data (auto-submit HTML)<form action="...">...</form>
identifierIdentifier code (barcode scenarios)Plain identifier string from channel
qr_codeQR code content (frontend renders to image)weixin://wxpay/bizpayurl?pr=xxxxx
jsonJSON object (channel-specific structure)Channel-defined JSON string

Difference from old docs

Old documentation used code_url / pay_info / redirect_urlthese are not real enum values. Refer to the table above.

Example

json
{
  "code": 0,
  "msg": "success",
  "data": {
    "orderId": 1853123456789012345,
    "bizOrderNo": "ORDER20241201001",
    "orderNo": "P2024120112345700001",
    "tradeNo": "T2024120112345700001",
    "status": "progress",
    "payBody": "weixin://wxpay/bizpayurl?pr=xxxxx",
    "payBodyType": "qr_code"
  },
  "sign": "Base64Signature",
  "resTime": "2024-12-01T04:00:00Z",
  "reqId": "REQ20241201001"
}

Payment Methods (method)

method maps to PayMethodEnum, grouped by wallet:

WeChat Pay

methodDescription
wechat_qrWeChat Native (QR scan)
wechat_jsapiWeChat JSAPI (Official Account)
wechat_miniWeChat Mini Program
wechat_h5WeChat H5
wechat_appWeChat App
wechat_barcodeWeChat Barcode (merchant scan)
wechat_cashierWeChat Cashier

Alipay

methodDescription
alipay_qrAlipay QR scan
alipay_jsapiAlipay JSAPI (incl. Mini Program)
alipay_pcAlipay PC Web
alipay_h5Alipay H5
alipay_appAlipay App
alipay_barcodeAlipay Barcode (merchant scan)

UnionPay

methodDescription
union_qrUnionPay QR scan
union_jsapiUnionPay JSAPI
union_h5UnionPay H5
union_barcodeUnionPay Barcode (merchant scan)

Douyin Pay

methodDescription
douyin_qrDouyin QR scan
douyin_jsapiDouyin JSAPI
douyin_h5Douyin H5
douyin_appDouyin App

Aggregate

methodDescription
aggregate_pay_qrcodeAggregate QR payment (native one-code-multi-pay)

International Cards (reserved)

methodDescription
visa_card_gatewayVisa gateway
visa_card_presentVisa present
mastercard_card_gatewayMastercard gateway
mastercard_card_presentMastercard present

Pay Status (PayStatusEnum)

statusDescription
waitWaiting (no channel/method assigned)
progressProcessing (channel call initiated)
successPayment successful
closeClosed
cancelCancelled
failFailed
timeoutTimed out

Released under the GNU LGPL v3.0