Pay Plus Documentation
Automate direct peer-to-peer UPI payment verification in your web applications, bots, and ecommerce backends. Complete reference for order creation, hosted checkout, payment state verification, and cryptographically signed webhooks.
All-in-One API Endpoints Quick Reference
Instant cheatsheet of all production URLs, methods, authentication tiers, and jump links.
| Method | Endpoint / Path | Auth Level | Primary Purpose | Doc Link |
|---|---|---|---|---|
| POST | /api/v1/orders | API Key Req | Create dynamic UPI order and return checkout URL. | Create order → |
| GET | /api/v1/orders/:orderId | Public Safe | Poll checkout-safe order state — the verification source of truth. | Verify payment → |
| POST | /api/checkout/session | Public Safe | Freeze the QR snapshot the hosted checkout renders from. | Checkout session → |
Prerequisites & Quick Start
Before making API calls, verify you have satisfied the prerequisites below. Then follow the 6-step lifecycle to complete your first end-to-end payment flow.
- 1Obtain an API KeyGenerate a secret key on the API Keys page. Keys are displayed once upon generation and securely stored hashed with SHA-256.
- 2Create an OrderCall POST /api/v1/orders from your backend with the payment amount. The API returns an unguessable order ID and a hosted checkout URL.
- 3Direct Customer to Hosted CheckoutSend the customer to /pay/:orderId, where a server-frozen dynamic UPI QR snapshot is presented for scanning.
- 4Poll Payment VerificationPoll GET /api/v1/orders/:orderId from your server until the order status settles — no API key required for public status polling.
- 5Receive Signed WebhooksRegister an HTTPS webhook endpoint in Webhooks and verify cryptographically signed signatures. Deduplicate events on
event_id. - 6Fulfill Customer OrderRelease goods or services only after your server observes an authoritative
PAIDstate. Creating an order does not guarantee payment or settlement.
Base URL & Header Formatting
All API calls use same-origin paths on your deployed Pay Plus instance — append /api/v1 to your domain origin. All authenticated calls must provide an Authorization header formatted as Bearer YOUR_API_KEY. Query parameter keys are not supported.
Authorization: Bearer payplus_live_9f2c…Authentication Mechanism
Order creation uses a Bearer API key managed from your console's API Keys dashboard. Keys start with payplus_live_ or payplus_test_. Keys are shown only once at generation time and stored hashed with SHA-256 — they cannot be retrieved later. Revocation takes effect immediately; key rotation issues a replacement key and revokes the existing key atomically.
Order status queries require no secret key: possession of the unguessable public order ID is the authorization.
POST /api/v1/orders — Create an Order
Programmatically create a payment order. amount is the only mandatory field. All other fields are optional and validated identically to the dashboard form. Your FamPay mailbox must be connected in Integrations or the call is rejected with an input error.
| Field | Required | Type & Validation Rules |
|---|---|---|
amount | Yes | Positive number, ₹0.01 – ₹99,99,999.99 |
referenceNote | No | String up to 100 chars, assists payment matching |
description | No | String up to 255 chars, shown on checkout screen |
customerName | No | Customer display name string |
customerEmail | No | Valid email address format when provided |
customerPhone | No | Contact phone string |
returnUrl | No | Full http/https URL for the checkout Continue button |
metadata | No | Arbitrary JSON object for custom metadata attributes |
POST /api/v1/orders
Authorization: Bearer payplus_live_…
Content-Type: application/json
{
"amount": 499.00,
"referenceNote": "invoice-42",
"description": "UI kit license",
"customerName": "Priya",
"customerEmail": "priya@example.com",
"customerPhone": "9876543210",
"returnUrl": "https://yourstore.com/thanks",
"metadata": { "plan": "pro" }
}{
"ok": true,
"order": {
"orderId": "PPM7X2K9Q1A",
"amount": 499.00,
"currency": "INR",
"status": "PENDING",
"expiresAt": "2026-09-26T10:30:00.000Z",
"checkoutUrl": "/pay/PPM7X2K9Q1A"
}
}GET /api/v1/orders/:orderId — Check Order Status
GET /api/v1/orders/:orderId is public and unauthenticated. This is the authoritative verification endpoint polled by both customer browsers and merchant backends. Only checkout-safe fields are returned: no internal database keys, customer contact info, or private merchant metadata.
{
"ok": true,
"order": {
"orderId": "PPM7X2K9Q1A",
"amount": 499.00,
"currency": "INR",
"status": "PAID",
"description": "UI kit license",
"expiresAt": "2026-09-26T10:30:00.000Z",
"merchantName": "Aarav Store",
"merchantAvatar": null,
"linkStatus": null,
"returnUrl": "https://yourstore.com/thanks"
}
}Order Statuses & State Definitions
Pay Plus orders progress through strictly enforced state transitions. Only the automated server-side verification engine can transition an order to PAID.
| Status | Meaning | Merchant Action |
|---|---|---|
PENDING | Order created; waiting for matching UPI credit alert. | Wait and poll status endpoint. |
PROCESSING | Matching alert detected; verification in progress. | Wait; transaction settling. |
PAID | Payment verified against connected mailbox records. | Fulfill the order safely. |
REVIEW | Ambiguous evidence requiring human console check. | Hold fulfillment; review in /transactions. |
FAILED | Evidence contradicted order parameters. | Do not fulfill; generate new order. |
EXPIRED | Payment window elapsed without matched credit. | Terminal state; generate fresh order. |
CANCELLED | Merchant manually cancelled prior to payment. | Terminal state; no payment allowed. |
Hosted Checkout Lifecycle
Direct your customers to /pay/:orderId. The checkout page displays a dynamic UPI QR code generated from a server-frozen snapshot, counts down to expiry, and updates in real time as payment is confirmed. Once verified as PAID, the user is presented with a Continue button pointing to your configured returnUrl.
- Backend calls POST /api/v1/orders to create order
- Customer directed to hosted checkout URL (/pay/:orderId)
- Customer scans dynamic UPI QR with any UPI application
- Direct credit notification arrives at connected mailbox
- Verification engine validates amount, timestamp, and UTR
- Signed webhook dispatched & status transitions to PAID
- Merchant backend fulfills order after observing PAID
POST /api/checkout/session — Frozen QR Snapshot
POST /api/checkout/session — public endpoint, rate-limited at 30 requests/minute per client IP. Request body: { "orderId": "PP…" }.
Returns the frozen session snapshot used to render the checkout QR code: orderId, amount, currency, upiPayeeVpa, and expiresAt. Unknown or invalid order identifiers return 404 Not Found.
Server-Side Payment Verification
Poll GET /api/v1/orders/:orderId from your backend server (rate limit: 120/min per IP). Always treat PAID as the only definitive proof of payment. Never trust client-side redirects, customer claims, or unverified browser state.
Order State Machine
Order transitions follow strict server-enforced state validation edges:
- PENDING (Order awaiting payment)
- PROCESSING (Credit alert detected, parsing UTR)
- PAID (Authoritative verified status)
Alternative terminal outcomes include EXPIRED, CANCELLED, FAILED, and REVIEW. Once an order expires or cancels, it can never transition to paid — generate a new order if the customer wishes to retry.
Payment Safety & Deduplication Guarantees
- Unique UTR Enforcement: Every Unique Transaction Reference (UTR) is accepted only once per merchant. Duplicate alerts are rejected to prevent double-crediting.
- Stable Event Identifiers: Webhook deliveries carry a persistent
event_idthat remains constant across all automated retries. - Exponential Backoff Retries: Failed webhook deliveries are retried up to 8 times with exponential backoff, making duplicate delivery safe to no-op.
- Restricted Transitions: Client browsers, API callers, and redirects cannot change order payment status. Only the backend verification engine marks orders as paid.
Payment Links
Create fixed-amount payment links directly in the Pay Plus console at Payment Links. Each payment link is backed by a genuine order row and opens the standard /pay/:orderId checkout interface. Supported link statuses: Pending, Paid, Expired, and Disabled.
Webhooks Overview & Events
Register HTTPS webhook endpoints in your console at Webhooks. You can subscribe to any of the 6 supported event types:
order.paid— Payment successfully verified.order.processing— Matching alert detected; verification began.order.review— Ambiguous evidence flagged for merchant review.order.failed— Verification evidence contradicted order.order.expired— Payment window elapsed without payment.order.cancelled— Order was cancelled by merchant.
Every webhook payload delivers a persistent event_id. Always deduplicate incoming events by event_id on your server.
{
"event_id": "3f9d4e5a-1b2c-3d4e-5f6a-7b8c9d0e1f2a",
"event_type": "order.paid",
"order_id": "PPM7X2K9Q1A",
"amount": 499.00,
"occurred_at": "2026-09-26T10:31:02.000Z"
}Webhook delivery statuses include SUCCESS (receiver returned 2xx), PENDING_RETRY (queued with exponential backoff), and FAILED (exhausted after 8 attempts).
Verifying Webhook Signatures
Every webhook delivery includes an X-Signature header:
X-Signature: t=<unix_timestamp>,v1=<hmac_hex>The signature is computed as HMAC-SHA256(secret, "<t>.<raw_body>"). Verify signatures against the raw received request body, enforce a timestamp replay window (e.g., 10 minutes), and compare using a constant-time comparison such as timingSafeEqual to prevent timing attacks.
import { createHmac, timingSafeEqual } from 'node:crypto';
function verifyWebhook(secret, rawBody, signatureHeader) {
const match = /^t=(\d+),v1=([0-9a-f]+)$/.exec(signatureHeader ?? '');
if (!match) return false;
const [, t, v1] = match;
// Reject timestamps older or newer than 10 minutes (600s)
if (Math.abs(Date.now() / 1000 - Number(t)) > 600) return false;
const expected = createHmac('sha256', secret).update(t + '.' + rawBody).digest();
const received = Buffer.from(v1, 'hex');
return received.length === expected.length && timingSafeEqual(received, expected);
}import hmac
import re
import time
from hashlib import sha256
def verify_webhook(secret: str, raw_body: bytes, signature_header: str | None) -> bool:
match = re.match(r"^t=(\d+),v1=([0-9a-f]+)$", signature_header or "")
if not match:
return False
t, v1 = match.groups()
if abs(time.time() - int(t)) > 600: # 10-minute replay window
return False
expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, sha256).hexdigest()
return hmac.compare_digest(expected, v1)API Keys & Credential Hygiene
Manage your credentials on the console's API Keys page. Keys begin with payplus_live_ or payplus_test_.
- Pass keys in the
Authorization: Bearer YOUR_API_KEYheader. - Store keys only in secure server environment variables; never commit keys to Git or ship them in client code.
- Rotate compromised keys immediately from the console; revocation is immediate.
Authorization: Bearer YOUR_API_KEYAPI Rate Limits
To safeguard service availability, API requests are throttled using in-memory token buckets:
POST /api/v1/orders— 60 requests/min per API key (with a 30/min per-IP brake before auth).GET /api/v1/orders/:orderId— 120 requests/min per client IP.POST /api/checkout/session— 30 requests/min per client IP.- Webhook modifications in the console — 30 requests/min per merchant.
Throttled requests return HTTP 429 Too Many Requests with a standard error payload and a Retry-After header in seconds.
HTTP Status Codes & Error Format
All error responses conform to a unified JSON shape: { "error": true, "code": "...", "message": "..." }.
| HTTP Status | Error Code | Meaning | Recommended Action |
|---|---|---|---|
201 | — | Order created successfully. | Read order.checkoutUrl. |
200 | — | Order status read succeeded. | Check order.status. |
400 | invalid_input | Field validation failure or mailbox disconnected. | Fix highlighted field in fields and retry. |
401 | unauthorized | Missing or unrecognized API key. | Verify Bearer key; check for accidental truncation. |
404 | not_found | Order identifier does not exist. | Verify order ID parameter format. |
429 | rate_limited | Request volume exceeded quota limit. | Inspect Retry-After header and back off. |
500 | server_error | Internal server processing error. | Retry with exponential backoff. |
Code Examples
Direct REST integration examples in cURL, Node.js, and Python.
curl -X POST "https://YOUR_ORIGIN/api/v1/orders" \
-H "Authorization: Bearer payplus_live_…" \
-H "Content-Type: application/json" \
-d '{"amount": 499.00, "referenceNote": "invoice-42"}'const res = await fetch("https://YOUR_ORIGIN/api/v1/orders", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.PAYPLUS_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ amount: 499.0, referenceNote: "invoice-42" }),
});
const { order } = await res.json();
if (!res.ok || !order) throw new Error("Order creation failed");
// Later: Verify status server-side before fulfilling
const check = await fetch(
`https://YOUR_ORIGIN/api/v1/orders/${order.orderId}`,
);
const { order: current } = await check.json();
if (current.status === "PAID") {
// Safe to fulfill the customer order
}import json
import urllib.request
ORIGIN = "https://YOUR_ORIGIN"
KEY = "payplus_live_…" # Store securely in server environment
def api(method, path, body=None):
req = urllib.request.Request(
ORIGIN + path,
data=json.dumps(body).encode() if body is not None else None,
headers={"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"},
method=method,
)
with urllib.request.urlopen(req) as res:
return json.load(res)
order = api("POST", "/api/v1/orders", {"amount": 499.00})["order"]
# Later: Verify status server-side before fulfilling
current = api("GET", f"/api/v1/orders/{order['orderId']}")["order"]
if current["status"] == "PAID":
pass # Safe to fulfill the customer orderIntegration Flow Architecture
Secret credentials stay strictly on your backend server. Browsers interact only with the public hosted checkout page and keyless status checking endpoints.
- Your Backend Server
- Pay Plus API (POST /api/v1/orders)
- Dynamic UPI Order Created
- Hosted Checkout (/pay/:orderId)
- Customer Scans UPI QR
- Mailbox Verification Engine
- Signed Webhook (order.paid)
- Your Backend Fulfills Goods
Common Integration Mistakes
- Frontend Key Exposure: Exposing secret API keys in browser JavaScript or mobile client code. Calls must originate from your backend.
- Trusting Client Callbacks: Treating a payment button click or frontend redirect as payment proof. Only authoritative
PAIDstatus counts. - Skipping Webhook Verification: Failing to verify the
X-Signatureheader against the raw body bytes. - Missing Deduplication: Forgetting to deduplicate webhook events by
event_id. Automated retries reuse the same identifier. - Ignoring Expiration: Attempting to poll expired orders indefinitely. Expired orders never transition to paid; create a new order.
- Ignoring Rate Limits: Hammering the API on
429without honoring theRetry-Afterheader.
System Operational Status
Live operational status across API endpoints, checkout pages, database availability, and webhook delivery workers is published transparently on the System Status Page, computed from genuine health monitoring checks.
Testing Guide & Test Keys
A payplus_test_ key authenticates identically to a production key. There is no separate sandbox ledger: test keys create real orders on your account, so use small amounts (e.g., ₹1.00) during integration testing, and cancel or let test orders expire when finished. Verification requires a connected mailbox and actual payment evidence — test mode never invents simulated credits.
Frequently Asked Questions
- Where do I find my API key?
- Generate an API key on the API Keys page after connecting your FamPay mailbox in Integrations. The secret key is displayed once upon generation.
- Should my API key be used in frontend JavaScript?
- No. Secret API keys must remain strictly on your server backend. The hosted checkout and status polling endpoints are public and keyless by design.
- How do I create a payment order?
- Send a
POSTrequest with your Bearer key and theamountto /api/v1/orders. Direct the customer to the returnedcheckoutUrl. - How do I know when a payment has succeeded?
- Your backend observes
PAIDstatus through either GET /api/v1/orders/:orderId or a verifiedorder.paidwebhook delivery. - How should duplicate webhook deliveries be handled?
- Deduplicate on
event_id. If an event ID has already been processed by your system, safely no-op the request and respond with HTTP 200. - What happens when an order expires?
- The order enters the terminal
EXPIREDstate and cannot accept payments. Create a new order if the customer needs another attempt. - Which UPI flow is supported?
- QR-first hosted checkout: Customers scan a server-frozen dynamic UPI QR code using any UPI application; Pay Plus monitors the connected mailbox and verifies incoming credits.
Production Launch Checklist
- API keys stored securely in server environment variables only
- HTTPS enforced on your backend and webhook endpoints
- Webhook signature verified against raw body bytes using timingSafeEqual
- Payment status verified server-side before goods/services are fulfilled
- Duplicate webhook events handled safely via event_id deduplication
- Expired and cancelled order scenarios handled with clean error messages
- Rate limit 429 response backoff handled gracefully
- End-to-end test payment completed successfully with real verification
- Webhook delivery history monitored and confirmed on /webhooks
Refunds Policy
Pay Plus operates on a peer-to-peer verification model and never holds or escrows merchant funds. As a result, there is no automated refund API endpoint and no refund status. Any refund or dispute resolution occurs directly inside your own UPI or banking application outside Pay Plus.