Connect your website to RankHostZone Pay in minutes. Base URL:
https://payment.rankhostzone.in/api/v1
payment_url โ redirect your customer there.Send two headers on every request. The signature proves the request came from you: it is the HMAC-SHA256 of the raw request body, using your API secret as the key.
| Header | Description |
|---|---|
X-API-Key | Your public API key (from dashboard โ API Keys) |
X-Signature | Hex HMAC-SHA256(raw body, API secret) |
// PHP โ building the signature
// POST: hash of the JSON body you send
$signature = hash_hmac('sha256', $requestBody, $YOUR_API_SECRET);
// GET : hash of the empty string
$signature = hash_hmac('sha256', '', $YOUR_API_SECRET);
POST /api/v1/create-order
| Field | Type | Required | Description |
|---|---|---|---|
| amount | number | yes | Amount in INR, e.g. 199.50 |
| customer_email | string | yes | Customer email address |
| customer_phone | string | yes | 10-digit Indian mobile number |
| customer_name | string | no | Customer name |
| client_order_id | string | no | Your reference id (max 64 chars) |
| description | string | no | What the customer is paying for |
| webhook_url | string | no | Receive payment events here (defaults to the one saved in your profile) |
| return_url | string | no | Send the customer back here after paying |
// Request (PHP)
$body = json_encode([
'amount' => 199.00,
'customer_email' => 'buyer@example.com',
'customer_phone' => '9876543210',
'customer_name' => 'Rahul Sharma',
'client_order_id' => 'INV-1001',
'description' => 'Premium Plan - Monthly',
]);
$ch = curl_init('https://payment.rankhostzone.in/api/v1/create-order');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: ' . $YOUR_API_KEY,
'X-Signature: ' . hash_hmac('sha256', $body, $YOUR_API_SECRET),
],
]);
$res = json_decode(curl_exec($ch), true);
// >> redirect the customer >>
header('Location: ' . $res['payment_url']);
// Response
{
"status": "success",
"order_id": "RZ20260813125433999901",
"client_order_id": "INV-1001",
"amount": 199.00,
"currency": "INR",
"payment_url": "https://payment.rankhostzone.in/checkout.php?token=8f3a9b2c...",
"expires_at": "2026-08-13 12:55:04"
}
GET /api/v1/verify-payment?order_id=RZ...
Same headers as above โ the signature is HMAC-SHA256 of an empty string for GET requests.
// Response
{
"status": "success",
"data": {
"order_id": "RZ20260813125433999901",
"client_order_id": "INV-1001",
"amount": 199.00,
"fee": 3.98,
"status": "paid",
"payment_method": "upi",
"paid_at": "2026-08-13 12:55:04"
}
}
GET /api/v1/balance โ signed with an empty body.
{
"status": "success",
"data": {
"balance": 1250.00,
"currency": "INR"
}
}
We POST to your webhook_url whenever a payment is paid or failed.
Verify the signature the same way you sign requests: HMAC-SHA256 of the raw body with your API secret.
// Webhook payload
{
"event": "payment.paid",
"order_id": "RZ20260813125433999901",
"client_order_id": "INV-1001",
"amount": 199.00,
"currency": "INR",
"status": "paid",
"payment_method": "upi",
"paid_at": "2026-08-13 12:55:04",
"timestamp": 1786614904
}
Respond with HTTP 200 within 10 seconds. If the payment succeeded, our webhook is the signal to fulfil the order. Never rely on the checkout redirect alone.
| HTTP | Code | Meaning |
|---|---|---|
| 400 | validation_error | Missing/invalid fields (see message) |
| 401 | unauthorized | Invalid API key or signature |
| 403 | account_inactive | Your merchant account is pending or suspended |
| 409 | duplicate_order | An order with this order_id already exists |
| 404 | not_found | Order not found |
| 500 | gateway_error | Upstream payment provider error โ contact support |
Every successful payment is credited to your dashboard balance (after the 2% fee). From the Withdraw page you can request a payout to any UPI ID or Indian bank account. Payouts are processed by the RankHostZone Pay team โ typically within 24 hours on working days.