ZubaSMS ZubaSMS
REST API v1.0 • Multi-Language

ZubaSMS Developer API

Integrate virtual numbers and automated SMS verification into any application. Full support for 150+ countries, live lowest service pricing, instant number purchasing, real-time SMS polling, and automated wallet refunds.

Preferred Code Language

Select your stack to switch code examples across all documentation sections:

STEP 01

Authentication & Clean Base URL

All API endpoints can be accessed using clean, extensionless URLs without you passing your API key via standard Bearer token authorization header, an X-API-KEY header, or as a query parameter.

Standard Clean Base URL:
https://zubasms.com/account/api/v1
Clean REST Routes Supported:
/account/api/v1/services • /countries • /buy
Ping Check (Verify API Connection)
curl -X GET "https://zubasms.com/account/api/v1/ping" \
  -H "Authorization: Bearer YOUR_API_KEY"
<?php
$apiKey = 'YOUR_API_KEY';
$ch = curl_init('https://zubasms.com/account/api/v1/ping');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey,
    'Accept: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
import requests

API_KEY = "YOUR_API_KEY"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.get("https://zubasms.com/account/api/v1/ping", headers=headers)
print(response.json())
const apiKey = 'YOUR_API_KEY';
fetch('https://zubasms.com/account/api/v1/ping', {
  headers: { 'Authorization': `Bearer ${apiKey}` }
})
  .then(res => res.json())
  .then(data => console.log(data));
package main
import (
    "fmt"
    "io/ioutil"
    "net/http"
)
func main() {
    client := &http.Client{}
    req, _ := http.NewRequest("GET", "https://zubasms.com/account/api/v1/ping", nil)
    req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
    resp, _ := client.Do(req)
    defer resp.Body.Close()
    body, _ := ioutil.ReadAll(resp.Body)
    fmt.Println(string(body))
}
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program {
    static async Task Main() {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
        var res = await client.GetStringAsync("https://zubasms.com/account/api/v1/ping");
        Console.WriteLine(res);
    }
}
Ping Success Response:
{
  "status": "ok",
  "success": true,
  "message": "API is active",
  "user_id": 12,
  "key_prefix": "zuba_2BEDB581",
  "rate_limit_per_minute": 60
}
STEP 02

Get Available Countries (151 Countries)

Retrieve all 151 supported countries worldwide with ISO 2-letter codes, numeric IDs, country names, and international calling codes. You can pass either the 2-letter ISO code ("US", "NG", "GB") or numeric ID ("1") when checking services or purchasing numbers.

curl -X GET "https://zubasms.com/account/api/v1/countries" \
  -H "Authorization: Bearer YOUR_API_KEY"
<?php
$apiKey = 'YOUR_API_KEY';
$ch = curl_init('https://zubasms.com/account/api/v1/countries');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $apiKey]);
$res = curl_exec($ch);
curl_close($ch);
$countries = json_decode($res, true)['data'] ?? [];
foreach ($countries as $c) {
    echo "{$c['name']} ({$c['code']}) - ID: {$c['id']}\n";
}
import requests

