TruexGateway • True Hai Ye Choice!

REST API Reference

Integrate direct 0% fee UPI collections into your website, SaaS, or Telegram bot using TruexGateway's JSON endpoints. Create dynamic QR orders and auto-verify UTRs across Paytm, BharatPe, and FamPay.

Base Endpoint /api/
Polling Interval 3–5 Seconds
Supported Rails Paytm • BharatPe • FamPay
Developer Support @TrueXg_support

Authentication

To authenticate API requests from your backend server, include your secret API key in the request headers. You can generate API keys inside your TruexGateway Merchant Dashboard.

HTTP Request Headers
X-API-Key: txg_live_xxxxxxxxxxxxxxxxxxxxxxxx Content-Type: application/json

Note: If your client is authenticated via the browser dashboard, session cookies will be verified automatically.

POST

/api/create-order.php

Initializes a new UPI payment order on your active merchant gateway. Returns a unique internal `TXG...` order ID, a ready-to-use public checkout URL, a direct QR code URL, and the raw UPI intent URI.

ParameterTypeRequirementDescription
amount string Required Payment amount in INR (e.g., "499.00"). Min: ₹1, Max: ₹1,00,000.
orderRef string Required Your internal unique order ID (max 64 chars). Embedded in the UPI `tr` parameter.
description string Optional Payment note shown to the customer on their UPI app.
Request Payload
// Request Body (JSON) { "amount": "499.00", "orderRef": "ORD-2026-X901", "description": "VIP Subscription" }
GET

/api/generate-qr.php

Returns a direct HTTP redirect to a high-resolution QR code image backed by Cloudflare CDN. You can embed this URL directly into an HTML <img src="..."> tag or Telegram bot photo payload.

Query ParamRequirementDescription
orderId Required The internal TXG... order ID returned by the create-order endpoint.
public Optional Set to 1 to allow public checkout rendering without session headers.
Example URI
GET https://mail.truexgateway.xyz/api/generate-qr.php?orderId=TXG8F3A9C2B1D4E&public=1
GET

/api/payment-status.php

The master auto-verification polling endpoint. It checks the live database and queries your connected gateway engine (Paytm Offline Status API, FamPay Gmail IMAP, or BharatPe Tesseract API) to verify UTR and lock the payment in real time.

Query ParamRequirementDescription
orderId Required The internal TXG... order ID to verify.
public Optional Set to 1 for frontend checkout status polling.
Verified Success Response
{ "success": true, "orderId": "TXG8F3A9C2B1D4E", "orderRef": "ORD-2026-X901", "gateway": "paytm", "status": "success", "amount": 499.00, "utr": "412988371920", "verified": true }

HTTP Error Codes

Standard HTTP status codes are returned by all TruexGateway API endpoints.

Status CodeMeaningDescription
200 OK Success The request was successfully processed and executed.
400 Bad Request Validation Error Missing required parameters or invalid formatting (e.g., negative amount).
401 Unauthorized Auth Failed API key is missing, invalid, or the session has expired.
403 Forbidden Access Denied The merchant account is blocked or action is not permitted.
429 Too Many Requests Rate Limited You have exceeded the allowed API calls per minute. Slow down.
500 Internal Error Server Error An unexpected database or server failure occurred.