API Documentation

Simple, Fast, Secure Payment Gateway Integration

v3.1 BharatPe (Manual UTR) PayTM (Auto Verify) FamApp (Auto Verify - 5 min) Redirect URL NEW

Authentication (All Services)

Simple! Sirf API Key chahiye! No extra headers needed.

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

Keep your API key secure! Never expose it in client-side code.

Redirect URL Feature NEW

Automatic Redirect After Payment!
After successful payment, customer will be automatically redirected to your custom URL.

You can specify a redirect_url when creating a payment link. After payment verification, the customer will be redirected to that URL.

How it Works:
  1. You provide redirect_url in create payment request
  2. Customer pays and verifies payment
  3. System shows success message for 2 seconds
  4. Automatically redirects to your custom URL
Note: If no redirect_url is provided, customer stays on the success page.

BharatPe Integration

Manual UTR Verification - Customer needs to enter 12-16 digit UTR number

Manual UTR Entry 30 min expiry
How BharatPe Works: Customer pays via QR code, then enters the UTR number from their bank statement. Our system verifies the UTR with BharatPe API.
Create BharatPe Payment

POST/api/create_payment.php

Request Body
ParameterTypeRequiredDescription
customer_idstringRequiredUnique customer identifier
amountfloatRequiredAmount in INR (₹1 - ₹10,000)
customer_namestringOptionalCustomer name
product_namestringOptionalProduct name
servicestringOptionalUse "bharatpe"
redirect_urlstringOptionalNEW Custom redirect URL after payment success
Example Request (with redirect_url)
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"
  }'
Example Response
{
  "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"
}
Verify BharatPe Payment (Manual UTR)

POST/api/verify_payment.php

Customer needs to enter the 12-16 digit UTR number from their bank statement or payment app.

Request Body
ParameterTypeRequiredDescription
order_idstringRequiredOrder ID from create response
utrstringRequired12-16 digit UTR number
Example Request
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 Response
{
  "success": true,
  "message": "✅ Payment verified successfully!",
  "payment_id": "PAY12345678",
  "order_id": "ORDABC123XYZ",
  "amount": 500,
  "utr": "123456789012",
  "redirect_url": "https://yourwebsite.com/thank-you"
}
Error Responses
{
  "success": false,
  "message": "❌ UTR not found in BharatPe records."
}

{
  "success": false,
  "message": "❌ This UTR has already been used!"
}

PayTM Integration

Auto Verification - One click verify, no UTR number needed!

Auto Verify 30 min expiry
How PayTM Works: Customer pays via QR code, then clicks "Verify Payment" button. Our system automatically checks PayTM API - no UTR number needed!
Create PayTM Payment

POST/api/create_payment.php

Request Body
ParameterTypeRequiredDescription
customer_idstringRequiredUnique customer identifier
amountfloatRequiredAmount in INR (₹1 - ₹10,000)
customer_namestringOptionalCustomer name
product_namestringOptionalProduct name
servicestringOptionalUse "paytm"
redirect_urlstringOptionalNEW Custom redirect URL after payment success
Example Request (with redirect_url)
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"
  }'
Example Response
{
  "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"
}
Note: Save the paytm_order_id from response - you'll need it for verification.
Verify PayTM Payment (Auto Verify)

POST/api/verify_paytm.php

No UTR number needed! Just provide the order_id and paytm_order_id.

Example Request
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 Response
{
  "success": true,
  "message": "✅ Payment verified successfully!",
  "payment_id": "PAY12345678",
  "order_id": "ORDABC123XYZ",
  "amount": 1000,
  "utr": "PAYTM_169884605251",
  "redirect_url": "https://yourwebsite.com/order-success"
}
Pending Response
{
  "success": false,
  "message": "⏳ Payment pending. Please complete the payment first."
}

FamApp Integration

Auto Verification - One click verify, 5 minutes expiry only!

Auto Verify 5 min expiry
Important: FamApp payment links expire in 5 minutes only! Make sure your customer pays quickly.
How FamApp Works: Customer pays via QR code, then clicks "Verify Payment" button. Our system automatically checks FamApp API - no UTR number needed!
Create FamApp Payment

POST/api/create_payment.php

Request Body
ParameterTypeRequiredDescription
customer_idstringRequiredUnique customer identifier
amountfloatRequiredAmount in INR (₹1 - ₹10,000)
customer_namestringOptionalCustomer name
product_namestringOptionalProduct name
servicestringOptionalUse "famapp"
redirect_urlstringOptionalNEW Custom redirect URL after payment success
Example Request (with redirect_url)
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"
  }'
Example Response
{
  "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"
}
Verify FamApp Payment (Auto Verify)

POST/api/verify_famapp.php

No UTR number needed! Just provide the order_id.

Example Request
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 Response
{
  "success": true,
  "message": "✅ Payment verified successfully!",
  "payment_id": "PAY12345678",
  "order_id": "ORDABC123XYZ",
  "amount": 250,
  "utr": "FAM_169884605251",
  "redirect_url": "https://yourwebsite.com/payment-complete"
}
Amount Mismatch Response
{
  "success": false,
  "message": "⚠️ Payment failed: Order ID matched but amount mismatch."
}

Common Endpoints (All Services)

Check Payment Status

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 User Statistics

GET/api/get_stats.php

curl "https://darkpay.site/api/get_stats.php" \
  -H "X-API-Key: YOUR_API_KEY"

Code Examples

JavaScript (Website)
// 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);
});
Python
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')}")
PHP
$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');

Error Codes

HTTP StatusError MessageSolution
401API Key requiredAdd X-API-Key header
401Invalid API KeyCheck your API key from dashboard
400Amount must be between 1 and 10000Check amount range
400Service not configuredSetup service in dashboard first
400UTR already usedUTR already verified, use different UTR
400Payment link expiredCreate new payment link (30 min / 5 min for FamApp)
400Invalid redirect_url formatProvide a valid URL (https://...)
429Rate limit exceededSlow down requests (max 100/minute)

Service Comparison

FeatureBharatPePayTMFamApp
Verification MethodManual UTR EntryAuto (One Click)Auto (One Click)
UTR Required?✅ Yes (12-16 digits)❌ No❌ No
Expiry Time30 minutes30 minutes5 minutes only!
WhatsApp Notification✅ Yes✅ Yes❌ No
Admin Approval Required❌ No❌ No✅ Yes
Redirect URL Support✅ Yes NEW✅ Yes NEW✅ Yes NEW

Quick Summary

✅ What You Need:
  • API Key only
  • No extra headers
  • Simple JSON body
❌ What You DON'T Need:
  • No API Secret
  • No Timestamp
  • No Signature
  • No Nonce
Redirect URL Feature: Add "redirect_url": "https://your-site.com/thank-you" to automatically redirect customers after successful payment.