Integrations
Two ready-made ways in. Both talk to the same API, so anything you can do with one you can do with a plain HTTP request.
PHP SDK
v1.0.0 · PHP 8.1+ · MITA typed client with retries, typed errors and webhook verification. Laravel support is discovered automatically.
Install
The package is served from here rather than Packagist, so add the repository once. Run
this inside an existing project — the config command needs a composer.json
to write to.
composer config repositories.chatvendor composer https://chatvendor.net
composer require chatvendor/sms-gateway
Or add it to composer.json by hand:
{
"repositories": [
{ "type": "composer", "url": "https://chatvendor.net" }
]
}
Use
use ChatVendor\Client;
$sms = new Client(getenv('CHATVENDOR_KEY'));
$message = $sms->send('+998901234567', 'Your code is 483921', [
'idempotency_key' => 'order-1234-otp',
'expires_in' => 300,
]);
$message->status; // queued
$message->isPending();
Laravel
# .env
CHATVENDOR_KEY=sms_live_xxxxxxxxxxxx
# anywhere
public function __construct(private \ChatVendor\Client $sms) {}
$this->sms->send($order->phone, "Order {$order->id} is ready", [
'idempotency_key' => "order-{$order->id}-ready",
]);
Verifying a webhook
use ChatVendor\Webhook;
// Throws unless the signature verifies — there is no path where you
// act on unverified data by accident.
$event = Webhook::parse(
$request->getContent(), // raw body, not the parsed array
$request->header('X-SMS-Signature', ''),
config('chatvendor.webhook_secret'),
);
Download the archive
17 KB · only needed if you install by hand
sha256 9a83d8edc5171633d57aca059b0179ca4616131f06238d7347112d455f3ce0b6
WordPress plugin
v1.0.0 · WP 6.0+ · GPL-2.0Text customers when a WooCommerce order changes status, text yourself when one arrives, or send from your own code with one function call.
No Composer, no bundled libraries. A plugin that ships its own copy of a HTTP client eventually collides with another plugin's copy, and the site owner gets a fatal error they cannot diagnose — so this uses the WordPress HTTP API and nothing else.
chatvendor-sms 1.0.0
13 KB · upload under Plugins → Add New → Upload
sha256 4168c5064778508ba9334c5b551976631720f2606aa66a62e77dd64ec48db271
Setting it up
- 01 Upload the zip under Plugins → Add New → Upload Plugin, and activate it.
- 02 Open Settings → ChatVendor SMS.
- 03 Paste an API key from your dashboard. The page then shows whether a phone is online.
- 04 Send a test message to confirm it works before switching order notifications on.
Sending from your own code
chatvendor_send_sms(
'+998901234567',
'Your code is 483921',
array( 'idempotency_key' => 'order-' . $order_id )
);
WooCommerce placeholders
| {order_number} | Order number |
| {status} | The status it just moved into |
| {total} | Order total |
| {first_name} | Billing first name |
| {site} | Your site name |
Two things that apply to both
Send an idempotency key
Without one, a request that times out and gets retried delivers a second SMS. Both
integrations accept idempotency_key; use a reference
you already have, like an order id. For an OTP or a payment confirmation this is
the difference between a working integration and a support ticket.
Test without spending credit
An sms_test_ key runs the whole flow — queued,
assigned, sent, webhooks fired — without touching a SIM. Use one on staging so
integration work never messages a real person by accident.
Neither library is required. The API is plain HTTP and JSON, and works from anything.