Developer API & Dual Checkout Architecture
The modern payment rail engineered specifically for Pakistani commerce. Accept JazzCash USSD Flash Push, Easypaisa App Push, and Raast Dynamic OneQR (EMVCo ISO 20022) with our Dual Integration Architecture: choose between a frictionless Drop-In Modal checkout or a 100% White-Label Direct API running entirely on your own domain.
Dual Checkout Integration Methods
Flux offers two purpose-built integration paradigms. Select the approach that matches your security model, developer resources, and desired customer conversion flow:
Hosted & Drop-In Modal Checkout
Create a payment session from your backend and launch our secure Drop-In Modal popup directly on your cart or redirect customers to a hosted checkout URL.
- Zero UI Form Maintenance: Wallets, QR generation, and error retries are fully managed by Flux.
- Brand Customization: Configure your merchant store name, brand accent color, and custom logo.
-
Two-Way postMessage Events: Real-time event hooks (
flux:ready,flux:success,flux:close). - Zero Compliance Burden: PCI and financial compliance fully offloaded to the Flux secure enclave.
White-Label Direct API & Headless
Zero redirects. Collect customer mobile numbers natively in your own custom UI and dispatch direct USSD flash prompts, Easypaisa app pushes, or raw Raast OneQR strings.
- 100% Domain & Brand Control: Customer stays entirely on your store or in your native iOS/Android mobile app.
- Direct JazzCash USSD Push: Trigger immediate MPIN prompt directly onto customer's handset.
- Direct Easypaisa App Push: Dispatch push authorization to customer's Easypaisa mobile app.
- Raw Raast Dynamic OneQR: Render compliant EMVCo ISO 20022 QR code payload natively on your canvas.
Drop-In Modal Live Sandbox Simulator
Test customized brand branding, dynamic colors, channel switching, and simulated USSD authorization.
Dual Environments & Base URL
Flux maintains separate isolated environments for sandbox development and production traffic. All calls require HTTPS with TLS 1.3 encryption.
https://gofluxpay.com
Processes live transactions routed to State Bank of Pakistan 1Link and telco switches.
https://gofluxpay.com/sandbox
Zero real money deductions. Simulates USSD approvals, declines, timeouts, and QR scans.
Idempotency-Key: <UUID> header on all state-mutating requests (such as /payments/create and /payouts/create). This safely prevents duplicate charges in cases of network dropped packets or automated merchant retries.
Authentication & API Keys
Authenticate your requests by supplying your secret API Key in the HTTP Authorization header using the standard Bearer scheme:
Authorization: Bearer flx_live_9a8b7c6d5e4f3a2b1c0d
| Header | Type | Status | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer secret key generated in Merchant Dashboard > API Keys. |
| Content-Type | string | Required | Must be set to application/json for all POST requests. |
| Idempotency-Key | string | Optional | Unique client UUIDv4 to safeguard against double charging on network timeouts. |
OAuth Token Handshake
Generate temporary scoped Bearer tokens for server-to-server automation and high-security payout operations.
| Parameter | Status | Description |
|---|---|---|
| merchant_id string | Required | Your merchant account identifier (e.g. mrc_live_9a8b7c6d5e). |
| api_key string | Required | Your production API secret key from Merchant Portal. |
Loading snippet...
{
"success": true,
"access_token": "flx_tok_9a2b8e4f1c7d0b3a5e8f",
"token_type": "Bearer",
"expires_in": 86400,
"scope": "payin payout title_fetch"
}
Method 1: Create Hosted & Drop-In Checkout Session
Initialize a payment session from your backend. Flux returns a unique checkout_url and secure session token to either launch the Drop-In Modal on your cart or redirect the customer.
| Parameter | Status | Description |
|---|---|---|
| merchant_id string | Required | Your merchant public MID (e.g. mrc_live_9a8b7c6d5e). |
| amount decimal | Required | Order total in PKR (e.g. 2500.00). Min 1.00, Max 1,000,000.00. |
| order_id string | Required | Unique alphanumeric invoice or order reference from your system. |
| customer_name string | Optional | Customer full name (pre-fills checkout forms). |
| payer_phone string | Optional | Customer mobile in 03XXXXXXXXX format for automatic wallet pre-fill. |
| payer_email string | Optional | Customer email address for digital payment receipts. |
| return_url string | Optional | Browser redirect URL after customer completes payment. |
| webhook_url string | Optional | Per-transaction override for instant payment notification webhooks. |
Loading snippet...
{
"success": true,
"payment": {
"payment_id": "pay_9a7bc418",
"order_id": "ORDER-1001",
"amount": 2500,
"status": "pending",
"checkout_url": "https://gofluxpay.com/checkout.php?payment=pay_9a7bc418&token=a1b2c3d4e5f60718293a4b5c6d7e8f90",
"token": "a1b2c3d4e5f60718293a4b5c6d7e8f90",
"expires_at": 1735689600
}
}
Method 2: JazzCash Mobile USSD Push
Direct headless execution for JazzCash. Sends an immediate USSD Flash PIN Prompt to the customer mobile handset. The customer inputs their 4-digit MPIN directly on their screen to authorize the charge without redirecting.
| Parameter | Status | Description |
|---|---|---|
| payment_id string | Required | Flux payment identifier returned from session creation (pay_9a7bc418). |
| token string | Required | Checkout session verification token. |
| method string | Required | Must be set to literal string "jazzcash". |
| mobile_number string | Required | Customer JazzCash mobile wallet number in 03XXXXXXXXX format. |
Loading snippet...
{
"success": true,
"message": "USSD push prompt dispatched to handset.",
"payment_id": "pay_9a7bc418",
"status": "pending_ussd",
"expires_in_seconds": 90
}
Method 2: Easypaisa In-App Push Authorization
Dispatches an in-app authorization push notification to the customer Easypaisa smartphone app. Customer simply taps Approve or inputs their OTP to complete the transaction.
| Parameter | Status | Description |
|---|---|---|
| payment_id string | Required | Flux payment ID (pay_9a7bc418). |
| token string | Required | Checkout session verification token. |
| method string | Required | Must be set to literal string "easypaisa". |
| mobile_number string | Required | Customer Easypaisa account phone number (e.g. 03451234567). |
Loading snippet...
{
"success": true,
"message": "In-app push notification sent to Easypaisa app.",
"payment_id": "pay_9a7bc418",
"status": "pending_app_approval",
"expires_in_seconds": 120
}
Method 2: Raast Dynamic OneQR (EMVCo ISO 20022)
Returns a compliant EMVCo Raast OneQR string. Render this dynamic QR directly on your native HTML canvas or app screen. Any Pakistani banking app (Meezan, HBL, Alfalah, SadaPay, NayaPay) can scan and instantly settle.
| Parameter | Status | Description |
|---|---|---|
| payment_id string | Required | Flux payment ID (pay_9a7bc418). |
| token string | Required | Checkout session verification token. |
| method string | Required | Must be set to literal string "oneqr". |
Loading snippet...
{
"success": true,
"payment": {
"payment_id": "pay_9a7bc418",
"status": "pending_qr_scan",
"qr_string": "00020101021228560010A00000072701260010PK.RAAST.01012345678952044814530358654072500.005802PK5916Luxe Store LHR6006Lahore6304A1B2",
"expires_at": 1735689600
}
}
Method 2: Direct Headless Status Polling
While the customer enters their MPIN on their handset or scans the Raast QR, poll this lightweight endpoint every 2 seconds from your frontend JavaScript.
| Parameter | Status | Description |
|---|---|---|
| payment string | Required | Flux payment identifier (pay_9a7bc418). |
| token string | Required | Client session token. |
Loading snippet...
{
"success": true,
"payment": {
"payment_id": "pay_9a7bc418",
"order_id": "ORDER-1001",
"amount": 2500,
"status": "completed",
"payment_method": "jazzcash"
}
}
Payment Status Verification (Server-to-Server)
Authoritative server-to-server check to verify transaction settlement states using your secret API key.
| Parameter | Status | Description |
|---|---|---|
| payment_id string | Required | Flux payment ID (pay_9a7bc418). |
| merchant_id string | Required | Your merchant account MID. |
| order_id string | Optional | Alternative lookup using your internal order ID. |
Loading snippet...
{
"success": true,
"payment": {
"payment_id": "pay_9a7bc418",
"order_id": "ORDER-1001",
"amount": 2500,
"fee": 43.75,
"net_amount": 2456.25,
"currency": "PKR",
"status": "completed",
"payment_method": "jazzcash",
"payer_phone": "03001234567",
"customer_name": "Tariq Khan",
"settled_at": "2026-11-14T11:42:18Z"
}
}
Disbursements: Supported Banks & Wallets Catalog
Retrieve all 1Link participant financial institutions and microfinance wallets with their active routing codes (IMD codes) for instant Inter-Bank Funds Transfers (IBFT).
Loading snippet...
{
"success": true,
"count": 36,
"banks": [
{
"code": "MBL",
"name": "Meezan Bank Limited",
"type": "bank",
"active": true
},
{
"code": "HBL",
"name": "Habib Bank Limited",
"type": "bank",
"active": true
},
{
"code": "BAFL",
"name": "Bank Alfalah Limited",
"type": "bank",
"active": true
},
{
"code": "JC",
"name": "JazzCash Mobile Wallet",
"type": "wallet",
"active": true
},
{
"code": "EP",
"name": "Easypaisa Mobile Wallet",
"type": "wallet",
"active": true
},
{
"code": "SADA",
"name": "SadaPay",
"type": "emi",
"active": true
},
{
"code": "NAYA",
"name": "NayaPay",
"type": "emi",
"active": true
}
]
}
Disbursements: Account Title Verification (Title Fetch)
Perform a real-time account title lookup to display the verified beneficiary account title prior to initiating funds transfer, avoiding accidental transfers to wrong account numbers.
| Parameter | Status | Description |
|---|---|---|
| merchant_id string | Required | Your merchant account MID. |
| account_number string | Required | Beneficiary bank account number or IBAN. |
| bank_code string | Required | Bank code from catalog (e.g. MBL, HBL, JC, EP). |
Loading snippet...
{
"success": true,
"account_title": "MUHAMMAD USMAN KHAN",
"account_number": "0102030405060708",
"bank_code": "MBL",
"bank_name": "Meezan Bank Limited",
"verified": true
}
Disbursements: Execute Instant IBFT Payout
Instantly transfer funds to any Pakistani bank account or mobile wallet via 1Link IBFT. Deductions are settled from your available merchant float balance in real-time.
| Parameter | Status | Description |
|---|---|---|
| merchant_id string | Required | Your merchant account MID. |
| amount decimal | Required | Transfer amount in PKR (e.g. 15000.00). |
| account_number string | Required | Beneficiary destination account number or IBAN. |
| bank_code string | Required | Institution routing code (e.g. MBL). |
| beneficiary_name string | Required | Verified account holder name from Title Fetch step. |
| narration string | Optional | Transfer description / invoice reference. |
Loading snippet...
{
"success": true,
"payout_id": "payout_981a2c",
"amount": 15000,
"fee": 25,
"status": "processed",
"rrn": "614210998124",
"beneficiary_title": "MUHAMMAD USMAN KHAN",
"transferred_at": "2026-11-14T11:45:00Z"
}
Disbursements: Payout Status Inquiry
Query transaction state of an individual disbursement.
| Parameter | Status | Description |
|---|---|---|
| payout_id string | Required | Flux payout ID (payout_981a2c). |
| merchant_id string | Required | Your merchant account identifier. |
Loading snippet...
{
"success": true,
"payout": {
"payout_id": "payout_981a2c",
"amount": 15000,
"status": "processed",
"rrn": "614210998124"
}
}
Disbursements: Float Balance Inquiry
Check your live available settlement pool balance for outgoing disbursements.
| Parameter | Status | Description |
|---|---|---|
| merchant_id string | Required | Your merchant identifier. |
Loading snippet...
{
"success": true,
"currency": "PKR",
"available_balance": 485000,
"pending_balance": 15200,
"reserved_balance": 50000
}
Signed Webhooks & Real-Time Delivery
Flux pushes instant HTTP POST notifications to your server whenever asynchronous payment, settlement, or payout events occur. Payloads are signed with your secret Webhook Signing Key.
| Event Name | Trigger Moment | Fulfillment Action |
|---|---|---|
| payment.completed | Customer approved USSD prompt, app push, or paid via Raast QR. | Mark order Paid & trigger digital delivery. |
| payment.failed | Payment expired, customer rejected USSD, or insufficient funds. | Release held inventory back to store. |
| payout.processed | 1Link IBFT transfer successfully reached destination bank account. | Update vendor or user withdrawal ledger. |
| payout.failed | Beneficiary bank rejected transaction (invalid title or offline). | Refund amount back to merchant float. |
X-Flux-Signature header containing an HMAC-SHA256 digest. Always compute and compare the signature using constant-time string comparison before fulfilling orders.
Loading webhook verification snippet...
{
"event": "payment.completed",
"created_at": "2026-11-14T11:42:18Z",
"data": {
"payment_id": "pay_9a7bc418",
"order_id": "ORDER-1001",
"amount": 2500.00,
"fee": 43.75,
"currency": "PKR",
"payment_method": "jazzcash",
"payer_phone": "03001234567"
}
}
Error Codes & Handling Matrix
Flux returns standard HTTP 4xx and 5xx status codes accompanied by detailed JSON error envelopes to assist in quick diagnosis and user recovery:
| HTTP Status | Error Code | Root Cause | Suggested Merchant Recovery |
|---|---|---|---|
| 400 Bad Request | MISSING_PARAMETER |
Required field like amount or merchant_id was omitted. |
Validate JSON request payload prior to dispatching. |
| 401 Unauthorized | INVALID_API_KEY |
Supplied Bearer key is invalid, revoked, or formatted incorrectly. | Verify API secret key in Merchant Portal > API Keys. |
| 403 Forbidden | KYC_PENDING |
Merchant account documentation is awaiting compliance review. | Submit CNIC and business registration in Merchant Portal. |
| 404 Not Found | PAYMENT_NOT_FOUND |
Supplied payment_id does not exist in this environment. |
Verify whether transaction occurred in Sandbox or Live. |
| 409 Conflict | IDEMPOTENCY_MISMATCH |
The same Idempotency-Key was reused with different payload parameters. | Generate a distinct UUIDv4 for distinct transactions. |
| 422 Unprocessable | INSUFFICIENT_FUNDS |
Customer wallet lacks sufficient balance or exceeded monthly cap. | Prompt customer to fund their wallet or switch channel. |
| 429 Rate Limit | RATE_LIMIT_EXCEEDED |
API requests exceeded 300 requests/minute threshold. | Implement exponential backoff or request limit upgrade. |
| 500 Server Error | GATEWAY_TIMEOUT |
Upstream telco or 1Link banking switch did not reply in time. | Retry with identical Idempotency-Key. |
WordPress & WooCommerce Plugin Integration
Accept JazzCash, Easypaisa, and Raast OneQR on your WooCommerce store in 5 minutes with zero custom PHP programming:
- Download Plugin: In your Merchant Portal, go to Integrations > WooCommerce and download
flux-pay-woocommerce.zip. - Install in WordPress: Open WP Admin > Plugins > Add New > Upload Plugin and activate Flux Pay.
- Configure Credentials: Navigate to WooCommerce > Settings > Payments > Flux Pay and enter your
Merchant IDandProduction API Key. - Choose Checkout Mode: Toggle between Drop-In Popup Modal (customer pays without leaving your cart) or Hosted Redirect.
Shopify Custom Gateway Setup
Integrate Flux Pay into your Shopify Pakistan store:
- Install Custom Gateway: Under your Shopify admin settings, add Flux as an off-site payment provider.
- Link Merchant Account: Enter your Production API key and Webhook URL.
- Test Order: Place a PKR 1.00 live checkout to ensure inventory clearance and webhook callbacks function cleanly.