Create an order from your server, send your customer to the payment page, and get a signed webhook when the payment is done. Money goes straight to your own Paytm merchant account.
Base URL: https://www.orixpay.site
You need an account with the Paytm merchant connected. Create a free account, then open Connect Merchant. Your API key is in API Details. Ready client files for PHP, Node.js, Python and cURL are in SDK Downloads.
create-order.php and gets a pay_url.pay_url. They pay with Paytm UPI. The order expires in 5 minutes.order.paid. You can also poll order-status.php.Send your API key with every request:
| Field | Value |
|---|---|
api_key | Starts with pk_live_. Send it as a form field, a JSON field or an Authorization: Bearer header. For order-status use the header (a key in the URL is rejected, it leaks into server logs). Keep it on your server. Never put it in a website or app. |
You can create a new key any time in API Details. The old one stops working immediately.
POSThttps://www.orixpay.site/api/create-order.php
Send a form body or JSON (Content-Type: application/json).
| Field | Required | Details |
|---|---|---|
amount | Yes | Rupees, from 1 to 100,000. Up to 2 decimals. |
client_ref | No | Your own order id, up to 60 characters. Sending the same value again while the order is pending returns that same order with duplicate: true. After the order is paid or expired, the value cannot be reused. |
customer_mobile | No | 10-digit Indian mobile number. |
redirect_url | No | http(s) address where the customer is sent after payment (auto, about 3 seconds after success). We add order_id, status and your client_ref to it. Do not trust these alone: confirm with order-status or the webhook before delivering. |
note | No | Up to 200 characters. |
curl -X POST https://www.orixpay.site/api/create-order.php \ -d "api_key=YOUR_API_KEY" \ -d "amount=499" \ -d "client_ref=INV-101" \ -d "redirect_url=https://yourshop.com/thanks"
{
"status": true,
"duplicate": false,
"order_id": "ORD9F3A1C7E2B4D6A08",
"client_ref": "INV-101",
"amount": "499.00",
"order_status": "pending",
"pay_url": "https://yoursite.com/pay/checkout.php?o=ORD9F3A1C7E2B4D6A08",
"expires_at": "2026-10-03 14:35:00"
}
Send the customer to pay_url.
GEThttps://www.orixpay.site/api/order-status.php
Send order_id or client_ref. For a pending order we check the live status with Paytm before answering.
curl -H "Authorization: Bearer YOUR_API_KEY" "https://www.orixpay.site/api/order-status.php?client_ref=INV-101"
{
"status": true,
"order_id": "ORD9F3A1C7E2B4D6A08",
"client_ref": "INV-101",
"amount": "499.00",
"order_status": "success",
"utr": "412345678901",
"payment_mode": "UPI",
"paid_at": "2026-10-03 14:32:10",
"expires_at": "2026-10-03 14:35:00"
}
utr, payment_mode and paid_at are null until the order is paid. Mark an order paid in your system only when order_status is success.
order_status | Meaning |
|---|---|
pending | Waiting for the customer to pay. |
success | Paytm confirmed the payment. utr is filled. |
expired | Not paid within 5 minutes. Create a new order. |
Errors come as JSON with status: false and a readable message.
{ "status": false, "message": "Invalid API key." }
| HTTP | When |
|---|---|
401 | API key is wrong. |
404 | Order not found (order-status). |
405 | create-order must be called with POST. |
422 | A field is invalid, the Paytm merchant is not connected, client_ref is already used, or the merchant plan has expired. Read message. |
Save an https address in Webhooks (it must be a public server). When an order is paid we send a POST with a JSON body:
{
"event": "order.paid",
"order_id": "ORD9F3A1C7E2B4D6A08",
"client_ref": "INV-101",
"amount": "499.00",
"status": "success",
"utr": "412345678901",
"payment_mode": "UPI",
"paid_at": "2026-10-03 14:32:10",
"created_at": "2026-10-03 14:30:02"
}
| Header | Value |
|---|---|
X-Webhook-Event | order.paid (or test.ping for the test button) |
X-Webhook-Timestamp | Unix time when we signed the request. |
X-Webhook-Signature | v1= followed by HMAC-SHA256 hex of timestamp + "." + raw body, using your webhook secret. |
X-Webhook-Delivery | Id of this delivery. |
Reply with any 2xx status to confirm. Otherwise we retry after 1 min, 5 min, 30 min, 2 h and 6 h (6 tries in total). The same event can arrive more than once, so make your handler safe to repeat.
$body = file_get_contents('php://input');
$ts = $_SERVER['HTTP_X_WEBHOOK_TIMESTAMP'] ?? '';
$sig = $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '';
$calc = 'v1=' . hash_hmac('sha256', $ts . '.' . $body, 'YOUR_WEBHOOK_SECRET');
if (!hash_equals($calc, $sig) || abs(time() - (int)$ts) > 300) { http_response_code(400); exit; }
$event = json_decode($body, true);
if ($event['event'] === 'order.paid') {
// mark $event['order_id'] as paid in your database (ignore it if it arrives again)
}
http_response_code(200); echo 'OK';const crypto = require('crypto');
// Use express.raw({ type: '*/*' }) so req.body is the untouched body
app.post('/paytm-webhook', express.raw({ type: '*/*' }), (req, res) => {
const body = req.body.toString('utf8');
const ts = req.get('X-Webhook-Timestamp') || '';
const sig = req.get('X-Webhook-Signature') || '';
const calc = 'v1=' + crypto.createHmac('sha256', 'YOUR_WEBHOOK_SECRET').update(ts + '.' + body).digest('hex');
const ok = calc.length === sig.length && crypto.timingSafeEqual(Buffer.from(calc), Buffer.from(sig))
&& Math.abs(Date.now() / 1000 - Number(ts)) <= 300;
if (!ok) return res.sendStatus(400);
const event = JSON.parse(body);
// handle event.order_id when event.event === 'order.paid'
res.sendStatus(200);
});import hashlib, hmac, time
from flask import Flask, request
@app.post("/paytm-webhook")
def paytm_webhook():
body = request.get_data(as_text=True)
ts = request.headers.get("X-Webhook-Timestamp", "")
sig = request.headers.get("X-Webhook-Signature", "")
calc = "v1=" + hmac.new(b"YOUR_WEBHOOK_SECRET", (ts + "." + body).encode(), hashlib.sha256).hexdigest()
if not hmac.compare_digest(calc, sig) or abs(time.time() - int(ts or 0)) > 300:
return "", 400
event = request.get_json(force=True)
# handle event["order_id"] when event["event"] == "order.paid"
return "OK", 200No code needed. In the dashboard, Payment Link gives a shareable address with a fixed or customer-chosen amount, and Create Page gives a branded page with suggested amounts. Payments made through them show up in Transactions and fire your webhook like any other order.
success, and you handle a repeated event safely.client_ref for every order.