Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

shelfwatch/shelfwatch

Дата публикации: 03-08-2026 17:38:34

Official PHP SDK for the ShelfWatch APIs v2

Основное содержимое страницы с новостью.

Official PHP SDK for the ShelfWatch APIs v2

Maintainers

89f242197bc8acdefd34ba30b0592531efb3fd23dca9819ec0485790d437edde?s=48&d=identicon

v0.1.0 2026-08-03 17:35 UTC

This package is not auto-updated.

Last update: 2026-08-03 17:38:51 UTC


README

Official PHP client for ShelfWatch APIs v2.

composer require shelfwatch/shelfwatch

Requires PHP 8.1 or newer.

Quick start

Create 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.

Errors

Typed 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 Packagist

Tag 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.

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1byteplus_sdk/byteplus-php-sdk-v201003-08-2026
2djeventplannerhub/djep-php-sdk018.3303-08-2026
3jcolombo/optmyzr-api-php013.6103-08-2026
4risetechapps/api-key-for-laravel010003-08-2026
5snowman/ai08.103-08-2026
6phpwind/phpwind01003-08-2026
7gosuccess/easybill-api03003-08-2026
8lace/framework01003-08-2026
9lumnd/platophp017.6903-08-2026
10shadman/laravel-skills021.1103-08-2026

Классификация: Пресс-релизы. Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 10. Источник: packagist.org.