Developer documentation
Create orders with one API key, then verify through a shareable link — no webhook required. Keep your key on your server and send it in the X-API-KEY header.
AI integration prompt
For Google AI Studio, ChatGPT, Claude or your coding assistant. Includes the API contract, secure fulfilment and verification limitations.
Read the full prompt
Integrate PAYFLUX into my existing application. Inspect its framework, authentication, products and order storage first; preserve its design and working features. Implement the integration, not just example snippets.
PAYFLUX BASE URL: https://payflux.rajnishcodex.shop
Keep a single merchant API key in the server environment as PAYFLUX_API_KEY. Never expose it in frontend JavaScript, an Android APK, logs, URLs or browser storage. No public/secret key pair is needed.
1. CREATE AN ORDER FROM MY SERVER
POST /api/public/v1/create-order
Headers: X-API-KEY: <server environment key>, Content-Type: application/json
JSON: amount (number > 0 and <= 200000), optional customer_email (valid email, <=255 characters), optional note (<=120 characters), optional expires_in_minutes (integer 1–60, default 5).
Calculate amount from my trusted product catalogue, never trust a browser-submitted price. Persist my internal purchase ID, authenticated customer ID, expected amount/currency and returned PAYFLUX order_id before returning a payment link.
Response: order_id, amount, currency='INR', status='PENDING', payment_url, checkout_url, verify_url, upi_uri, qr_code, pay_instructions, expires_at.
There is no idempotency-key contract. Do not automatically retry a timed-out creation request as if it were safe; reconcile an existing purchase first to prevent duplicate orders.
2. HOSTED PAYMENT SCREEN
Open the returned payment_url or checkout_url. The payment_url opens the hosted checkout in a browser. FamPay uses QR-only: customer enters the exact order amount; do not force a UPI intent for this provider. Paytm for Business supports QR and UPI intent. The receiver UPI address is not displayed as a copy control but remains encoded in payment payloads; this is not encryption or anonymity.
3. VERIFY WITHOUT A REQUIRED WEBHOOK
GET /api/payment/{order_id}?format=json requires no API key. Alternatively GET /api/public/payment/{order_id}?format=json uses the publication-safe public prefix.
Returns order_id, amount, currency, status, utr (string or null), paid_at, expires_at, payment_url. There is no is_paid property; check status === 'SUCCESS'.
For server-side fulfilment prefer GET /api/public/v1/check-status/{order_id} with X-API-KEY, which scopes the result to the merchant. Its response has order_id, amount, status, utr, paid_at, expires_at (no currency field).
Poll about every 3 seconds with one request in flight, bounded retries and a timeout. Stop on SUCCESS or FAILED; handle HTTP/network errors separately from unpaid status. FAILED includes an expired payment window. Do not require a customer to enter a UTR. An automatically detected UTR is a receipt reference, not user-supplied proof.
4. SECURE FULFILMENT
Only my server may grant access or mark my purchase paid. Confirm that the provider order_id belongs to the signed-in customer and merchant, the amount matches the stored expected amount, and status is SUCCESS. Use an atomic, idempotent state transition so repeated polls cannot deliver twice. Never trust a browser success alert, screenshot, query parameter or submitted UTR. A return from a UPI app does not prove payment.
Do not allow my status proxy to fetch arbitrary caller-supplied URLs: construct the fixed provider URL from the purchase's stored order ID.
5. OPTIONAL WEBHOOK
The current gateway sends payment.success notifications and retains the legacy X-ZapGateway-Event header for existing integrations. Do not invent a webhook signature scheme; re-check the order using the authenticated status endpoint before fulfilment. Polling works without a webhook, including a Telegram bot running in polling mode.
6. ERRORS AND LIMITATIONS
Handle 400 validation, 401 missing/invalid/revoked key, 404 unknown or non-owned order, 409 no merchant UPI configured, and unexpected 5xx without leaking credentials.
FamPay verification depends on valid Gmail authorization and receipt emails arriving. Matching by amount can be ambiguous for concurrent equal-value payments; do not promise collision-proof verification. Paytm's current status integration is unofficial: MID alone is not a guarantee of verification and must be tested with authorized business access. Do not invent PhonePe/BharatPe companion integration.
7. DELIVERABLES
Provide working server endpoints, purchase persistence, checkout link, pending/success/expired/error states, and setup instructions with environment variable names only. Add tests for server-calculated prices, ownership checks, mismatched amount, duplicate success notifications and network failures. Run available tests. Clearly state which live-payment checks need my real account and have not been performed. Do not claim production readiness without an end-to-end paid-order test.Endpoints
Base URL: https://payflux.rajnishcodex.shop
POST /api/public/v1/create-order
Body: amount (required), customer_email, note, expires_in_minutes. Returns order_id, payment_url, upi_uri and qr_code.
GET /api/public/payment/:order_id?format=json
Public verification; no API key. The legacy /api/payment/:order_id?format=json link remains supported. Without JSON, the link redirects to hosted checkout.
GET /api/public/v1/check-status/:order_id
Returns { status: "PENDING" | "SUCCESS" | "FAILED", utr }. Poll every 3 seconds.
Errors
401 invalid or revoked key · 400 validation failure · 404 unknown order · 409 merchant has no UPI ID configured.
Create-order request & response
| Field | Type | Validation |
|---|---|---|
| amount | number · required | Greater than 0, maximum ₹200,000 |
| customer_email | string · optional | Valid email, up to 255 characters; null accepted |
| note | string · optional | Up to 120 characters; null accepted |
| expires_in_minutes | integer · optional | 1–60 minutes; defaults to 5 |
# Run on your server; PAYFLUX_API_KEY is an environment variable.
curl --fail-with-body -X POST \
https://payflux.rajnishcodex.shop/api/public/v1/create-order \
-H "X-API-KEY: $PAYFLUX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount":249,"note":"purchase:123","expires_in_minutes":5}'
# Replace the sample order ID with the response order_id.
curl --fail-with-body \
'https://payflux.rajnishcodex.shop/api/public/payment/ZG_EXAMPLE_ORDER?format=json'{
"order_id": "ZG_EXAMPLE_ORDER",
"amount": 249,
"currency": "INR",
"status": "PENDING",
"payment_url": "https://payflux.rajnishcodex.shop/api/payment/ZG_EXAMPLE_ORDER",
"checkout_url": "https://pay.payflux.rajnishcodex.shop/ZG_EXAMPLE_ORDER",
"verify_url": "https://payflux.rajnishcodex.shop/api/payment/ZG_EXAMPLE_ORDER?format=json",
"upi_uri": "upi://pay?...",
"qr_code": "https://api.qrserver.com/v1/create-qr-code/?...",
"pay_instructions": "Scan the QR and pay exactly ₹249. Status updates automatically.",
"expires_at": "2026-10-10T05:40:00.000Z"
}Sample response only. Use the URLs returned for your real order; do not build links from sample IDs.
Quick start
import requests
BASE = "https://payflux.rajnishcodex.shop"
import os
API_KEY = os.environ["PAYFLUX_API_KEY"]
# 1. Create an order
res = requests.post(
f"{BASE}/api/public/v1/create-order",
headers={"X-API-KEY": API_KEY, "Content-Type": "application/json"},
json={"amount": 249, "customer_email": "buyer@example.com", "note": "Pro plan"},
timeout=15,
)
res.raise_for_status()
order = res.json()
print(order["payment_url"], order["qr_code"])
# 2. Poll the status
status = requests.get(
f"{BASE}/api/public/v1/check-status/{order['order_id']}",
headers={"X-API-KEY": API_KEY},
timeout=15,
).json()
print(status["status"], status.get("utr"))External verification link
No webhook required. Every order gets one shareable URL that works for both paying and verifying — open it in a browser and the customer lands on the hosted UPI checkout, request it as JSON and you get the live payment status.
# Pay in a browser (no app, no bot):
https://payflux.rajnishcodex.shop/api/payment/ZG1A2B3C4DXYZ
# Verify the same order from anywhere (no API key needed):
curl https://payflux.rajnishcodex.shop/api/payment/ZG1A2B3C4DXYZ?format=json
{
"order_id": "ZG1A2B3C4DXYZ",
"amount": 249,
"currency": "INR",
"status": "SUCCESS",
"utr": "412345678901",
"paid_at": "2026-01-01T10:00:00.000Z",
"expires_at": "2026-01-01T10:05:00.000Z"
}Payment states & secure fulfilment
- PENDING
- Awaiting verified payment. Continue polling; do not deliver yet.
- SUCCESS
- Payment recorded. Your server must match ownership and expected amount before delivery.
- FAILED
- Payment window expired or failed. Stop polling and offer a new checkout.
Poll roughly every 3 seconds, with only one request in flight. Handle network failures separately, use bounded retries and fulfil each purchase exactly once. No is_paid field is returned: check status. Customers never submit a UTR; the returned UTR is an automatically detected receipt reference.
The examples are starting points, not complete shops: add authentication, server-side pricing, stored order ownership, timeout handling and idempotent delivery before going live. Kotlin credentials belong on a JVM server, never inside an Android app.
Verification limits & optional webhooks
FamPay requires a working authorized Gmail connection and the exact amount. Its QR does not prefill the amount. Receipt delays and simultaneous equal-value payments can cause delayed or ambiguous matching. Paytm for Business currently uses an unofficial status integration; MID alone does not guarantee automatic verification.
Webhook delivery is optional. Existing notifications retain the X-ZapGateway-Event header for compatibility. Verify the order again through the authenticated status endpoint before delivering; do not assume a signed webhook contract.
If a paid order remains pending, check Payment settings, test the Gmail connection and run the verifier. Contact support with the order ID. Platform subscription billing is separate and still uses manual payment approval.
