Developer Ledger · API Reference
REST API Documentation
Integrate automated UPI checkout, callbacks, and webhooks.
Introduction
Welcome to GuruPay Developer Reference. Simple REST API layer for automated UPI payment collection & callbacks.
Authentication
Pass custom HTTP headers with every API request:
| Header | Value |
|---|---|
| X-Guru-Key | guru_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| Content-Type | application/json |
Base Endpoint URL
BASE URL
https://gurupaygateway.com/api
Create Payment Order
POST
https://gurupaygateway.com/api/create-order
Request Parameters
| Parameter | Type | Presence | Description |
|---|---|---|---|
| amount | float | Required | Order amount in INR (e.g. 100.00). |
| order_id | string | Required | Unique order ID (e.g. ORD_20261027_2147). |
| customer_name | string | Required | Full customer name. |
| callback_url | string | Optional | Redirect URL after payment. |
curl -X POST https://gurupaygateway.com/api/create-order \
-H "X-Guru-Key: guru_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"amount": "100.00",
"order_id": "ORD_20261027_2147",
"customer_name": "Raushan Kumar",
"callback_url": "https://yourwebsite.com/callback.php"
}'
<?php
$payload = [
'amount' => '100.00',
'order_id' => 'ORD_20261027_2147',
'customer_name' => 'Raushan Kumar',
'callback_url' => 'https://yourwebsite.com/callback.php'
];
$ch = curl_init('https://gurupaygateway.com/api/create-order');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-Guru-Key: guru_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
]
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
if (isset($response['status']) && $response['status'] === 'success') {
header("Location: " . $response['data']['payment_url']);
exit;
}
?>
const fetch = require('node-fetch');
fetch('https://gurupaygateway.com/api/create-order', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Guru-Key': 'guru_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
},
body: JSON.stringify({
amount: '100.00',
order_id: 'ORD_20261027_2147',
customer_name: 'Raushan Kumar',
callback_url: 'https://yourwebsite.com/callback.php'
})
})
.then(res => res.json())
.then(data => console.log(data));
Check Order Status
POST
https://gurupaygateway.com/api/check-status
CHECK STATUS REQUEST
curl -X POST https://gurupaygateway.com/api/check-status \
-H "X-Guru-Key: guru_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "order_id": "ORD_20261027_2147" }'
Automated Webhook System
Receive real-time payment notifications signed with your Webhook Secret Key.
| Parameter | Key Value |
|---|---|
| API Access Key | guru_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| Webhook Secret | whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
Webhook Receiver Handler (PHP)
webhook-receiver.php
<?php
$signature = $_SERVER['HTTP_X_GURUPAY_SIGNATURE'] ?? '';
$webhookSecret = "whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$payload = file_get_contents('php://input');
$expectedSignature = hash_hmac('sha256', $payload, $webhookSecret);
if (hash_equals($expectedSignature, $signature)) {
$eventData = json_decode($payload, true);
if (($eventData['event'] ?? '') === 'payment.success') {
$orderId = $eventData['order_id'];
$utr = $eventData['utr'];
$amount = $eventData['amount'];
// TODO: Fulfill order in DB
}
http_response_code(200);
echo json_encode(['status' => 'acknowledged']);
} else {
http_response_code(400);
echo "Invalid Signature";
}
?>
WHMCS Gateway
Accept automated UPI payments on WHMCS client billing.
Download WHMCS ZipBrowser Redirects
Query parameters appended on checkout redirect:
?status=success&order_id=ORD_20261027_2147&amount=100.00&utr=615372849102
AI Integration Prompt
Copy & paste this prompt into ChatGPT / Claude for single-file integration generation.
PROMPT FOR AI
Mujhe my app me GuruPay Payment Gateway single HTML file me integrate karna hai.
=== CREDENTIALS & API ===
API Key: guru_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Endpoint 1: POST https://gurupaygateway.com/api/create-order
Headers: X-Guru-Key: guru_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, Content-Type: application/json
Body: { "amount": "100.00", "order_id": "ORD_12345", "customer_name": "Name", "callback_url": "page.html" }
Endpoint 2: POST https://gurupaygateway.com/api/check-status
Headers: X-Guru-Key: guru_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, Content-Type: application/json
Body: { "order_id": "ORD_12345" }
Mujhe ek complete, working single HTML file code bana ke do.