PHPackages                             walinko/sdk - 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. [API Development](/categories/api)
4. /
5. walinko/sdk

ActiveLibrary[API Development](/categories/api)

walinko/sdk
===========

Official PHP SDK for the Walinko public API.

v0.1.1(2mo ago)00MITPHPPHP &gt;=8.1

Since May 1Pushed 2mo agoCompare

[ Source](https://github.com/walinko/walinko-php)[ Packagist](https://packagist.org/packages/walinko/sdk)[ Docs](https://github.com/walinko/walinko-sdk)[ RSS](/packages/walinko-sdk/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (10)Versions (3)Used By (0)

walinko/sdk (PHP)
=================

[](#walinkosdk-php)

Official PHP client for the [Walinko](https://walinko.com) public API.

Send transactional WhatsApp messages from PHP with idempotent retries, structured errors, and a tiny dependency footprint (PSR-18 HTTP).

- PHP 8.1+
- PSR-18 HTTP, PSR-17 factories, PSR-3 logging — bring your own Guzzle/Symfony/whatever, or let `php-http/discovery` find one
- MIT licensed

Install
-------

[](#install)

```
composer require walinko/sdk
```

If your project doesn't already pull in a PSR-18 client (e.g. via Guzzle, Symfony HTTP Client, or `php-http/curl-client`), add one too:

```
composer require symfony/http-client nyholm/psr7
```

Quick start
-----------

[](#quick-start)

```
use Walinko\Client;

$client = new Client([
    'api_key'     => getenv('WALINKO_API_KEY'),
    'base_url'    => 'https://api.walinko.com', // optional
    'timeout'     => 30,                         // optional, seconds (used by waitUntilDone)
    'max_retries' => 2,                          // optional
    // 'http_client'     => $psr18Client,        // optional
    // 'request_factory' => $psr17Factory,       // optional
    // 'stream_factory'  => $psr17Factory,       // optional
    // 'logger'          => $psrLogger,          // optional
]);

// Sync send — blocks until the message is delivered (or 504 timeout).
$result = $client->messages->send([
    'device_id'     => 1,
    'template_id'   => 12,
    'variant_index' => 0,                                       // optional, null = primary
    'phone'         => '+8801617738431',
    'variables'     => ['name' => 'Kazi', 'dist' => 'Dhaka'],
]);

echo $result->trackingId;    // tx_...
echo $result->waMessageId;   // 3EB0...
echo $result->status;        // "sent"

// Async enqueue + poll.
$job = $client->messages->enqueue([
    'device_id'   => 1,
    'template_id' => 12,
    'phone'       => '+8801617738431',
    'variables'   => ['name' => 'Kazi', 'dist' => 'Dhaka'],
]);

$final = $client->messages->waitUntilDone($job->trackingId, timeout: 60);
echo $final->status;  // "sent" | "failed"
```

Looking up a delivery
---------------------

[](#looking-up-a-delivery)

```
$status = $client->messages->fetch('tx_767fd2faca0f4037b2a2bbcb91e5735f');

$status->isSent();        // bool
$status->errorCode;       // null if sent, e.g. "phone_not_on_whatsapp" on failure
$status->waMessageId;     // WhatsApp's id, set on success
$status->createdAt;       // DateTimeImmutable
$status->sentAt;          // DateTimeImmutable, null while pending
```

Errors
------

[](#errors)

Every exception extends `Walinko\Exception\WalinkoException`. See [`docs/error-codes.md`](../../docs/error-codes.md) for the full mapping.

```
use Walinko\Exception;

try {
    $client->messages->send([...]);
} catch (Exception\RateLimitException $e) {
    sleep($e->retryAfter ?? 1);
    // retry
} catch (Exception\ValidationException $e) {
    $logger->warning('validation failed', ['fields' => $e->fields()]);
} catch (Exception\DeviceDisconnectedException) {
    // tell the user to reconnect their device from the dashboard
} catch (Exception\WalinkoException $e) {
    $logger->error('Walinko send failed', ['error' => $e->getMessage()]);
}
```

Retries
-------

[](#retries)

The SDK auto-retries idempotently on:

TriggerBehaviourNetwork errorsExponential backoff with jitterHTTP 429Honours `Retry-After` (capped at 60s)HTTP 500/502/503/504Exponential backoff with jitter`max_retries` (default 2) controls how many additional attempts are made. 4xx responses (other than 429) are surfaced immediately — the request is malformed or the server has rejected it on application grounds, and no amount of retrying will help.

Idempotency
-----------

[](#idempotency)

The SDK auto-generates a UUID `Idempotency-Key` for every `send` / `enqueue` call so retries are safe end-to-end. Pass `idempotency_key`in the args to set your own (e.g. tying a send to your domain object). The same key is reused on every retry within a single call.

Rate limits
-----------

[](#rate-limits)

The server enforces 30 req/min/key (sliding window). The SDK exposes the latest known window state via:

```
$client->lastRateLimit();   // ?Walinko\Result\RateLimitSnapshot
$client->lastRequestId();   // ?string — handy for support tickets
```

Development
-----------

[](#development)

```
cd sdks/php
composer install
vendor/bin/phpunit
vendor/bin/phpstan analyse
vendor/bin/php-cs-fixer fix --dry-run --diff
```

License
-------

[](#license)

[MIT](../../LICENSE)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance84

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

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.

###  Release Activity

Cadence

Every ~3 days

Total

2

Last Release

81d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23295804?v=4)[Amimul Ehshan](/maintainers/amims71)[@amims71](https://github.com/amims71)

![](https://www.gravatar.com/avatar/0f66f16961b1545393284bcf8dd6ade0186b28f05b3a435b398f0ea9a505842d?d=identicon)[walinko](/maintainers/walinko)

---

Top Contributors

[![amims71](https://avatars.githubusercontent.com/u/23295804?v=4)](https://github.com/amims71 "amims71 (5 commits)")

---

Tags

apisdkmessagingwhatsappwalinko

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/walinko-sdk/health.svg)

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

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36789.4k2](/packages/telnyx-telnyx-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k28.0M326](/packages/openai-php-client)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M754](/packages/sylius-sylius)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M50](/packages/getbrevo-brevo-php)

PHPackages © 2026

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