headers = {"Authorization": "Bearer YOUR_API_KEY"}
res = requests.get("https://zubasms.com/account/api/v1/countries", headers=headers)
countries = res.json().get("data", [])
print(f"Loaded {len(countries)} countries")
const res = await fetch('https://zubasms.com/account/api/v1/countries', {
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
const { data } = await res.json();
console.log(`Found ${data.length} countries`);
req, _ := http.NewRequest("GET", "https://zubasms.com/account/api/v1/countries", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
resp, _ := client.Do(req)
var res = await client.GetStringAsync("https://zubasms.com/account/api/v1/countries");
Countries Response Shape:
{
  "status": "success",
  "success": true,
  "count": 151,
  "data": [
    {
      "id": "1",
      "country_id": "1",
      "code": "US",
      "country_code": "US",
      "short_name": "US",
      "name": "United States",
      "country": "United States",
      "calling_code": "1",
      "region": "North America"
    },
    {
      "id": "18",
      "country_id": "18",
      "code": "NG",
      "country_code": "NG",
      "short_name": "NG",
      "name": "Nigeria",
      "country": "Nigeria",
      "calling_code": "234",
      "region": "Africa"
    }
  ]
}
STEP 03

Services & Lowest Available Prices

Fetch available services with their active lowest prices. You can query all global services, filter by country (?country=US), or query a particular service (?country=US&service=whatsapp).

Reliable Pricing Guarantee: Every service returned carries both price, cost, and cost_usd as valid positive floats. Even if an unconfigured service has no manual markup, it automatically resolves to its lowest wholesale rate.

A. Country Scoped Services (Recommended)

Pass country=US to fetch only services supported in that country:

Clean GET Request
curl -X GET "https://zubasms.com/account/api/v1/services?country=US" \
  -H "Authorization: Bearer YOUR_API_KEY"

B. Particular Service Lookup

Pass service=whatsapp to query a single service with live lowest pricing:

Single Service Filter
curl -X GET "https://zubasms.com/account/api/v1/services?country=US&service=whatsapp" \
  -H "Authorization: Bearer YOUR_API_KEY"
Services Response Shape (Always Includes key, name, price, cost):
{
  "status": "success",
  "success": true,
  "country": "US",
  "service": "whatsapp",
  "count": 1,
  "data": [
    {
      "service_code": "whatsapp",
      "code": "whatsapp",
      "key": "whatsapp",
      "service": "whatsapp",
      "service_id": "1012",
      "id": "1012",
      "service_label": "WhatsApp",
      "name": "WhatsApp",
      "price": 1.00,
      "cost": 1.00,
      "cost_usd": 1.00,
      "low_price": 1.00,
      "currency": "USD",
      "country": "US",
      "status": "active"
    }
  ]
}
STEP 04

Check Price for a Service

Retrieve the specific rate for any service before placing an order. Pass service (e.g. whatsapp, telegram, google) and optional country.

curl -X GET "https://zubasms.com/account/api/v1/price?service=whatsapp&country=US" \
  -H "Authorization: Bearer YOUR_API_KEY"
<?php
$apiKey = 'YOUR_API_KEY';
$url = 'https://zubasms.com/account/api/v1/price?service=whatsapp&country=US';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $apiKey]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);
$price = $res['price'] ?? $res['cost'] ?? 0.0;
echo "Price: $" . number_format($price, 2);
import requests

headers = {"Authorization": "Bearer YOUR_API_KEY"}
res = requests.get("https://zubasms.com/account/api/v1/price", params={"service": "whatsapp", "country": "US"}, headers=headers)
price = res.json().get("price", 0.0)
print(f"WhatsApp US Price: ${price}")
const res = await fetch('https://zubasms.com/account/api/v1/price?service=whatsapp&country=US', {
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
const data = await res.json();
console.log(`WhatsApp Price: $${data.price}`);
req, _ := http.NewRequest("GET", "https://zubasms.com/account/api/v1/price?service=whatsapp&country=US", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
var res = await client.GetStringAsync("https://zubasms.com/account/api/v1/price?service=whatsapp&country=US");
Price Response Shape:
{
  "status": "success",
  "success": true,
  "service": "whatsapp",
  "service_label": "WhatsApp",
  "name": "WhatsApp",
  "price": 1.00,
  "cost": 1.00,
  "cost_usd": 1.00,
  "low_price": 1.00,
  "country": "US",
  "currency": "USD"
}
STEP 05

Buy Virtual Number

Purchase a virtual number for a specified service and country. Both JSON POST bodies and standard form fields are supported.

curl -X POST "https://zubasms.com/account/api/v1/buy" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "country": "US",
    "service": "whatsapp"
  }'
<?php
$apiKey = 'YOUR_API_KEY';
$payload = json_encode([
    'country' => 'US',
    'service' => 'whatsapp'
]);

$ch = curl_init('https://zubasms.com/account/api/v1/buy');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey,
    'Content-Type: application/json'
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);

$orderId = $res['order_id'] ?? $res['id'] ?? null;
$phone   = $res['number'] ?? $res['phone'] ?? null;
echo "Purchased Order: {$orderId} | Number: {$phone}";
import requests

headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {"country": "US", "service": "whatsapp"}
res = requests.post("https://zubasms.com/account/api/v1/buy", json=payload, headers=headers)
order = res.json()
print(f"Order ID: {order.get('order_id')} | Number: {order.get('number')}")
const res = await fetch('https://zubasms.com/account/api/v1/buy', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ country: 'US', service: 'whatsapp' })
});
const data = await res.json();
console.log(`Order ID: ${data.order_id}, Phone: ${data.number}`);
payload := strings.NewReader(`{"country":"US","service":"whatsapp"}`)
req, _ := http.NewRequest("POST", "https://zubasms.com/account/api/v1/buy", payload)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
var content = new StringContent("{\"country\":\"US\",\"service\":\"whatsapp\"}", Encoding.UTF8, "application/json");
var res = await client.PostAsync("https://zubasms.com/account/api/v1/buy", content);
Buy Order Success Response:
{
  "status": "waiting",
  "success": true,
  "message": "Number purchase started successfully",
  "order_id": 1084,
  "id": 1084,
  "number": "+12025550192",
  "phone": "+12025550192",
  "service": "whatsapp",
  "country": "US",
  "price": 1.00,
  "cost": 1.00,
  "currency": "USD"
}
STEP 06

