1. Go to this page and download the library: Download gam6itko/ozon-seller library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gam6itko / ozon-seller example snippets
use Gam6itko\OzonSeller\Service\V1\ProductService;
use Symfony\Component\HttpClient\Psr18Client;
$config = [$_SERVER['CLIENT_ID'], $_SERVER['API_KEY'], $_SERVER['API_URL']];
$client = new Psr18Client();
$svc = new ProductService($config, $client);
//do stuff
use Gam6itko\OzonSeller\Service\V1\CategoriesService;
use GuzzleHttp\Client as GuzzleClient;
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
use Http\Factory\Guzzle\RequestFactory;
use Http\Factory\Guzzle\StreamFactory;
$config = [
'clientId' => '<ozon seller client-id>',
'apiKey' => '<ozon seller api-key>',
// 'host' по умолчанию — https://api-seller.ozon.ru
];
$client = new GuzzleAdapter(new GuzzleClient());
$requestFactory = new RequestFactory();
$streamFactory = new StreamFactory();
$svc = new CategoriesService($config, $client, $requestFactory, $streamFactory);
//do stuff
use Gam6itko\OzonSeller\Enum\Language;
use Gam6itko\OzonSeller\Service\V1\DescriptionCategoryService;
use Symfony\Component\HttpClient\Psr18Client;
$config = [
'clientId' => '<ozon seller client-id>',
'apiKey' => '<ozon seller api-key>',
];
$svc = new DescriptionCategoryService($config, new Psr18Client());
// дерево категорий и типов товаров
$tree = $svc->getCategoryTree(['language' => Language::RU]);
// характеристики конкретной пары «категория + тип»
$attributes = $svc->getCategoryAttributes(17028922, 91565, ['language' => Language::RU]);
// значения справочной характеристики
$values = $svc->getAttributeValues(17028922, 91565, 85, ['limit' => 100]);
use Gam6itko\OzonSeller\Service\V3\Posting\FbsService;
use Symfony\Component\HttpClient\Psr18Client;
$svc = new FbsService($config, new Psr18Client());
$result = $svc->list([
'filter' => [
'since' => '2026-08-01T00:00:00.000Z',
'to' => '2026-08-08T00:00:00.000Z',
'status' => 'awaiting_packaging',
],
'limit' => 100,
]);
foreach ($result['postings'] as $posting) {
echo $posting['posting_number'], PHP_EOL;
}
$posting = $svc->get('33920474-0032-1', ['analytics_data' => true]);
use Gam6itko\OzonSeller\Service\V1\ProductService as V1ProductService;
use Gam6itko\OzonSeller\Service\V5\ProductService as V5ProductService;
// цены товаров: /v5/product/info/prices
$prices = (new V5ProductService($config, $client))->infoPrices(['visibility' => 'ALL'], '', 100);
// остатки по складам FBS: /v1/product/info/stocks-by-warehouse/fbs
$stocks = (new V1ProductService($config, $client))->infoStocksByWarehouseFbs(['sku' => [160249683]]);