Pre-authorisation allows merchants to freeze a specific amount of customer funds without immediately charging. The merchant can then capture (charge) the full or partial amount within a set period or unfreeze the remaining amount if not used.Documentation Index
Fetch the complete documentation index at: https://sdk.qfapi.com/llms.txt
Use this file to discover all available pages before exploring further.
When to Use Pre-authorisation
Pre-authorisation is especially useful in scenarios where the final charge amount is not confirmed upfront or the service is provided later:- Hotel bookings: Freeze a deposit at check-in, charge final amount at checkout
- Car or equipment rental: Freeze a guarantee or holding amount at pickup
- E-commerce with delayed shipment: Reserve funds on order, charge on dispatch
- Subscriptions or deferred services: Verify funding ability before providing service
- High-risk or variable pricing cases: Avoid payment failures and fraud
Valid Capture Period
Depending on your industry and channel, different maximum capture periods are supported:| Industry Type | Max Capture Window |
|---|---|
| General merchants | Up to 7 days |
| Hotels / Rentals | Up to 28 days |
Actual capture duration is subject to your agreement with QFPay and the payment channel’s capability. Please confirm before go-live.
Key APIs
Please first familiarise yourself with:- API Usage Guidelines
- API credentials
- Test vs Production environment
- Signature generation method
- Common error codes and resolution
Pre-authorisation Flow
Step 1: Create Pre-authorised Transaction
This step is handled via Payment Element SDK and involves freezing the customer’s funds. No actual deduction happens at this stage.Please refer to the Payment Element Integration Guide for front-end SDK usage.
Step 2: Capture (Deduct) Funds
Within the valid capture window, merchants can charge part or all of the frozen amount.Multiple partial captures are allowed, but the total cannot exceed the authorised amount.
POST /trade/v1/authtrade
Headers
| Header | Required | Description |
|---|---|---|
X-QF-APPCODE | Yes | Your App Code |
X-QF-SIGN | Yes | API Signature |
Request Parameters
| Parameter | Required | Description |
|---|---|---|
txamt | Yes | Amount to capture (suggested > 200) |
txcurrcd | No | Currency code |
mchid | No | Merchant ID (for specific channels only) |
syssn | Yes | Original pre-auth system order number |
Example Response
Unfreeze Remaining Funds
Unused funds from a pre-authorised transaction can be unfrozen and returned to the customer. Endpoint:POST /trade/v1/unfreeze
Request Parameters
| Parameter | Required | Description |
|---|---|---|
txamt | Yes | Amount to unfreeze |
txdtm | Yes | Timestamp of the unfreeze |
syssn | Yes | Original pre-auth system order number |
out_trade_no | Yes | Original merchant order number |
mchid | No | Merchant ID (if applicable) |
Example Response
Refund for Captured Payments
If the customer has already been charged (via capture), a refund can be initiated using the Refund API. Use thesyssn from the capture step (not the original pre-authorisation) when issuing the refund.
Async Notification
All major actions trigger standard webhook notifications:| Operation | notify_type value |
|---|---|
| Capture | payment |
| Unfreeze | unfreeze |
| Refund | refund |
Notification Sample
Best Practices & Warnings
Capture, unfreeze, and refund operations can be performed via:
- API calls
- QFPay merchant portal