Poll SMS Status (Check Verification Code)

Poll this endpoint every 3 to 5 seconds after purchasing a number until the SMS code arrives. If the SMS has arrived, status changes to "completed" and returns the code.

curl -X POST "https://zubasms.com/account/api/v1/status" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"order_id": 1084}'
<?php
$apiKey = 'YOUR_API_KEY';
$orderId = 1084;

$ch = curl_init('https://zubasms.com/account/api/v1/status');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['order_id' => $orderId]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey,
    'Content-Type: application/json'
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);

if (($res['status'] ?? '') === 'completed' && !empty($res['code'])) {
    echo "SMS Code Received: " . $res['code'];
} else {
    echo "Still waiting for SMS...";
}
import requests, time

headers = {"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}
order_id = 1084

for _ in range(20):
    res = requests.post("https://zubasms.com/account/api/v1/status", json={"order_id": order_id}, headers=headers).json()
    if res.get("status") == "completed" and res.get("code"):
        print(f"Verification Code: {res['code']}")
        break
    time.sleep(4)
const res = await fetch('https://zubasms.com/account/api/v1/status', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ order_id: 1084 })
});
const data = await res.json();
if (data.status === 'completed') {
  console.log(`Received Code: ${data.code}`);
}
While Waiting:
{
  "status": "waiting",
  "success": false,
  "code": null,
  "message": "No code yet; order is still active."
}
SMS Received (Success):
{
  "status": "completed",
  "success": true,
  "code": "489201",
  "sms_code": "489201",
  "message": "SMS code received successfully."
}
STEP 07

Cancel Order & Instant Wallet Refund

If no SMS arrives within your waiting window, call this endpoint to cancel the number. The order is cancelled upstream and the charged amount is refunded instantly back to your ZubaSMS wallet balance.

Clean POST Request
curl -X POST "https://zubasms.com/account/api/v1/cancel" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"order_id": 1084}'
Cancel & Refund Success Response:
{
  "status": "cancelled",
  "success": true,
  "cancelled": true,
  "refunded": true,
  "message": "Number canceled and wallet refunded",
  "order_id": 1084,
  "refund_amount": 1.00,
  "new_balance": 48.50
}