Overview
paytm.anujbots.xyz — REST API
This API provides 2 endpoints: the first generates a UPI QR code, and the second verifies payment status via the Paytm gateway. Both support GET and POST methods; responses are always JSON.
Endpoints
GET/POST/qr.phpUPI QR Generator
GET/POST/verify.phpTransaction Verifier
Response Headers
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
Payment Flow
Step-by-step integration
01
QR Generate
Call /qr.php
›
02
Save order_id
From response
›
03
Show QR
qr_url → img tag
›
04
User Pays
Any UPI app
›
05
Verify
/verify.php confirm
Expiry: QR code expires 1 hour after generation. The
expiry field is a Unix timestamp (now + 3600s).For polling: call
/verify.php every 5–10 seconds until you receive TXN_SUCCESS or the QR expires.QR Code Generate
/qr.php — create a UPI payment QR
GET
https://paytm.anujbots.xyz/qr.php?upi=paytm.s1zxmoz@pty&amount=100
Amount Mode
Fixed Amount
No Amount (Open)
Fixed Amount QR: Send the
Example:
amount parameter — the QR will have the amount pre-filled. The user cannot change it in their UPI app. Ideal for e-commerce and fixed-price payments.Example:
?upi=paytm.s1zxmoz@pty&amount=99.50&name=ANUJ+BOTSGET/qr.php?upi=paytm.s1zxmoz@pty&amount=99.50&name=ANUJ BOTS
No Amount (Open) QR: Omit the
Example:
amount parameter entirely (or send amount=0). The user enters their own amount in the UPI app. Great for donations and tips.Example:
?upi=paytm.s1zxmoz@pty&name=ANUJ+BOTS ← no amount!GET/qr.php?upi=paytm.s1zxmoz@pty&name=ANUJ BOTS&purpose=Donation
For open QR payments, always read the
amount field from the verify response — that is the actual amount paid.Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| upi | string | Required | — | UPI ID where payment will be received |
| amount | number | Optional | "0" = open | 0 / missing = open QR, positive value = fixed |
| name | string | Optional | "Merchant" | Merchant name — shown in the user's UPI app |
| purpose | string | Optional | "Payment" | Payment reason / note |
Success
Error
{ "success": true, "order_id": "ORD_1773214714_3144", // Save this for verify! "qr_url": "https://paytm.anujbots.xyz/qr_codes/ORD_...png", "amount": "100", // "0" = open amount QR "purpose": "Payment", "merchant": "ANUJ BOTS", "upi_id": "paytm.s1zxmoz@pty", "expiry": 1773218314 // Unix ts (now + 3600s) }
Response Fields
| Field | Type | Description |
|---|---|---|
| order_id | string | Must be saved — required for verification. Format: ORD_{time}_{rand} |
| qr_url | string | Direct URL of the QR image — use as <img src> |
| amount | string | "0" = open QR, positive = fixed amount |
| expiry | number | Unix timestamp — when this QR code expires |
Payment Verify
/verify.php — check transaction status
GET
https://paytm.anujbots.xyz/verify.php?orderid=ORD_xxx&merchantid=MID&merchantkey=KEY
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| orderid | string | Required | The order_id from the QR generate response |
| merchantid | string | Required | Paytm Merchant ID — found in your dashboard |
| merchantkey | string | Required | Paytm Secret Key — never expose in frontend code! |
TXN_SUCCESS
Failed / Pending
{ "success": true, "status": "TXN_SUCCESS", "transaction_id": "ORD_1773213363_6903", "amount": "1.00", // Actual amount paid (important for open QR) "merchant_id": "NzmDCR37225908023870", "message": "Payment verified successfully", "paytm_reference": "20260311111060000238475088714860147", "bank_reference": "600732811285", "timestamp": "2026-03-11 12:57:50.0" }
Response Fields (Success)
| Field | Type | Description |
|---|---|---|
| success | bool | true only when TXN_SUCCESS and order ID matches |
| status | string | TXN_SUCCESS / PENDING / TXN_FAILURE |
| amount | string | Actual amount paid in ₹ — especially important for open QR |
| paytm_reference | string | Paytm TXNID — save for dispute resolution |
| bank_reference | string | Bank BANKTXNID reference number |
| timestamp | string | Exact date-time the payment completed |
Security:
merchantkey is a secret — never hardcode it in client-side JavaScript. Always call verify from server-side code.Live API Tester
Test directly from your browser
QR Generate
Verify Payment
After generating a QR, click Auto-fill to copy the order_id here automatically.
Error Codes
Common errors and their solutions
success: true
Request successful
UPI ID is required
upi param missing
Missing parameters
merchantid/key/orderid absent
PENDING
Payment processing
TXN_FAILURE
Payment failed
Gateway Fail
Paytm API unreachable
Status Reference
| Status | success | Meaning | Action |
|---|---|---|---|
| TXN_SUCCESS | true | Payment confirmed | Process the order |
| PENDING | false | Still processing | Retry in 10s |
| TXN_FAILURE | false | Payment failed | Ask user to retry |
| UNKNOWN_ERROR | false | No response from Paytm | Check credentials |
Code Examples
JavaScript & PHP integration
JavaScript — Fixed & Open Amount
// Fixed Amount QR const fixed = await fetch( 'https://paytm.anujbots.xyz/qr.php' + '?upi=paytm.s1zxmoz@pty&amount=99&name=ANUJ+BOTS' ).then(r => r.json()); document.getElementById('qr-img').src = fixed.qr_url; sessionStorage.setItem('oid', fixed.order_id); // Save! // Open Amount QR (no amount param) const open = await fetch( 'https://paytm.anujbots.xyz/qr.php?upi=paytm.s1zxmoz@pty&name=ANUJ+BOTS' ).then(r => r.json()); // Verify (call from server-side!) const v = await fetch( `/your-server/verify?orderid=${fixed.order_id}` ).then(r => r.json()); if (v.success) { console.log('Paid: ₹' + v.amount); // Open QR actual amount console.log('Ref:' + v.paytm_reference); }
PHP Server-side
// Fixed Amount QR $r = json_decode(file_get_contents( "https://paytm.anujbots.xyz/qr.php?upi=paytm.s1zxmoz@pty&amount=99&name=ANUJ+BOTS" ), true); $_SESSION['oid'] = $r['order_id']; // Open Amount QR $o = json_decode(file_get_contents( "https://paytm.anujbots.xyz/qr.php?upi=paytm.s1zxmoz@pty&name=ANUJ+BOTS" ), true); // Verify (server-side — MID+KEY are safe here) $v = json_decode(file_get_contents( "https://paytm.anujbots.xyz/verify.php?orderid=" . $_SESSION['oid'] . "&merchantid=" . $MID . "&merchantkey=" . $KEY ), true); if ($v['success']) { processOrder($v['transaction_id'], $v['amount']); }