Official PHP SDK for the ShelfWatch APIs v2
v0.1.0 2026-08-03 17:35 UTC
This package is not auto-updated.
Last update: 2026-08-03 17:38:51 UTC
Official PHP client for ShelfWatch APIs v2.
composer require shelfwatch/shelfwatch
Requires PHP 8.1 or newer.
Quick startCreate credentials in ShelfWatch Console → Integrations, then:
<?php use ShelfWatch\ShelfWatch; $client = new ShelfWatch([ 'api_key' => 'swpk_…', 'project_id' => 'PROJECT_UUID', ]); $visits = $client->visits->list([ 'start_date' => '2026-07-01', 'end_date' => '2026-07-31', ]); print_r($visits['data']); $detail = $client->visits->get($visits['data'][0]['visit_uuid'], [ 'include_kpis' => true, ]);OAuth client credentials
$client = new ShelfWatch([ 'client_id' => 'swoc_…', 'client_secret' => 'swocs_…', 'project_id' => 'PROJECT_UUID', ]); // Access tokens are fetched and refreshed automatically.API coverage
| Resource | Methods |
|---|---|
$client->visits |
list, get |
$client->mdm |
stores, users, categories, brands, skus, schedules |
$client->reports |
list, generate |
Filters that accept multiple values can be passed as a comma-separated string or an array:
$client->visits->list([ 'start_date' => '2026-07-01', 'end_date' => '2026-07-31', 'visit_status' => ['completed'], 'store_code' => ['S001', 'S002'], ]); $stores = $client->mdm->stores(['q' => 'delhi']); $reports = $client->reports->list(); $rows = $client->reports->generate('visit-level', [ 'start_date' => '2026-07-01', 'end_date' => '2026-07-07', ]);
Full HTTP reference: ShelfWatch Console → Help and Support, or the apis-v2 docs.
ErrorsTyped exceptions map to HTTP status codes:
| Exception | Status |
|---|---|
ValidationError |
400 |
AuthenticationError |
401 |
ForbiddenError |
403 |
NotFoundError |
404 |
RateLimitError |
429 |
ServerError |
5xx |
ShelfWatchError |
other |
use ShelfWatch\Exceptions\NotFoundError; use ShelfWatch\ShelfWatch; try { $client->visits->get('missing-uuid'); } catch (NotFoundError $e) { echo $e->statusCode, ' ', $e->getMessage(), PHP_EOL; }Development
composer install
composer test
Publish to PackagistTag a release and push; Packagist (or ./scripts/publish.sh) will pick up the tagged version after the GitHub repository is linked.
Bump version in composer.json and ShelfWatch::VERSION / User-Agent before each release.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | byteplus_sdk/byteplus-php-sdk-v2 | 0 | 10 | 03-08-2026 |
| 2 | djeventplannerhub/djep-php-sdk | 0 | 18.33 | 03-08-2026 |
| 3 | jcolombo/optmyzr-api-php | 0 | 13.61 | 03-08-2026 |
| 4 | risetechapps/api-key-for-laravel | 0 | 100 | 03-08-2026 |
| 5 | snowman/ai | 0 | 8.1 | 03-08-2026 |
| 6 | phpwind/phpwind | 0 | 10 | 03-08-2026 |
| 7 | gosuccess/easybill-api | 0 | 30 | 03-08-2026 |
| 8 | lace/framework | 0 | 10 | 03-08-2026 |
| 9 | lumnd/platophp | 0 | 17.69 | 03-08-2026 |
| 10 | shadman/laravel-skills | 0 | 21.11 | 03-08-2026 |