Accept UPI payments on your website with just 3 lines of code. No Razorpay or Paytm needed.
Just add a script tag and a button. Works on any website — HTML, WordPress, Shopify, React, anything!
<!-- Add before </body> --> <script src="https://litepay.in/checkout.js"></script>
<button onclick="payNow()">Pay ₹500</button> <script> function payNow() { LitePay.open({ // Your Secret Key (from Dashboard → API Keys) key: "SEC_your_secret_key", // Payment Details amount: 500, customer_name: "Customer Name", customer_email: "customer@email.com", customer_phone: "9876543210", description: "Order #12345", // Where to redirect after payment callback_url: "https://yourwebsite.com/thank-you.php", // OR use JavaScript callbacks onSuccess: function(data) { alert("Payment Successful! Order: " + data.order_id); }, onFailure: function(data) { alert("Payment Failed"); } }); } </script>
⚠️ Note: For production, create orders from your server (Method 2) and only pass the order_id to the frontend. Never expose the Secret Key in client-side code for high-security apps.
More secure. Create the order from your server, then pass the order_id to the frontend.
// create-payment.php (on YOUR server) <?php $secret_key = "SEC_your_secret_key"; $data = [ "amount" => 500, "customer_name" => "Rahul Kumar", "customer_email" => "rahul@gmail.com", "customer_phone" => "9876543210", "description" => "Wallet Recharge" ]; $ch = curl_init("https://litepay.in/api/v1/create-order.php"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Content-Type: application/json", "Authorization: Bearer " . $secret_key ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = json_decode(curl_exec($ch), true); if ($response['success']) { // Redirect customer to payment page header("Location: " . $response['payment_url']); } ?>
// webhook.php (on YOUR server) — Set this URL in LitePay Dashboard → API Keys <?php $payload = file_get_contents('php://input'); $data = json_decode($payload, true); // Verify signature $signature = $_SERVER['HTTP_X_GATEWAY_SIGNATURE'] ?? ''; $expected = hash_hmac('sha256', $payload, "SEC_your_secret_key"); if ($signature === $expected) { // Payment confirmed! $order_id = $data['order_id']; $amount = $data['amount']; $utr = $data['utr']; // TODO: Update your database, approve wallet, send receipt, etc. http_response_code(200); echo "OK"; } ?>
/api/v1/create-order.php
Creates a new payment order and returns a payment URL.
| Authorization | Bearer SEC_your_secret_key |
| Content-Type | application/json |
| amount * | Payment amount in INR (e.g. 500) |
| customer_name | Customer's name |
| customer_email | Customer's email |
| customer_phone | Customer's phone |
| description | Payment description |
{
"success": true,
"order_id": "ORD_6645A1B2C3abc1",
"amount": 500,
"payment_url": "https://litepay.in/pay/?order_id=ORD_6645A1B2C3abc1",
"expires_at": "2025-05-15 08:30:00"
}
/api/v1/order-status.php?order_id=ORD_xxx
Check the current status of a payment order.
{
"success": true,
"order_id": "ORD_6645A1B2C3abc1",
"status": "success", // pending | success | failed | expired
"amount": 500,
"utr": "412345678901",
"payment_time": "2025-05-15 08:05:30"
}
payment.success
Sent to your Webhook URL when a payment is successfully verified.
{
"event": "payment.success",
"order_id": "ORD_6645A1B2C3abc1",
"amount": 500,
"utr": "412345678901",
"timestamp": 1747254900
}
The header X-Gateway-Signature contains HMAC-SHA256 of the payload signed with your Secret Key. Always verify this before processing.
LitePay UPI Gateway — Powered by your own infrastructure