🏠 Home ℹ️ About Us
📩 Contact Us 🔔 Notice
🔑 Log In 📝 Free Sign Up
HomeCheck SMS Balance (PHP)

🐘 Check SMS Balance (PHP)

Retrieve your iSMS SMS credit balance programmatically using PHP and the iSMS balance API.

PHP · cURLHTTPS GETv2.1
API Endpoint

Check SMS Balance via JSON POST

Post your credentials as JSON to retrieve the current credit balance. Available for prepaid accounts only — postpaid accounts receive an INVALID ACCOUNT TYPE response.

HTTPS POST Endpoint · application/json
https://www.isms.com.my/isms_balance_json.php
PHP Code Example
PHP · cURL JSON POST
<?php

$payload = [
    "un"  => "myusername",
    "pwd" => "mypassword",
];

$ch = curl_init("https://www.isms.com.my/isms_balance_json.php");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => ["Content-Type: application/json"],
    CURLOPT_POSTFIELDS     => json_encode($payload),
    CURLOPT_TIMEOUT        => 15,
]);

$raw = curl_exec($ch);
$err = curl_error($ch);
curl_close($ch);

if ($err) {
    echo 'Connection error: ' . $err;
    exit;
}

$res = json_decode($raw, true);

if (($res['status'] ?? '') === 'success') {
    echo 'SMS Credits Remaining: ' . $res['balance'];
} else {
    // e.g. -1001 = AUTHENTICATION FAILED
    echo 'Error: ' . $res['message'];
}
✅ Success
{ "status": "success", "code": 0,
  "username": "myusername",
  "balance": "1500" }
❌ Error
{ "status": "error", "code": -1001,
  "message": "-1001 = AUTHENTICATION FAILED" }
⚠️
IP whitelist required. Every API request must originate from a whitelisted server IP. Email support@mobiweb.com.my to whitelist your IP before your first call — non-whitelisted requests are rejected with -1003.
ℹ️
You will also need to register a free iSMS account and purchase SMS credits. Full parameters, response codes and delivery callbacks are in the SMS API documentation.

Need Help Getting Started?

Contact our team — we reply within 1 business day.

📱 SMS Coverage — Every Country We Reach Jump to a country's rate by first letter

A B C D E F G H I J K L M N O P Q R S T U V Y Z