QR Codes
POST Generate QR
Get API Keys Free →

API Documentation

PayNexus provides a simple REST API to integrate UPI payments into your website or app.

Base URL: https://api.paynexus.in/v1

🔑 Authentication

All API requests require your API key in the request header.

Request Header
X-API-Key: pn_live_your_api_key_here
Content-Type: application/json

POST Create Payment

Initiate a new UPI payment session and get a QR code URL and deep link.

POST https://api.paynexus.in/v1/payment/create
Request Parameters
ParameterTypeRequiredDescription
amountfloatRequiredAmount in INR (e.g., 999.00)
order_idstringRequiredYour unique order identifier
callback_urlstringRequiredWebhook URL for payment events
redirect_urlstringOptionalRedirect after payment completion
customer_namestringOptionalCustomer's name
customer_emailstringOptionalCustomer's email
descriptionstringOptionalPayment description / note
PHP Example
$ch = curl_init("https://api.paynexus.in/v1/payment/create");
curl_setopt_array($ch, [
  CURLOPT_POST           => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER     => [
    "X-API-Key: pn_live_your_key",
    "Content-Type: application/json"
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "amount"       => 1499.00,
    "order_id"     => "ORD_" . time(),
    "callback_url" => "https://yoursite.com/webhook",
    "redirect_url" => "https://yoursite.com/success",
    "description"  => "Product Purchase"
  ])
]);
$response = json_decode(curl_exec($ch), true);
// $response["payment_url"] — redirect customer here
Success Response (200)
{
  "status": "success",
  "txn_ref": "TXN20250115ABC123",
  "payment_url": "https://pay.paynexus.in/TXN20250115ABC123",
  "qr_url": "https://api.paynexus.in/v1/qr/TXN20250115ABC123.png",
  "upi_deep_link": "upi://pay?pa=merchant@upi&pn=Merchant&am=1499&tn=Order",
  "expires_at": "2025-01-15T10:33:00Z"
}

GET Verify Payment

Verify payment status by transaction reference.

GET https://api.paynexus.in/v1/payment/verify/{txn_ref}
Response
{
  "status": "success",
  "txn_ref": "TXN20250115ABC123",
  "amount": 1499.00,
  "utr_number": "UTR123456789",
  "payer_upi": "customer@paytm",
  "payer_name": "Rahul Sharma",
  "paid_at": "2025-01-15T10:27:45Z"
}

POST Generate QR Code

Generate a UPI QR code image for a specific amount.

POST https://api.paynexus.in/v1/qr/generate
ParameterTypeRequiredDescription
amountfloatOptionalFixed amount (leave blank for dynamic)
notestringOptionalTransaction note displayed to payer
sizeintegerOptionalQR size in px (200–800, default 300)

⚠ Error Codes

HTTP CodeError CodeDescription
400INVALID_PARAMSMissing or invalid request parameters
401UNAUTHORIZEDInvalid or missing API key
402PLAN_LIMITMonthly transaction limit exceeded
404NOT_FOUNDTransaction or resource not found
409DUPLICATE_ORDEROrder ID already exists
422UPI_NOT_SETMerchant UPI ID not configured
500SERVER_ERRORInternal server error

🔔 Webhook Events

PayNexus sends POST requests to your webhook URL when payment events occur.

EventDescription
payment.successPayment received and confirmed
payment.failedPayment attempt failed
payment.pendingPayment initiated but not confirmed
payment.expiredPayment window expired (5 minutes)
link.paidPayment link was successfully paid