Wafi Telecom API Developer Documentation
/
API Documentation • v1.2

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.

Base URL https://top-up.wafitelecom.net Format JSON Auth Bearer Token Security IP Whitelist

Authentication

Every API request must include your access token. Requests are also protected by IP whitelisting.

HeaderValueRequired
AuthorizationBearer YOUR_ACCESS_TOKENYES
Acceptapplication/jsonYES
Content-Typeapplication/jsonPOST REQUESTS
🔐
Security: Keep your API token on your backend server. Do not expose it in a public frontend or mobile application.

Mobile Recharge

Send direct mobile credit to an Afghanistan mobile number.

POST /api/mobile-recharge Bearer Auth
Request body
JSON
{
  "mobile_number": "0791234567",
  "amount": 100
}
Code examples
cURL
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
  }'
PHP cURL
$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;
JavaScript
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.

POST /api/bundle-recharge Bearer Auth
Request parameters
ParameterTypeRequiredValidationDescription
mobile_numberstringYESmin:10, max:10Customer mobile number. Must contain exactly 10 characters.
bundle_idstringYESrequired, stringThe identifier of the bundle you want to activate.
Request body
JSON
{
  "mobile_number": "0791234567",
  "bundle_id": "300"
}
⚠️
Validation: mobile_number is required and must be a string with exactly 10 characters. bundle_id is also required and must be a string.
Code examples
cURL
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"
  }'
Laravel HTTP Client
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();
PHP cURL
$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;
JavaScript
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);
Validation error

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.

POST /api/recharge-status Bearer Auth
Request body
JSON
{
  "transaction_id": "com3123456782026"
}
Example response
JSON
{
  "success": true,
  "recharge_status": "pending"
}
Code examples
PHP cURL
$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);
JavaScript
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.

GET /api/balance Bearer Auth
Example response
JSON
{
  "success": true,
  "current_balance": 15000
}
Code examples
PHP cURL
$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);
JavaScript
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.

2xxRequest accepted or processed successfully.
401Authentication credentials are missing or not accepted.
403Access is not allowed, for example because of client/IP authorization.
422Laravel request validation failed.

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.

No documentation section matched your search.