Skip to main content

Alipay Pre-Authorization

Freeze Funds

At the moment only Alipay wallet funds can be used for pre-authorization, credit-cards are not supported. Authorization requests lose their validity after 15min. In case of technical or currency related integration difficulties please contact technical.support@qfpay.com for support. Merchants can, at any time, unfreeze the funds in which case the assets will be available for spending on the original wallet. In addition, merchants can initiate a transfer for a fraction or all of the frozen funds in order to collect money for open customer invoices.

note

Alipay pre-authorization currently supports the following currencies: AUD, HKD, MYR, NZD, PHP, SGD, THB and USD

Alipay Pre-Auth process-flow

HTTP Request

POST ../trade/v1/payment

Find the correct pay_type for your checkout scenarios from the table below.

PayTypeDescription
801801Alipay Pre-Authorization in-store QRC Payment - Consumer Present Mode (CPM)
801808Alipay Pre-Authorization in-store QRC Payment - Merchant Present Mode (MPM)
801810Alipay Pre-Authorization in-APP Payment
801814Alipay Pre-Authorization Online Payment

Request Parameters


Request Body:

{
goods_name=goodcode1&mchid=R1zQrTdJnn&out_trade_no=alipay201909261129164551bcdd40&pay_type=801802&txamt=1&txcurrcd=USD&txdtm=2019-09-26 11:29:16&txzone=+0800
}

The above command returns JSON structured like this:

{
"pay_type": "801802",
"sysdtm": "2019-09-26 11:29:18",
"paydtm": "2019-09-26 11:29:19",
"txdtm": "2019-09-26 11:29:16",
"udid": "qiantai2",
"txcurrcd": "USD",
"txamt": "1",
"resperr": "Network busy, don't worry, we are fixing it (1297)",
"respmsg": "预授权发码参数异常或参数缺失",
"out_trade_no": "alipay201909261129164551bcdd40",
"syssn": "20190926000200020016004244",
"respcd": "1297",
"chnlsn": "",
"cardcd": ""
}
Parameter nameAttributeMandatoryTypeDescription
Public payment parameterPlease refer to the Public Payment Section for more details
Alipay openidopenidNoString(64)Corresponding to the APP authorization method.
Alipay payment codeauth_codeNoString(128)Specifies the authorization code for scanning a barcode/QR Code. The auth_code returned is unique in each authorization. Each auth_code can only be used once and will automatically expire. For testing CPM with Alipay and WeChat Pay the auth_code can be extracted by any QRC reader or manually found in the consumer wallet below the barcode.

Response Parameters

AttributeSecond parameter codeTypeParameter nameDescription
Public response parametersPlease refer to the Public Payment Section for more details

Unfreeze Funds

Only calls alipay.fund.auth.operation.cancel when the merchant’s system encounters timeout and has to stop the subsequent processes, or when the pre-auth result is unknown. If you want to perform a similar task for normal pre-auth (freezing) transactions, please call alipay.fund.auth.order.unfreeze. After submitting the fund authorization call Order Inquiry, and there is no clear authorization result and then call Fund Authorization Cancellation.

HTTP Request

POST ../trade/v1/reversal

Request Parameters


Request Body:

{
mchid=R1zQrTd***&syssn=20190722000300020081074842
}

The above command returns JSON structured like this:

{
"respmsg": "",
"resperr": "请求成功",
"respcd": "0000",
"syssn": "20190722000302320081074842",
"sysdtm": "2019-07-22 15:20:54",
"txamt": "10",
"txdtm": "2019-07-22 15:20:54",
"cardcd": "",
"txcurrcd": "HKD",
"orig_syssn": "20190722000300020081074842",
"respmsg": ""
}
Parameter nameAttributeMandatoryTypeDescription
Merchant IDmchidYesStringThe unique merchant ID is created by QFPay during the merchant onboarding process.
QFPay transaction numbersyssnNoStringMultiple entries are separated by English commas
External transaction numberout_trade_noNoStringe.g. Developer platform order number
Transaction amounttxamtNoIntWhether to pass this parameter depends on the payment channel, Alipay and WeChat Pay do not need to submit this information. Suggest value > 200 to avoid risk control.
Transaction request timetxdtmYesStringFormat: YYYY-MM-dd hh:mm:ss
Unique device idudidNoString
Time zonetxzoneNoStringUsed to record the local order time. The default is Beijing time GMT+8 (+0800)

Response Parameter

AttributeTypeParameter nameDescription
syssnString(40)QFPay transaction number
orig_syssnString(40)External transaction numberDeveloper platform transaction number
txdtmString(20)Time of the transaction requestFormat: YYYY-MM-dd hh:mm:ss
txamtInt(11)Order payment amount
sysdtmString(20)System trading timeFormat: YYYY-MM-dd hh:mm:ss
This parameter value is used as the cut-off time for settlements.
respcdString(4)Return code
respmsgString(128)Information description
resperrString(128)Description error
cardcdStringCard number
txcurrcdString(3)CurrencyTransaction currency. View the Currencies table for a complete list of available currencies

Deduct Funds

HTTP Request

POST ../trade/v1/authtrade

Request Parameters


Request Body:

{
mchid=R1zQrTd***&syssn=20190722000300020081074842&out_trade_no=alipay201909271528139576015cbf&txamt=1&txdtm=2019-09-27 15:28:13&txzone=+0800
}

The above command returns JSON structured like this:

{
"respmsg": "",
"resperr": "请求成功",
"respcd": "0000",
"syssn": "20190722000302320081074842",
"sysdtm": "2019-07-22 15:20:54",
"txamt": "10",
"txdtm": "2019-07-22 15:20:54",
"cardcd": "",
"txcurrcd": "HKD",
"orig_syssn": 20190722000300020081074842
}
Parameter nameAttributeMandatoryTypeDescription
Merchant IDmchidNoStringThe unique merchant ID is created by QFPay during the merchant onboarding process.
QFPay transaction numbersyssnYesStringFund authorization number
External transaction numberout_trade_noYesStringDeveloper platform transaction number
Transaction amounttxamtYesintThe actual amount of consumption, the maximum deduction amount cannot exceed the fozen fund. Suggest value > 200 to avoid risk control.
Transaction request timetxdtmYesStringFormat: YYYY-MM-DD hh:mm:ss
Device IDudidNoStringMust be unique
Time zonetxzoneNoStringUsed to record the local order time. The default is Beijing time GMT+8 (+0800)
Redirect URLreturn_urlNoStringRedirect to address after successful payment. Mandatory parameter to submit for GrabPay Online. Alipay WAP restricts the return_url to maximum 200 characters.

Response Parameters

AttributeTypeParameter nameDescription
syssnString(40)QFPay Transaction numberThis number is being used when freezing funds, detucting money from the frozen amount as well as unfreezing funds.
orig_syssnString(40)External transaction numberDeveloper platform transaction number
txdtmString(20)Transaction request timeFormat: YYYY-MM-DD hh:mm:ss
txamtInt(11)Transaction amount
sysdtmString(20)System transaction timeFormat: YYYY-MM-DD hh:mm:ss
respcdString(4)Return code
respmsgString(128)Information description
resperrString(128)Description error
cardcdStringCard number
txcurrcdStringCurrencyTransaction currency. View the Currencies table for a complete list of available currencies