Simple, Fast, Secure Payment Gateway Integration
All API requests require an API key. Just add it in the request headers:
X-API-Key: YOUR_API_KEY_HERE
Content-Type: application/json
Get your API key from Account Settings → API Keys
You can specify a redirect_url when creating a payment link. After payment verification, the customer will be redirected to that URL.
redirect_url in create payment requestManual UTR Verification - Customer needs to enter 12-16 digit UTR number
POST/api/create_payment.php
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer_id | string | Required | Unique customer identifier |
| amount | float | Required | Amount in INR (₹1 - ₹10,000) |
| customer_name | string | Optional | Customer name |
| product_name | string | Optional | Product name |
| service | string | Optional | Use "bharatpe" |
| redirect_url | string | Optional | NEW Custom redirect URL after payment success |
curl -X POST https://darkpay.site/api/create_payment.php \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "CUST_001",
"customer_name": "John Doe",
"amount": 500,
"service": "bharatpe",
"redirect_url": "https://yourwebsite.com/thank-you"
}'
{
"success": true,
"service": "bharatpe",
"order_id": "ORDABC123XYZ",
"payment_link": "https://darkpay.site/payment/pay.php?order=ORDABC123XYZ",
"qr_url": "https://quickchart.io/qr?text=...",
"qr_amount": 500.37,
"upi_id": "merchant@okhdfcbank",
"expires_in_minutes": 30,
"redirect_url": "https://yourwebsite.com/thank-you"
}
POST/api/verify_payment.php
Customer needs to enter the 12-16 digit UTR number from their bank statement or payment app.
| Parameter | Type | Required | Description |
|---|---|---|---|
| order_id | string | Required | Order ID from create response |
| utr | string | Required | 12-16 digit UTR number |
curl -X POST https://darkpay.site/api/verify_payment.php \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ORDABC123XYZ",
"utr": "123456789012"
}'
{
"success": true,
"message": "✅ Payment verified successfully!",
"payment_id": "PAY12345678",
"order_id": "ORDABC123XYZ",
"amount": 500,
"utr": "123456789012",
"redirect_url": "https://yourwebsite.com/thank-you"
}
{
"success": false,
"message": "❌ UTR not found in BharatPe records."
}
{
"success": false,
"message": "❌ This UTR has already been used!"
}
Auto Verification - One click verify, no UTR number needed!
POST/api/create_payment.php
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer_id | string | Required | Unique customer identifier |
| amount | float | Required | Amount in INR (₹1 - ₹10,000) |
| customer_name | string | Optional | Customer name |
| product_name | string | Optional | Product name |
| service | string | Optional | Use "paytm" |
| redirect_url | string | Optional | NEW Custom redirect URL after payment success |
curl -X POST https://darkpay.site/api/create_payment.php \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "CUST_002",
"customer_name": "Jane Doe",
"amount": 1000,
"service": "paytm",
"redirect_url": "https://yourwebsite.com/order-success"
}'
{
"success": true,
"service": "paytm",
"order_id": "ORDABC123XYZ",
"payment_link": "https://darkpay.site/payment/paytm_pay.php?order=ORDABC123XYZ",
"paytm_order_id": "PTM_ABC123XYZ",
"qr_url": "https://quickchart.io/qr?text=...",
"qr_amount": 1000.45,
"upi_id": "merchant@paytm",
"expires_in_minutes": 30,
"redirect_url": "https://yourwebsite.com/order-success"
}
paytm_order_id from response - you'll need it for verification.
POST/api/verify_paytm.php
No UTR number needed! Just provide the order_id and paytm_order_id.
curl -X POST https://darkpay.site/api/verify_paytm.php \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ORDABC123XYZ",
"paytm_order_id": "PTM_ABC123XYZ"
}'
{
"success": true,
"message": "✅ Payment verified successfully!",
"payment_id": "PAY12345678",
"order_id": "ORDABC123XYZ",
"amount": 1000,
"utr": "PAYTM_169884605251",
"redirect_url": "https://yourwebsite.com/order-success"
}
{
"success": false,
"message": "⏳ Payment pending. Please complete the payment first."
}
Auto Verification - One click verify, 5 minutes expiry only!
POST/api/create_payment.php
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer_id | string | Required | Unique customer identifier |
| amount | float | Required | Amount in INR (₹1 - ₹10,000) |
| customer_name | string | Optional | Customer name |
| product_name | string | Optional | Product name |
| service | string | Optional | Use "famapp" |
| redirect_url | string | Optional | NEW Custom redirect URL after payment success |
curl -X POST https://darkpay.site/api/create_payment.php \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "CUST_003",
"customer_name": "Mike Smith",
"amount": 250,
"service": "famapp",
"redirect_url": "https://yourwebsite.com/payment-complete"
}'
{
"success": true,
"service": "famapp",
"order_id": "ORDABC123XYZ",
"payment_link": "https://darkpay.site/payment/famapp_pay.php?order=ORDABC123XYZ",
"qr_url": "https://quickchart.io/qr?text=...",
"qr_amount": 250.78,
"upi_id": "merchant@fam",
"merchant_name": "Your Business Name",
"expires_in_minutes": 5,
"redirect_url": "https://yourwebsite.com/payment-complete"
}
POST/api/verify_famapp.php
No UTR number needed! Just provide the order_id.
curl -X POST https://darkpay.site/api/verify_famapp.php \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ORDABC123XYZ"
}'
{
"success": true,
"message": "✅ Payment verified successfully!",
"payment_id": "PAY12345678",
"order_id": "ORDABC123XYZ",
"amount": 250,
"utr": "FAM_169884605251",
"redirect_url": "https://yourwebsite.com/payment-complete"
}
{
"success": false,
"message": "⚠️ Payment failed: Order ID matched but amount mismatch."
}
GET/api/check_status.php?order_id={order_id}
curl "https://darkpay.site/api/check_status.php?order_id=ORDABC123XYZ" \
-H "X-API-Key: YOUR_API_KEY"
GET/api/get_stats.php
curl "https://darkpay.site/api/get_stats.php" \
-H "X-API-Key: YOUR_API_KEY"
// Create Payment with Redirect URL
fetch('https://darkpay.site/api/create_payment.php', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_id: 'CUST_001',
amount: 500,
service: 'bharatpe',
redirect_url: 'https://yourwebsite.com/thank-you'
})
})
.then(res => res.json())
.then(data => {
console.log('Order ID:', data.order_id);
console.log('Payment Link:', data.payment_link);
console.log('Redirect URL:', data.redirect_url);
});
import requests
# Create Payment with Redirect URL
response = requests.post(
'https://darkpay.site/api/create_payment.php',
headers={'X-API-Key': 'YOUR_API_KEY'},
json={
'customer_id': 'CUST_001',
'amount': 500,
'service': 'bharatpe',
'redirect_url': 'https://yourwebsite.com/thank-you'
}
)
data = response.json()
print(f"Order ID: {data['order_id']}")
print(f"Redirect URL: {data.get('redirect_url')}")
$ch = curl_init('https://darkpay.site/api/create_payment.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'customer_id' => 'CUST_001',
'amount' => 500,
'service' => 'bharatpe',
'redirect_url' => 'https://yourwebsite.com/thank-you'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "Order ID: " . $data['order_id'];
echo "Redirect URL: " . ($data['redirect_url'] ?? 'Not set');
| HTTP Status | Error Message | Solution |
|---|---|---|
| 401 | API Key required | Add X-API-Key header |
| 401 | Invalid API Key | Check your API key from dashboard |
| 400 | Amount must be between 1 and 10000 | Check amount range |
| 400 | Service not configured | Setup service in dashboard first |
| 400 | UTR already used | UTR already verified, use different UTR |
| 400 | Payment link expired | Create new payment link (30 min / 5 min for FamApp) |
| 400 | Invalid redirect_url format | Provide a valid URL (https://...) |
| 429 | Rate limit exceeded | Slow down requests (max 100/minute) |
| Feature | BharatPe | PayTM | FamApp |
|---|---|---|---|
| Verification Method | Manual UTR Entry | Auto (One Click) | Auto (One Click) |
| UTR Required? | ✅ Yes (12-16 digits) | ❌ No | ❌ No |
| Expiry Time | 30 minutes | 30 minutes | 5 minutes only! |
| WhatsApp Notification | ✅ Yes | ✅ Yes | ❌ No |
| Admin Approval Required | ❌ No | ❌ No | ✅ Yes |
| Redirect URL Support | ✅ Yes NEW | ✅ Yes NEW | ✅ Yes NEW |
"redirect_url": "https://your-site.com/thank-you" to automatically redirect customers after successful payment.