API Documentation
Home / API Documentation
Home / API Documentation
https://rukkyhub.com/api/v1
X-API-KEY: YOUR_API_KEY
key=YOUR_API_KEY
| Action | Description | Required Fields |
|---|---|---|
| services | List all services | key, action |
| add | Place a new order | key, action, service, link, quantity |
| add_bulk | Place multiple orders in one request | key, action, orders[] |
| status | Get order status | key, action, order |
| balance | Get account balance | key, action |
| vtu_data_plans | List VTU data plans | key, action, service_id |
| vtu_sme_plans | List VTU SME plans | key, action, network |
| vtu_cable_plans | List VTU cable plans | key, action, service_id |
| vtu_electric_discos | List VTU electricity discos | key, action |
| vtu_cable_verify | Verify cable smartcard | key, action, service_id, customer_id |
| vtu_electricity_verify | Verify electricity meter | key, action, service_name, meter_type, meter_number |
| vtu_airtime | Buy airtime | key, action, service_name, phone, amount, pin |
| vtu_data | Buy data | key, action, plan_id, phone, pin |
| vtu_sme | Buy SME data | key, action, plan_id, phone, pin |
| vtu_cable | Subscribe cable | key, action, plan_id, customer_id, phone, pin |
| vtu_electricity | Buy electricity | key, action, service_name, meter_type, meter_number, phone, amount, pin |
| vtu_education | Buy education pin (WAEC) | key, action, phone, amount, pin |
| vtu_recharge_card | Print recharge card | key, action, card_network, value, quantity, pin |
| vtu_status | Get VTU transaction status | key, action, trx |
curl -X POST "https://rukkyhub.com/api/v1" -H "X-API-KEY: YOUR_API_KEY" -d "action=services"
curl -X POST "https://rukkyhub.com/api/v1" -H "X-API-KEY: YOUR_API_KEY" -H "X-API-ORIGIN: https://example.com" -d "action=services"
curl -X POST "https://rukkyhub.com/api/v1" -H "X-API-KEY: YOUR_API_KEY" -d "action=add&service=123&link=https://example.com&quantity=1000"
curl -X POST "https://rukkyhub.com/api/v1" -H "X-API-KEY: YOUR_API_KEY" -d 'action=add_bulk&orders=[{"service":123,"link":"https://example.com","quantity":1000},{"service":124,"link":"https://example.com/2","quantity":500}]'curl -X POST "https://rukkyhub.com/api/v1" -H "X-API-KEY: YOUR_API_KEY" -d "action=status&order=4488"
curl -X POST "https://rukkyhub.com/api/v1" -H "X-API-KEY: YOUR_API_KEY" -d "action=balance"
curl -X POST "https://rukkyhub.com/api/v1" -H "X-API-KEY: YOUR_API_KEY" -d "action=vtu_data_plans&service_id=mtn-data"
curl -X POST "https://rukkyhub.com/api/v1" -H "X-API-KEY: YOUR_API_KEY" -d "action=vtu_data&plan_id=1&phone=08012345678&pin=1234"
curl -X POST "https://rukkyhub.com/api/v1" -H "X-API-KEY: YOUR_API_KEY" -d "action=vtu_status&trx=XXXX"
https://rukkyhub.com/assets/php_api_example.txt
<script>
fetch("https://rukkyhub.com/api/v1", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: "action=services&key=YOUR_API_KEY"
}).then(r => r.json()).then(console.log);
</script><?php
$apiUrl = "https://rukkyhub.com/api/v1";
$apiKey = getenv("SMM_API_KEY");
$apiOrigin = getenv("SMM_API_ORIGIN");
$ch = curl_init($apiUrl);
$headers = [
"X-API-KEY: {$apiKey}",
"Accept: application/json",
];
if (!empty($apiOrigin)) {
$headers[] = "X-API-ORIGIN: {$apiOrigin}";
}
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query(["action" => "services"]),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_TIMEOUT => 20,
CURLOPT_HTTPHEADER => $headers,
]);
$raw = curl_exec($ch);
$http = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($raw === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
$data = json_decode($raw, true);
if (!is_array($data)) { throw new Exception("Invalid JSON"); }
if ($http >= 400 || isset($data["error"]) || isset($data["errors"])) { throw new Exception($raw); }
print_r($data);const apiUrl = "https://rukkyhub.com/api/v1";
const apiKey = process.env.SMM_API_KEY;
const params = new URLSearchParams({ action: "services" });
const res = await fetch(apiUrl, {
method: "POST",
headers: {
"X-API-KEY": apiKey,
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "application/json"
},
body: params
});
const data = await res.json();
if (!res.ok || data.error || data.errors) throw new Error(JSON.stringify(data));
console.log(data);{
"status": "success|failed|processing|pending",
"category": "data|sme|airtime|cable|electricity|education|recharge_card",
"trx": "TRX_STRING",
"provider_ref": "REFERENCE_IF_ANY",
"amount": "123.45",
"balance": "1000.00",
"currency": "NGN",
"message": "optional error/success message",
"cards": [ { "pin": "...", "serial": "..." } ]
}X-Webhook-Event: vtu.success X-Webhook-Signature: <hmac_sha256(payload_json, webhook_secret)>
vtu.status_changed vtu.processing vtu.success vtu.failed order.created order.status_changed order.refunded deposit.success withdraw.approved
{
"event": "vtu.success",
"occurred_at": "2026-04-05T12:00:00Z",
"vtu": {
"id": 1,
"trx": "TRX_STRING",
"category": "data",
"service_name": "mtn-data",
"phone": "08012345678",
"amount": 123.45,
"base_amount": 120.00,
"profit_amount": 3.45,
"provider": "strowallet",
"provider_ref": "ABC123",
"status": "success",
"meta": {},
"created_at": "2026-04-05T12:00:00Z",
"updated_at": "2026-04-05T12:00:05Z"
}
}<?php
// Example webhook receiver (plain PHP)
$secret = getenv("SMM_WEBHOOK_SECRET");
$payload = file_get_contents("php://input");
$signature = $_SERVER["HTTP_X_WEBHOOK_SIGNATURE"] ?? "";
$expected = hash_hmac("sha256", $payload, $secret);
if (!hash_equals($expected, $signature)) {
http_response_code(401);
exit("Invalid signature");
}
http_response_code(200);
echo "OK";
// Process the JSON asynchronously (queue/job) to avoid timeouts.import crypto from "crypto";
import express from "express";
const app = express();
app.post("/webhook", express.raw({ type: "*/*" }), (req, res) => {
const secret = process.env.SMM_WEBHOOK_SECRET;
const payload = req.body.toString("utf8");
const signature = req.header("X-Webhook-Signature") || "";
const expected = crypto.createHmac("sha256", secret).update(payload).digest("hex");
if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature))) {
return res.status(401).send("Invalid signature");
}
return res.status(200).send("OK");
});