PHPackages                             verifiedsms/verifiedsms-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. verifiedsms/verifiedsms-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

verifiedsms/verifiedsms-php
===========================

PHP SDK for VerifiedSMS API v2 — SMS gateway for Nepal

00PHP

Since Jun 7Pushed 2d agoCompare

[ Source](https://github.com/VerifiedSMS/sdk-php)[ Packagist](https://packagist.org/packages/verifiedsms/verifiedsms-php)[ RSS](/packages/verifiedsms-verifiedsms-php/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

VerifiedSMS PHP SDK
===================

[](#verifiedsms-php-sdk)

Installation
------------

[](#installation)

### Composer

[](#composer)

```
composer require verifiedsms/verifiedsms-php
```

### Manual

[](#manual)

Copy `src/VerifiedSMS.php` into your project and require it:

```
require_once 'path/to/VerifiedSMS.php';
```

Quick Start
-----------

[](#quick-start)

```
use VerifiedSMS\Client;

$client = new Client('YOUR_API_KEY');

// Send SMS
$result = $client->send('98XXXXXXXX', 'Your OTP is 123456');
echo $result->message_id; // UUID

// Check status
$status = $client->status($result->message_id);
echo $status->delivery_status; // pending, accepted, delivered, failed

// Check balance
$balance = $client->balance();
echo $balance->balance; // "100.00"
```

Configuration
-------------

[](#configuration)

```
$client = new Client('YOUR_API_KEY');

// Optional: custom base URL (for testing)
$client = new Client('YOUR_API_KEY', [
    'base_url' => 'https://your-testing-server.com/api/v2',
    'timeout'  => 30,
]);
```

Methods
-------

[](#methods)

### `send($destination, $message, $options = [])`

[](#senddestination-message-options--)

Send SMS to one or more numbers.

```
$result = $client->send('98XXXXXXXX,97798YYYYYYYY', 'Hello!', [
    'type'      => 1,        // 1=Normal, 2=Unicode (default: 1)
    'sensitive' => true,     // Don't store message content (default: false)
]);

// Response: SendResponse
//   ->message_id   (string)  UUID
//   ->sms_count    (int)     Number of segments
//   ->cost         (string)  Cost in Rs.
//   ->new_balance  (string)  Remaining balance
```

### `status($messageId)`

[](#statusmessageid)

Check delivery status.

```
$status = $client->status('a1b2c3d4-e5f6-7890-abcd-ef1234567890');

// Response: StatusResponse
//   ->message_id       (string)
//   ->destination      (string)
//   ->message          (string|null)  null if sensitive
//   ->status           (string)  sent, failed, pending
//   ->delivery_status  (string)  pending, accepted, delivered, failed
//   ->cost             (string)
//   ->created_at       (string)
//   ->accepted_at      (string|null)
//   ->delivered_at     (string|null)
```

### `balance()`

[](#balance)

Check account balance.

```
$balance = $client->balance();

// Response: BalanceResponse
//   ->balance  (string)  e.g. "100.00"
```

### `history($options = [])`

[](#historyoptions--)

Get SMS history with filters.

```
$history = $client->history([
    'page'      => 1,
    'limit'     => 25,
    'date_from' => '2026-06-01',
    'date_to'   => '2026-06-30',
    'status'    => 'sent',
    'search'    => '98',
]);

// Response: HistoryResponse
//   ->history     (array)  of HistoryItem
//   ->pagination  (array)  total, page, per_page, total_pages
```

### `validate($destination)`

[](#validatedestination)

Validate phone numbers.

```
$result = $client->validate('98XXXXXXXX,12345,abc');

// Response: ValidateResponse
//   ->valid    (array)  ["97798XXXXXXXX"]
//   ->invalid  (array)  ["12345", "abc"]
```

### `usage($period = 'daily')`

[](#usageperiod--daily)

Get usage statistics.

```
$usage = $client->usage('monthly');

// Response: UsageResponse
//   ->period      (string)
//   ->total_sms   (int)
//   ->total_cost  (string)
//   ->stats       (array)  of {date/month, sms_count, total_cost}
```

### `validateKey()`

[](#validatekey)

Check if API key is valid.

```
$result = $client->validateKey();

// Response: ValidateKeyResponse
//   ->balance  (string)
```

Error Handling
--------------

[](#error-handling)

```
use VerifiedSMS\Client;
use VerifiedSMS\Exceptions\*;

try {
    $result = $client->send('98XXXXXXXX', 'Hello');
} catch (InsufficientBalanceError $e) {
    echo "Need more credit: {$e->getMessage()}";
} catch (AuthenticationError $e) {
    echo "Bad API key: {$e->getMessage()}";
} catch (IPWhitelistError $e) {
    echo "IP not allowed: {$e->getMessage()}";
} catch (RateLimitError $e) {
    echo "Slow down: {$e->getMessage()}";
} catch (GatewayError $e) {
    echo "Gateway failed: {$e->getMessage()}";
} catch (VerifiedSMSException $e) {
    echo "API error: {$e->getMessage()}";
}
```

Webhook Verification
--------------------

[](#webhook-verification)

```
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_VERIFIEDSMS_SIGNATURE'] ?? '';

if (Client::verifyWebhook($payload, $signature, 'YOUR_WEBHOOK_SECRET')) {
    $data = json_decode($payload, true);
    // Process delivery update
    http_response_code(200);
    echo 'OK';
} else {
    http_response_code(401);
    echo 'Invalid signature';
}
```

Sensitive Mode
--------------

[](#sensitive-mode)

For OTPs and confidential messages:

```
$result = $client->send('98XXXXXXXX', 'Your OTP is 123456', [
    'sensitive' => true,
]);

// Message content is NOT stored on the server.
// You MUST store message_id yourself to check status later.
```

PHP 8.0+ Features
-----------------

[](#php-80-features)

If using PHP 8.0+, you can use named arguments:

```
$result = $client->send(
    destination: '98XXXXXXXX',
    message: 'Hello',
    options: ['type' => 2, 'sensitive' => true]
);
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/291005124?v=4)[verifiedsms](/maintainers/verifiedsms)[@VerifiedSMS](https://github.com/VerifiedSMS)

---

Top Contributors

[![nabinGhimire](https://avatars.githubusercontent.com/u/17213099?v=4)](https://github.com/nabinGhimire "nabinGhimire (3 commits)")

### Embed Badge

![Health badge](/badges/verifiedsms-verifiedsms-php/health.svg)

```
[![Health](https://phpackages.com/badges/verifiedsms-verifiedsms-php/health.svg)](https://phpackages.com/packages/verifiedsms-verifiedsms-php)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M79](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

13137.2M6.4k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k112](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M82](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
