Mobile Recharge API Documentation
Mobile recharge request করার জন্য এই API ব্যবহার করুন। API response থেকে recharge status, balance, commission এবং transaction ID পাওয়া যাবে।
Getting Started
Mobile Recharge API ব্যবহার করার জন্য user account create করে dashboard থেকে API Key এবং Secret Key সংগ্রহ করুন।
1. Account
Register করে account খুলুন।
2. API Key
API Keys page থেকে key নিন।
3. Operator
Customer number অনুযায়ী correct operator select করুন।
4. Submit
Phone, amount এবং operator দিয়ে recharge submit করুন।
POST method দিয়ে করতে হবে।
API Key এবং Secret Key server-side থেকে ব্যবহার করুন।
API Endpoint
action parameter লাগবে না।
Direct endpoint-এ POST request করবেন।
Authentication Parameters
| Parameter | Required | Description |
|---|---|---|
api_key |
Yes | User dashboard থেকে পাওয়া API Key। |
api_secret |
Yes | User dashboard থেকে পাওয়া Secret Key। |
Operator Codes
Recharge করার সময় operator parameter পাঠাতে হবে।
Grameenphone এবং Grameenphone Skitto আলাদা operator হিসেবে পাঠাতে হবে।
| Operator | Code | Number Prefix |
|---|---|---|
| Grameenphone | GP |
017, 013 |
| Grameenphone Skitto | GP ST |
017, 013 |
| Banglalink | BL |
019, 014 |
| Robi | RB |
018 |
| Airtel | AT |
016 |
| Teletalk | TT |
015 |
Submit Mobile Recharge
Customer phone number, amount, account type এবং operator দিয়ে recharge submit করুন।
Request Parameters
| Parameter | Required | Example | Description |
|---|---|---|---|
api_key |
Yes | YOUR_API_KEY | আপনার API Key। |
api_secret |
Yes | YOUR_SECRET_KEY | আপনার Secret Key। |
phone |
Yes | 017XXXXXXXX | Customer mobile number। |
amount |
Yes | 20 | Recharge amount। |
operator |
Yes | GP | Operator code। Skitto হলে GP STপাঠাবেন। |
account_type |
No | prepaid | Allowed: prepaid, postpaid. Default: prepaid |
cURL Example
curl -X POST "https://nurr.top/api/mobile-recharge.php" \ -d "api_key=YOUR_API_KEY" \ -d "api_secret=YOUR_SECRET_KEY" \ -d "phone=017XXXXXXXX" \ -d "amount=20" \ -d "operator=GP" \ -d "account_type=prepaid"
Skitto cURL Example
curl -X POST "https://nurr.top/api/mobile-recharge.php" \ -d "api_key=YOUR_API_KEY" \ -d "api_secret=YOUR_SECRET_KEY" \ -d "phone=017XXXXXXXX" \ -d "amount=20" \ -d "operator=GP ST" \ -d "account_type=prepaid"
PHP Example
$ch = curl_init("https://nurr.top/api/mobile-recharge.php");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => [
"api_key" => "YOUR_API_KEY",
"api_secret" => "YOUR_SECRET_KEY",
"phone" => "017XXXXXXXX",
"amount" => "20",
"operator" => "GP",
"account_type" => "prepaid"
],
CURLOPT_RETURNTRANSFER => true
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
Success & Failed Responses
Success Response
{
{
"success": true,
"full_name": "Customer Name",
"phone": "017XXXXXXXX",
"amount": "20.00",
"operator_name": "Grameenphone",
"commission_amount": "0.20",
"before_balance": "1000.00",
"after_balance": "980.20",
"operator_transaction_id": "TXN123456789",
"status": "Success",
"reward": {
"ok": true,
"points": {
"ok": true,
"message": "Points awarded successfully",
"points": 0.10,
"new_level_id": 1,
"new_level_key": "silver"
},
"cashback": {
"ok": true,
"message": "No eligible active offer found"
}
}
}
Skitto Success Response
{
{
"success": true,
"full_name": "Customer Name",
"phone": "017XXXXXXXX",
"amount": "20.00",
"operator_name": "Grameenphone Skitto",
"commission_amount": "0.20",
"before_balance": "1000.00",
"after_balance": "980.20",
"operator_transaction_id": "TXN123456789",
"status": "Success",
"reward": {
"ok": true,
"points": {
"ok": true,
"message": "Points awarded successfully",
"points": 0.10,
"new_level_id": 1,
"new_level_key": "silver"
},
"cashback": {
"ok": true,
"message": "No eligible active offer found"
}
}
}
Failed Response
{
"success": false,
"full_name": "Customer Name",
"phone": "017XXXXXXXX",
"amount": "20.00",
"operator_name": "Grameenphone",
"commission_amount": "0.00",
"before_balance": "1000.00",
"after_balance": "1000.00",
"operator_transaction_id": null,
"status": "Failed",
"failure_reason": "Something wrong please try again later."
}
Error Responses
| HTTP Code | Error | Meaning |
|---|---|---|
| 401 | Invalid API credentials. |
API Key বা Secret Key ভুল। |
| 422 | Missing required parameters. |
Required parameter missing। |
| 422 | Invalid account type. |
Account type ভুল। |
| 422 | Invalid operator. |
Operator code ভুল। |
| 422 | Invalid operator number for this recharge. |
Phone prefix এবং operator match করেনি। |
| 422 | Invalid recharge amount. |
Recharge amount limit এর বাইরে। |
| 422 | Insufficient balance. |
Account balance কম। |
| 500 | Transaction failed. |
Request process করা যায়নি। |
Error JSON Example
{
"error": "Invalid operator number for this recharge."
}
Invalid Operator Example
{
"error": "Invalid operator.",
"allowed_operator": [
"GP",
"GP ST",
"BL",
"RB",
"AT",
"TT"
]
}
Missing Parameters Example
{
"error": "Missing required parameters."
}
Insufficient Balance Example
{
"error": "Insufficient balance."
}