Official client for FarazSMS · IranPayamak (فراز اس ام اس · ایران پیامک) — https://farazsms.com. Send pattern/OTP, bulk SMS, reports, phonebook, and all 63 endpoints.

Maintainers

Package info

github.com/ghaffari273/farazsms-php

Homepage

Documentation

pkg:composer/farazsms/php

Statistics

Installs: 2

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-06-18 16:50 UTC

This package is not auto-updated.

Last update: 2026-06-19 14:57:28 UTC


README

FarazSMS · IranPayamak — فراز اس ام اس · ایران پیامک 🌐 farazsms.com · iranpayamak.com

Official PHP client for the FarazSMS / IranPayamak web services — send pattern/OTP, simple & bulk SMS, pull reports, manage your phonebook, and reach all 63 endpoints through a low-level request().

PHP 7.4+ · PSR-4 · throws on API errors.

Install

composer require farazsms/php

Quick start

<?php
require "vendor/autoload.php";

use FarazSMS\FarazSMS;
use FarazSMS\FarazException;

$sms = new FarazSMS("YOUR_API_KEY"); // key from the panel → Web Service / API Key

print_r($sms->balance());                                              // verify the key — free
$sms->sendPattern("SJ3FgPrE0C", "09120000000", ["code" => "1234"]);    // OTP (instant)
$sms->sendSimple("Hello!", ["09120000000", "09130000000"]);           // bulk
print_r($sms->inbox(1, 20));                                          // inbound replies

try {
    $sms->sendPattern("BAD", "09120000000", ["code" => "1"]);
} catch (FarazException $e) {
    echo $e->statusCode . " " . $e->getMessage();
}

Recipients use the local format 09120000000 (no +98). Default sender line 90008361.

Bundled helpers

Area Methods
Account balance() · profile() · lines()
Send sendPattern() · sendSimple() · sendVariable()
Patterns createPattern() · patterns()
Reports inbox() · sendRequests() · sendRequestItems()
Phonebook phonebooks() · addContact()
Reference provinces() · numberBanks()

Anything else (tickets, orders, voice, LBS, …) via request($method, $path, $body).

License

MIT