Navigation
Sections
Overview Payment Flow QR Generate Verify Payment Live Tester Error Codes Code Examples
Paytm API Docs
Live
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: *
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 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+BOTS
GET/qr.php?upi=paytm.s1zxmoz@pty&amount=99.50&name=ANUJ BOTS
No Amount (Open) QR: Omit the 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
ParameterTypeRequiredDefaultDescription
upistringRequiredUPI ID where payment will be received
amountnumberOptional"0" = open0 / missing = open QR, positive value = fixed
namestringOptional"Merchant"Merchant name — shown in the user's UPI app
purposestringOptional"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
FieldTypeDescription
order_idstringMust be saved — required for verification. Format: ORD_{time}_{rand}
qr_urlstringDirect URL of the QR image — use as <img src>
amountstring"0" = open QR, positive = fixed amount
expirynumberUnix 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
ParameterTypeRequiredDescription
orderidstringRequiredThe order_id from the QR generate response
merchantidstringRequiredPaytm Merchant ID — found in your dashboard
merchantkeystringRequiredPaytm 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)
FieldTypeDescription
successbooltrue only when TXN_SUCCESS and order ID matches
statusstringTXN_SUCCESS / PENDING / TXN_FAILURE
amountstringActual amount paid in ₹ — especially important for open QR
paytm_referencestringPaytm TXNID — save for dispute resolution
bank_referencestringBank BANKTXNID reference number
timestampstringExact 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
QR
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
StatussuccessMeaningAction
TXN_SUCCESStruePayment confirmedProcess the order
PENDINGfalseStill processingRetry in 10s
TXN_FAILUREfalsePayment failedAsk user to retry
UNKNOWN_ERRORfalseNo response from PaytmCheck 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']);
}