Payment Gateway API Documentation
MistaHub provides a lightweight REST API to accept direct, zero-fee payments across India (UPI & FamPay), Bangladesh (bKash, Nagad, Rocket, Upay), and Nepal (Khalti, eSewa). Funds settle directly into your wallet (T+0) and orders auto-verify via our Android Sync Engine or Gmail sync.
Base Endpoint
https://famapi.mistahub.in
Format & Auth
JSON • Bearer API Key
Verification Window
Exact-First • 20 Min Active
How Verification Works (Interactive Demo)
Switch country and click Simulate Payment to trace the mobile checkout, APK verification, and webhook callback.
Demo Merchant
₹199.00
Scan UPI QR or Pay via App
UPI ID
mistahub@ybl
Verifying Payment...
Reading official notification
Payment Verified
₹199.00
-
1
Create Order (
POST /api/create-order)Returns unique payable amount, payment link, and QR for your merchant currency.
-
2
Customer Pays Directly to Your Wallet
Money goes straight into your UPI / bKash / Nagad / Khalti account (0% fee, T+0).
-
3
Auto-Verification (Android APK / Gmail Sync)
Matches exact amount + UTR/TrxID in the 20-minute window and blocks spoofed SMS.
-
4
Webhook Fires & Customer Redirects
Your server receives
payment_successJSON and the checkout screen confirms.
Common Developer Pain Points Solved
Why indie developers, SaaS founders, and South Asian merchants switch from manual verification or high-fee aggregators to MistaHub.
| Merchant / Dev Problem | MistaHub Architecture Solution |
|---|---|
| 2%–3% MDR fees & T+2 settlement delays | 0% per-transaction cut with instant T+0 settlement straight to your own wallet or bank UPI. |
| Fake payment screenshots & spoofed SMS fraud | Android Sync APK monitors only your selected official app or whitelisted bank/MFS Sender IDs—blocking personal phone numbers. |
| Two customers paying the same amount at once | Exact-first amount allocation checks active orders from the last 20 minutes; simultaneous orders get unique +0.01 to +0.30 offsets. |
| Maintaining separate codebases for India, BD & Nepal | One single /api/create-order endpoint adapts currency, QR format, and checkout UI automatically from your merchant profile. |
Supported Currencies & Payment Apps
Configure your currency once in Gateway Setup—every order and webhook inherits it automatically.
| Region | Currency | Supported Apps / Wallets | Verification Channel |
|---|---|---|---|
| India | INR (₹) | FamPay, PhonePe, Google Pay, Paytm, BHIM, BharatPe, Bank UPI | Gmail Sync (FamPay) / Android APK |
| Bangladesh | BDT (৳) | bKash, Nagad, Rocket (DBBL), Upay, Bangla QR | Android APK (App + Official SMS) |
| Nepal | NPR (Rs) | Khalti, eSewa, Fonepay, IME Pay | Android APK + Khalti QR |
| Global | USD / PKR / EUR / AED | Any local wallet with Android payment notifications | Android APK |
Authentication
Authenticate server-side requests using your Secret API Key in the Authorization header. You can rotate your key anytime inside Gateway Setup using Google or Password re-verification.
Authorization: Bearer YOUR_API_KEY
/api/create-order
Create a Payment Order
Creates a checkout session and returns payment_url, qr_link, and the exact payable amount in your merchant's configured currency.
Body Parameters
amount
number | string
required
Positive base amount (e.g. 199). Exact amount is used when free in the last 20 minutes; else smallest unused offset +0.01–+0.30.
redirect_url
string
optional
URL where the customer redirects 3 seconds after verified payment.
curl -X POST "https://famapi.mistahub.in/api/create-order" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"amount": 199, "redirect_url": "https://yoursite.com/success"}'
const res = await fetch('https://famapi.mistahub.in/api/create-order', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ amount: 199, redirect_url: 'https://yoursite.com/success' }) }); const order = await res.json();
<?php $ch = curl_init("https://famapi.mistahub.in/api/create-order"); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode(["amount" => 199, "redirect_url" => "https://yoursite.com/success"]), CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json"] ]); $order = json_decode(curl_exec($ch), true);
import requests order = requests.post( "https://famapi.mistahub.in/api/create-order", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={"amount": 199, "redirect_url": "https://yoursite.com/success"} ).json()
{
"success": true,
"order_id": "MH4825194",
"amount": "199.00",
"currency": "BDT",
"currency_symbol": "৳",
"expiry_minutes": 20,
"status": "Pending",
"upi_id": "01712345678",
"merchant_name": "MistaHub Store",
"payment_url": "https://pay.mistahub.in/MH4825194",
"qr_link": "https://quickchart.io/qr?text=..."
}
/api/status/{order_id}
Retrieve Order Status
Always confirm payment status server-side before delivering digital goods. Including your Bearer API Key returns unmasked utr and customer_name.
Status Values
PendingWaiting for paymentUnder_ReviewReference submitted manuallySuccessConfirmed & paidRejectedRejected by merchantcurl -X GET "https://famapi.mistahub.in/api/status/MH4825194" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"order_id": "MH4825194",
"amount": "199.00",
"currency": "BDT",
"currency_symbol": "৳",
"expiry_minutes": 20,
"created_at": "2026-11-24 14:20:00",
"status": "Success",
"customer_name": "01798765432",
"utr": "DED220MHU4"
}
payment_success
Real-Time Webhook Events
When an order clears via Android APK, FamPay Gmail, or Telegram approval, MistaHub sends an asynchronous POST JSON request to your configured webhook_url.
order_id via GET /api/status/{order_id} with your API Key before updating user wallet balances.
{
"event": "payment_success",
"order_id": "MH4825194",
"amount": "199.00",
"currency": "INR",
"currency_symbol": "₹",
"customer_name": "Rahul Sharma",
"utr": "432918273645",
"txn_id": "432918273645",
"timestamp": "2026-11-24T14:21:10.000Z"
}
/api/user/device-status
Android Sync Engine Health
Check whether your Android Sync APK is online, which payment app package is selected, and whether Notification Access is granted before accepting high-volume traffic.
{
"success": true,
"online": true,
"seconds_since_last_ping": 18,
"selected_app_package": "com.bKash.customerapp",
"selected_app_name": "bKash",
"notification_permission": true,
"currency": "BDT",
"currency_symbol": "৳"
}
HTTP Error Codes
400 Bad RequestInvalid JSON or amount ≤ 0401 UnauthorizedInvalid, missing, or expired API Key403 ForbiddenAccount blocked or unauthorized404 Not FoundOrder ID does not exist429 Too ManyRate limit or all 31 decimal slots activeSandbox Testing
Preview the checkout UI without making a real transfer by appending ?test=1 to any payment URL:
https://pay.mistahub.in/MH123456?test=1
Frequently Asked Questions
Which countries and payment apps does MistaHub support? +
India (INR: FamPay, PhonePe, Google Pay, Paytm, BHIM), Bangladesh (BDT: bKash, Nagad, Rocket, Upay), Nepal (NPR: Khalti, eSewa, Fonepay), plus custom global currencies via Android APK.
How does MistaHub prevent fake SMS and screenshot fraud? +
The Android Sync Engine only accepts notifications from your selected official payment app or whitelisted bank/MFS Sender IDs—blocking personal phone numbers automatically.
Does Google Login work for API Key regeneration? +
Yes. Gateway Setup supports Dual Re-Auth: Google-login merchants verify with a 1-click Google popup, while email/password merchants confirm with their password.
Need Integration Help?
Direct developer support for API setup, webhooks, and Bangladesh/Nepal/India APK onboarding.