Mobile Recharge & Activation Bundles API
Integrate Wafi Telecom services into your fintech app, wallet, POS, telecom platform or backend using a secure REST API with Bearer authentication and IP whitelisting.
POST /api/mobile-recharge
POST /api/bundle-recharge
POST /api/recharge-status
GET /api/balance
Authentication
Every API request must include your access token. Requests are also protected by IP whitelisting.
| Header | Value | Required |
|---|---|---|
Authorization | Bearer YOUR_ACCESS_TOKEN | YES |
Accept | application/json | YES |
Content-Type | application/json | POST REQUESTS |
Mobile Recharge
Send direct mobile credit to an Afghanistan mobile number.
{
"mobile_number": "0791234567",
"amount": 100
}
curl --request POST \
--url https://top-up.wafitelecom.net/api/mobile-recharge \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"mobile_number": "0791234567",
"amount": 100
}'$ch = curl_init("https://top-up.wafitelecom.net/api/mobile-recharge");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Accept: application/json",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"mobile_number" => "0791234567",
"amount" => 100,
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;fetch("https://top-up.wafitelecom.net/api/mobile-recharge", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
mobile_number: "0791234567",
amount: 100
})
})
.then(response => response.json())
.then(console.log);Activate Bundle
Activate an internet, voice or other supported bundle using its bundle_id.
| Parameter | Type | Required | Validation | Description |
|---|---|---|---|---|
mobile_number | string | YES | min:10, max:10 | Customer mobile number. Must contain exactly 10 characters. |
bundle_id | string | YES | required, string | The identifier of the bundle you want to activate. |
{
"mobile_number": "0791234567",
"bundle_id": "300"
}
mobile_number is required and must be a string with exactly 10 characters. bundle_id is also required and must be a string.curl --request POST \
--url https://top-up.wafitelecom.net/api/bundle-recharge \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"mobile_number": "0791234567",
"bundle_id": "300"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken('YOUR_ACCESS_TOKEN')
->acceptJson()
->post('https://top-up.wafitelecom.net/api/bundle-recharge', [
'mobile_number' => '0791234567',
'bundle_id' => '300',
]);
$statusCode = $response->status();
$data = $response->json();$ch = curl_init("https://top-up.wafitelecom.net/api/bundle-recharge");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Accept: application/json",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"mobile_number" => "0791234567",
"bundle_id" => "300",
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;fetch("https://top-up.wafitelecom.net/api/bundle-recharge", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
mobile_number: "0791234567",
bundle_id: "300"
})
})
.then(response => response.json())
.then(console.log);Because this endpoint uses Laravel request validation, invalid or missing input is normally returned as an HTTP 422 validation response when the client requests JSON.
Recharge Status
Check the latest known status for a recharge transaction.
{
"transaction_id": "com3123456782026"
}{
"success": true,
"recharge_status": "pending"
}$ch = curl_init("https://top-up.wafitelecom.net/api/recharge-status");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"transaction_id" => "com3123456782026"
]));
$response = curl_exec($ch);
curl_close($ch);fetch("https://top-up.wafitelecom.net/api/recharge-status", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
transaction_id: "com3123456782026"
})
})
.then(res => res.json())
.then(console.log);Check Balance
Retrieve the current API account balance.
{
"success": true,
"current_balance": 15000
}$ch = curl_init("https://top-up.wafitelecom.net/api/balance");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Accept: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);fetch("https://top-up.wafitelecom.net/api/balance", {
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Accept": "application/json"
}
})
.then(res => res.json())
.then(console.log);HTTP Status Reference
Useful statuses to handle in your integration. Actual endpoint responses depend on server-side processing.
Integration Tips
Practical recommendations for a reliable implementation.
Keep credentials server-side
Call the API from your backend whenever possible so the Bearer token is not bundled into a public client.
Validate before sending
For bundle activation, verify the mobile number is exactly 10 characters and the bundle ID is present before calling the API.
Check HTTP status
Read both the HTTP status code and JSON body, especially for validation, authorization and transaction processing errors.
Store transaction references
When your recharge response returns a transaction reference, save it so your system can query the recharge status endpoint later.