PaysFast API Documentation
Integrate automated peer-to-peer UPI checkouts and webhooks
1. Authentication
All requests require your secret merchant API key issued in your API Settings. Pass it via the Authorization: Bearer fg_live_... header or as an api_key query parameter.
# Example Header
Authorization: Bearer fg_live_xxxxxxxxxxxxxxxx
POST https://paysfast.hostlyindia.shop/api/orders.php?action=create
2. Create Dynamic Payment Order
Call this endpoint when a customer clicks "Pay with UPI" on your website or app.
# cURL Request curl -X POST https://paysfast.hostlyindia.shop/api/orders.php?action=create \ -H "Authorization: Bearer fg_live_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 499.00, "customer_email": "buyer@gmail.com", "customer_mobile": "9876543210" }'
Response (201 Created):
{
"status": "success",
"order_id": "ord_8H2KQ91",
"payable_amount": 499.00,
"upi_id": "merchant@fam",
"upi_intent": "upi://pay?pa=merchant@fam&pn=PaysFast%20Merchant&am=499.00&cu=INR&tr=ord_8H2KQ91",
"checkout_url": "https://paysfast.hostlyindia.shop/pay.php?order_id=ord_8H2KQ91",
"expires_at": "2026-10-15 15:45:00"
}
GET https://paysfast.hostlyindia.shop/api/orders.php?order_id=:id
3. Check Order Status (Polling Fallback)
Poll this endpoint every 2-3 seconds from your frontend or backend to check if the payment has been verified.
# cURL Request
curl https://paysfast.hostlyindia.shop/api/orders.php?order_id=ord_8H2KQ91
Response:
{
"status": "SUCCESS", // or "PENDING", "EXPIRED"
"order_id": "ord_8H2KQ91",
"amount": 499.00,
"utr": "429810239102", // 12-digit Bank Reference
"is_paid": true
}
4. Webhook Postback Specification
When an incoming bank UTR receipt arrives via IMAP, PaysFast fires an HTTP POST to your configured Webhook URL.
Webhook Headers:
Content-Type: application/json X-PaysFast-Signature: 6a8d0f73c52a0e9... (HMAC-SHA256 signature)
WHMCS MODULE READY
Download WHMCS Module (.zip)
5. WHMCS Client Area Payment Gateway
Integrate 100% automated UPI payments into your WHMCS hosting and domain billing system.
Quick 3-Step WHMCS Installation:
-
Extract the zip archive: Upload the files into your WHMCS installation directory:
whmcs_root/modules/gateways/paysfast.php
whmcs_root/modules/gateways/callback/paysfast.php - Activate in WHMCS Admin: Navigate to Configuration → System Settings → Payment Gateways, locate PaysFast UPI, and click Activate.
- Enter Credentials: Paste your Merchant API Key and HMAC Webhook Secret.
-
Configure Callback URL: In PaysFast Dashboard → API & Webhooks, set your Webhook URL to:
https://your-whmcs-domain.com/modules/gateways/callback/paysfast.php
✓
Invoices auto-mark as PAID in ~3 seconds upon UPI receipt confirmation with zero transaction fees!