S3 - API

Общая информация

Набор методов для получения данных об ассортименте S3.

Данный документ содержит методы работы с ассортиментом компании S3.

Получение Access Token

Взаимодействие с сервисом требует клиентской авторизации. Авторизация клиентов обеспечивается с применением протокола OAuth 2.0. Для получения токена необходимо отправить POST-запрос (x-www-form-urlencoded) на URL:

https://api.s3.ru/oauth/token

Разрешенные параметры и их возможные значения:

  • grant_type: тип аутентификации, доступное значение: password;
  • client_id: идентификатор клиента, предоставленный персональным менеджером;
  • client_secret: секретный ключ клиента, предоставленный персональным менеджером.
  • username: email, указанный при регистрации.
  • password: пароль, предоставленный персональным менеджером.

В ответ на запрос доступа будет возвращена следующая информация:

  • access_token: jwt-токен;
  • token_type: тип токена (всегда принимает значение "Bearer");
  • expires_in: срок действия токена (по умолчанию 3600 секунд);

Далее, при обращении к методам сервиса полученный токен передается в заголовке запроса в следующем виде:

Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJvcmRlcjphbGw...

Пример запроса:

Аргумент Значение
grant_type password
client_id 1
client_secret dkslfj>Kuew429rfaldfndkfn
username test@test.ru
password XFkj235482

Ответ:

{ "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ…” "token_type": "Bearer", "expires_in": 31622400, }

Лимиты запросов

Не более 5 запросов в секунду, 300 запросов в минуту и не более 10 000 запросов в сутки.

Etim характеристики товаров

Список Etim характеристик товаров

GET
https://api.s3.ru
/api/v1/etim
requires authentication

Headers

Accept
Example:
application/json

Query Parameters

product_id
integer

Параметры конкретного товара,

Example:
1
code
string

Фильтр по коду товара,

Example:
Б230022
catalog_id
integer

Параметры товаров из каталога,

Example:
1
brand_id
integer

Параметры товаров бренда,

Example:
1
page
integer

default: 1,

Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/etim';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'product_id' => '1',
            'code' => 'Б230022',
            'catalog_id' => '1',
            'brand_id' => '1',
            'page' => '1',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "etim_items": [
        {
            "id": 58,
            "product_id": 142,
            "product_code": "",
            "product_class_code": "",
            "name": "Номин. напряжение",
            "value": "1.5",
            "feature_code": "EF000002",
            "value_code": ""
        },
        {
            "id": 58,
            "product_id": 142,
            "product_code": "",
            "product_class_code": "",
            "name": "Номин. напряжение",
            "value": "1.5",
            "feature_code": "EF000002",
            "value_code": ""
        }
    ],
    "pagination": {
        "current_page": 1,
        "final_page": true
    }
}

Бренды

Информация о бренде

GET
https://api.s3.ru
/api/v1/brands/{brand_id}
requires authentication

Headers

Accept
Example:
application/json

URL Parameters

brand_id
integer
required
Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/brands/1';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                                ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "brand": {
        "id": null,
        "name": "Voluptatum cum.",
        "description": "Ut quis omnis.",
        "logo": "https://www.s3.ru/640x480.png/0000dd"
    }
}

Список брендов

GET
https://api.s3.ru
/api/v1/brands
requires authentication

Headers

Accept
Example:
application/json

Query Parameters

page
integer

default: 1,

Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/brands';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'page' => '1',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "brands": [
        {
            "id": null,
            "name": "Ea excepturi.",
            "description": "Eaque ullam.",
            "logo": "https://www.s3.ru/640x480.png/009966"
        },
        {
            "id": null,
            "name": "Accusantium et.",
            "description": "Ea sint.",
            "logo": "https://www.s3.ru/640x480.png/00bb00"
        }
    ],
    "pagination": {
        "current_page": 1,
        "final_page": true
    }
}

Дополнительные материалы товаров

Список дополнительных материалов

GET
https://api.s3.ru
/api/v1/passports
requires authentication

Headers

Accept
Example:
application/json

Query Parameters

product_id
integer
Example:
1
code
string
Example:
Б04148

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/passports';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'product_id' => '1',
            'code' => 'Б04148',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "info_items": [
        {
            "id": 60,
            "product_id": null,
            "product_code": "",
            "type": "-",
            "name": null,
            "url": "https://www.s3.ru"
        },
        {
            "id": 61,
            "product_id": null,
            "product_code": "",
            "type": "-",
            "name": null,
            "url": "https://www.s3.ru"
        }
    ]
}

Изображения товаров

Информация об изображениях

GET
https://api.s3.ru
/api/v1/images
requires authentication

Headers

Accept
Example:
application/json

Query Parameters

product_id
integer

Параметры конкретного товара,

Example:
1
codes
string
required
Example:
"Б0059885,Б0042991" не более 20 кодов
channel
string
required
Example:
site или ozon или wildberries
catalog_id
integer

Параметры товаров из каталога,

Example:
1
brand_id
integer

Параметры товаров бренда,

Example:
1
original_image
string

default: no,

Example:
yes
page
integer

default: 1,

Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/images';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'product_id' => '1',
            'codes' => '"Б0059885,Б0042991" не более 20 кодов',
            'channel' => 'site или ozon или wildberries',
            'catalog_id' => '1',
            'brand_id' => '1',
            'original_image' => 'yes',
            'page' => '1',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "items": [
        {
            "code": "Similique.",
            "channels": []
        }
    ]
}

Каталог

Информация о разделе каталога

GET
https://api.s3.ru
/api/v1/categories/{category_id}
requires authentication

Headers

Accept
Example:
application/json

URL Parameters

category_id
integer
required
Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/categories/1';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                                ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "category": {
        "id": null,
        "name": "Corrupti totam.",
        "parent_id": 91
    }
}

Список каталогов

GET
https://api.s3.ru
/api/v1/categories
requires authentication

Headers

Accept
Example:
application/json

Query Parameters

parent_id
integer
Example:
1
page
integer

default: 1,

Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/categories';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'parent_id' => '1',
            'page' => '1',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "categories": [
        {
            "id": null,
            "name": "Sapiente aut.",
            "parent_id": 65
        },
        {
            "id": null,
            "name": "Ut eos numquam.",
            "parent_id": 11
        }
    ],
    "pagination": {
        "current_page": 1,
        "final_page": true
    }
}

Остатки товаров

Создать запрос

GET
https://api.s3.ru
/api/v1/inventories/full
requires authentication

Информация об остатках товаров сформировать ссылку на полный файл с остатками

Headers

Accept
Example:
application/json

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/inventories/full';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                                ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
 "uuid": "3b8fdd4c-5a7e-4419-b2eb-e1741772d71b",
}

Получить статус

GET
https://api.s3.ru
/api/v1/inventories/full/{uuid}
requires authentication

Получить информацию о статусе формирования файла с остатками

Headers

Accept
Example:
application/json

URL Parameters

uuid
string
required
Example:
3b8fdd4c-5a7e-4419-b2eb-e1741772d71b

Query Parameters

uuid
string
required

Must be a valid UUID.

Example:
0fd674bc-df34-3331-af55-a3ade2eca31f

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/inventories/full/3b8fdd4c-5a7e-4419-b2eb-e1741772d71b';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'uuid' => '0fd674bc-df34-3331-af55-a3ade2eca31f',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "uuid": "3b8fdd4c-5a7e-4419-b2eb-e1741772d71b",
    "status": "IN_PROGRESS",
    "url": null
}

Скачать файл

GET
https://api.s3.ru
/api/v1/inventories/full_download/{uuid}
requires authentication

Если файл готов - скачать файл, в противном случае код ответа - 404

Headers

Accept
Example:
application/json

URL Parameters

uuid
string
required
Example:
3b8fdd4c-5a7e-4419-b2eb-e1741772d71b

Query Parameters

uuid
string
required

Must be a valid UUID.

Example:
e54b612f-d79e-39e0-9188-d9c6665495ba
Example request:

    $opts = [
        "http" => [
            "method" => "GET",
            "header" => "Authorization: Bearer YOUR_ACCESS_TOKEN"
        ]
    ];

    $context = stream_context_create($opts);
    $url = 'https://api.s3.ru/api/v1/inventories/full_download/3b8fdd4c-5a7e-4419-b2eb-e1741772d71b';
    $file = file_get_contents($url, false, $context);
Example response:
<items>
    <item>
        <code>Б3400923</code>
        <product_id>76</product_id>
        <warehouse_id>3</warehouse_id>
        <quantity>очень много</quantity>
    </item>
    <item>
        <code>Б3400925</code>
        <product_id>80</product_id>
        <warehouse_id>3</warehouse_id>
        <quantity>очень много</quantity>
    </item>
    ...
</items>
NOT_FOUND

Информация об остатках постранично

GET
https://api.s3.ru
/api/v1/inventories
requires authentication

Headers

Accept
Example:
application/json

Query Parameters

warehouse_id
integer

Остатки товаров на определенном складе,

Example:
1
catalog_id
integer

Остатки товаров из каталога,

Example:
1
brand_id
integer

Остатки товаров бренда,

Example:
1
product_id
integer

Остатки конкретного товара,

Example:
2
code
string
Example:
voluptas
in_stock
boolean

Получить только строки с положительным/нулевым остатком,

Example:
1
page
integer

default: 1,

Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/inventories';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'warehouse_id' => '1',
            'catalog_id' => '1',
            'brand_id' => '1',
            'product_id' => '2',
            'code' => 'voluptas',
            'in_stock' => '1',
            'page' => '1',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "inventories": [
        {
            "product_id": null,
            "code": null,
            "warehouse_id": null,
            "quantity": "очень много"
        },
        {
            "product_id": null,
            "code": null,
            "warehouse_id": null,
            "quantity": "очень много"
        }
    ],
    "pagination": {
        "current_page": 1,
        "final_page": true
    }
}

Параметры товаров

Список параметров товаров

GET
https://api.s3.ru
/api/v1/properties
requires authentication

Headers

Accept
Example:
application/json

Query Parameters

product_id
integer

Параметры конкретного товара,

Example:
1
code
string

Фильтр по коду товара,

Example:
Б230022
catalog_id
integer

Параметры товаров из каталога,

Example:
1
brand_id
integer

Параметры товаров бренда,

Example:
1
name
string

Название параметра,

Example:
"Страна производства"
page
integer

default: 1,

Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/properties';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'product_id' => '1',
            'code' => 'Б230022',
            'catalog_id' => '1',
            'brand_id' => '1',
            'name' => '"Страна производства"',
            'page' => '1',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "properties": [
        {
            "id": null,
            "product_id": 82,
            "code": "",
            "name": "Voluptas.",
            "value": 43
        },
        {
            "id": null,
            "product_id": 47,
            "code": "",
            "name": "Delectus vitae.",
            "value": 22
        }
    ],
    "pagination": {
        "current_page": 1,
        "final_page": true
    }
}

Сертификаты на товары

Список сертификатов по товару (product_id или code обязтелен для получения информации о сертификатах)

GET
https://api.s3.ru
/api/v1/certificates
requires authentication

Headers

Accept
Example:
application/json

Query Parameters

product_id
integer
Example:
1
code
string
Example:
Б04148

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/certificates';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'product_id' => '1',
            'code' => 'Б04148',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "certificates": [
        {
            "type": "Laborum.",
            "url": "https://www.s3.ru/sert.pdf",
            "link": "",
            "reg_number": "81",
            "number": "49"
        },
        {
            "type": "Magnam ad.",
            "url": "https://www.s3.ru/sert.pdf",
            "link": "",
            "reg_number": "97",
            "number": "29"
        }
    ]
}

Список складов

Информация о складе

GET
https://api.s3.ru
/api/v1/warehouses/{warehouse_id}
requires authentication

Headers

Accept
Example:
application/json

URL Parameters

warehouse_id
integer
required
Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/warehouses/1';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                                ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "warehouse": {
        "id": 79,
        "name": "Ut quaerat ex."
    }
}

Список складов

GET
https://api.s3.ru
/api/v1/warehouses
requires authentication

Headers

Accept
Example:
application/json

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/warehouses';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                                ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "warehouses": [
        {
            "id": 80,
            "name": "Fugiat eos et."
        },
        {
            "id": 81,
            "name": "Excepturi."
        }
    ]
}

Товары

Информация о товаре

GET
https://api.s3.ru
/api/v1/products/{product_id}
requires authentication

Headers

Accept
Example:
application/json

URL Parameters

product_id
integer
required
Example:
1

Query Parameters

original_image
string

default: no,

Example:
yes

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/products/1';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'original_image' => 'yes',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "product": {
        "id": null,
        "url": "https://www.s3.ru/ru/item/",
        "code": "Rerum eos sit.",
        "code_wms": "Cum debitis.",
        "etim_class_code": "",
        "barcodes": [],
        "name": "In vel in.",
        "catalog_id": 47,
        "tn_ved_code": "Doloremque.",
        "brand_id": 97,
        "okpd2": null,
        "is_marked": null,
        "description": "Eaque cumque.",
        "consumer_price_type": "",
        "images": [],
        "extra_images": [],
        "min_multiplicity": 2,
        "weight": "0.150",
        "vendor_code": "Ea incidunt.",
        "multiplicity": null
    }
}

Информация о товаре под коду товара

GET
https://api.s3.ru
/api/v1/products/by_code/{code}
requires authentication

Headers

Accept
Example:
application/json

URL Parameters

code
string
required
Example:
Б234221

Query Parameters

original_image
string

default: no,

Example:
yes

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/products/by_code/Б234221';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'original_image' => 'yes',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "product": {
        "id": null,
        "url": "https://www.s3.ru/ru/item/",
        "code": "Quae dolorum.",
        "code_wms": "Veritatis in.",
        "etim_class_code": "",
        "barcodes": [],
        "name": "Omnis labore.",
        "catalog_id": 13,
        "tn_ved_code": "Repellat ipsa.",
        "brand_id": 64,
        "okpd2": null,
        "is_marked": null,
        "description": "Voluptates.",
        "consumer_price_type": "",
        "images": [],
        "extra_images": [],
        "min_multiplicity": 2,
        "weight": "0.150",
        "vendor_code": "Qui voluptate.",
        "multiplicity": null
    }
}

Список товаров Query parameters

GET
https://api.s3.ru
/api/v1/products
requires authentication

Headers

Accept
Example:
application/json

Query Parameters

warehouse_id
integer
Example:
1
catalog_id
integer
Example:
1
brand_id
integer
Example:
1
original_image
string

default: no,

Example:
yes
page
integer

default: 1,

Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/products';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'warehouse_id' => '1',
            'catalog_id' => '1',
            'brand_id' => '1',
            'original_image' => 'yes',
            'page' => '1',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "products": [
        {
            "id": null,
            "url": "https://www.s3.ru/ru/item/",
            "code": "Molestiae.",
            "code_wms": "Beatae nemo.",
            "etim_class_code": "",
            "barcodes": [],
            "name": "Optio ipsam.",
            "catalog_id": 61,
            "tn_ved_code": "Voluptas.",
            "brand_id": 25,
            "okpd2": null,
            "is_marked": null,
            "description": "Ipsa ut porro.",
            "consumer_price_type": "",
            "images": [],
            "extra_images": [],
            "min_multiplicity": 1,
            "weight": "0.150",
            "vendor_code": "Nemo atque.",
            "multiplicity": null
        },
        {
            "id": null,
            "url": "https://www.s3.ru/ru/item/",
            "code": "Aut odio.",
            "code_wms": "Aut mollitia.",
            "etim_class_code": "",
            "barcodes": [],
            "name": "Perspiciatis.",
            "catalog_id": 52,
            "tn_ved_code": "Nostrum.",
            "brand_id": 88,
            "okpd2": null,
            "is_marked": null,
            "description": "Nam laboriosam.",
            "consumer_price_type": "",
            "images": [],
            "extra_images": [],
            "min_multiplicity": 2,
            "weight": "0.150",
            "vendor_code": "Quod quia.",
            "multiplicity": null
        }
    ],
    "pagination": {
        "current_page": 1,
        "final_page": true
    }
}

Цены товаров

Создать запрос

GET
https://api.s3.ru
/api/v1/product_prices/full
requires authentication

Информация о ценах товаров - сформировать ссылку на полный файл с ценами

Headers

Accept
Example:
application/json

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/product_prices/full';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                                ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
 "uuid": "3b8fdd4c-5a7e-4419-b2eb-e1741772d71b",
}

Получить статус

GET
https://api.s3.ru
/api/v1/product_prices/full/{uuid}
requires authentication

Получить информацию о статусе формирования файла с ценами

Headers

Accept
Example:
application/json

URL Parameters

uuid
string
required
Example:
3b8fdd4c-5a7e-4419-b2eb-e1741772d71b

Query Parameters

uuid
string
required

Must be a valid UUID.

Example:
07255236-8ece-3983-8d91-cd47fdc75af4

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/product_prices/full/3b8fdd4c-5a7e-4419-b2eb-e1741772d71b';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'uuid' => '07255236-8ece-3983-8d91-cd47fdc75af4',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "uuid": "3b8fdd4c-5a7e-4419-b2eb-e1741772d71b",
    "status": "IN_PROGRESS",
    "url": null
}

Скачать файл

GET
https://api.s3.ru
/api/v1/product_prices/full_download/{uuid}
requires authentication

Если файл готов - скачать файл, в противном случае код ответа - 404

Headers

Accept
Example:
application/json

URL Parameters

uuid
string
required
Example:
3b8fdd4c-5a7e-4419-b2eb-e1741772d71b

Query Parameters

uuid
string
required

Must be a valid UUID.

Example:
0d924b39-46c7-3a54-b061-6cdc68bb31a3
Example request:

    $opts = [
        "http" => [
            "method" => "GET",
            "header" => "Authorization: Bearer YOUR_ACCESS_TOKEN"
        ]
    ];

    $context = stream_context_create($opts);
    $url = 'https://api.s3.ru/api/v1/product_prices/full_download/3b8fdd4c-5a7e-4419-b2eb-e1741772d71b';
    $file = file_get_contents($url, false, $context);
Example response:
<items>
    <item>
        <code>Б3400923</code>
        <product_id>76</product_id>
        <rrc_price>
            <value>180.90</value>
            <vat_sum>36.18</vat_sum>
            <vat_rate>20</vat_rate>
        </rrc_price>
        <client_price>
            <value>110.6</value>
            <vat_sum>22.12</vat_sum>
            <vat_rate>20</vat_rate>
        </client_price>
        <price_scale>
            <price_scale_item>
                <name>Мелкооптовая</name>
                <value>104.28</value>
            </price_scale_item>
            <price_scale_item>
                <name>Оптовая</name>
                <value>102.72</value>
            </price_scale_item>
        </price_scale>
    </item>
    ...
</items>
NOT_FOUND

Информация о цене товара

GET
https://api.s3.ru
/api/v1/product_prices/{product_id}
requires authentication

Headers

Accept
Example:
application/json

URL Parameters

product_id
integer
required
Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/product_prices/1';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                                ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "price": {
        "product_id": null,
        "code": "Consequatur.",
        "rrc_price": {
            "value": "0.0",
            "vat_sum": "0.00",
            "vat_rate": 22
        },
        "client_price": null
    }
}

Информация о цене товара - код товара

GET
https://api.s3.ru
/api/v1/product_prices/by_code/{code}
requires authentication

Headers

Accept
Example:
application/json

URL Parameters

code
string
required
Example:
Б2403222

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/product_prices/by_code/Б2403222';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                                ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "price": {
        "product_id": null,
        "code": "Iure.",
        "rrc_price": {
            "value": "0.0",
            "vat_sum": "0.00",
            "vat_rate": 22
        },
        "client_price": null
    }
}

Список цен товаров

GET
https://api.s3.ru
/api/v1/product_prices
requires authentication

Headers

Accept
Example:
application/json

Query Parameters

warehouse_id
integer
Example:
1
catalog_id
integer
Example:
1
brand_id
integer
Example:
1
page
integer

default: 1,

Example:
1

Response Fields

Example request:

    $client = new \GuzzleHttp\Client();
    $url = 'https://api.s3.ru/api/v1/product_prices';
            $response = $client->get(
        $url,
        [
                    'headers' => [
            'Accept' => 'application/json',
        ],
                            'query' => [
            'warehouse_id' => '1',
            'catalog_id' => '1',
            'brand_id' => '1',
            'page' => '1',
        ],
                        ]
        );
        $body = $response->getBody();
    print_r(json_decode((string) $body));
Example response:
{
    "prices": [
        {
            "product_id": null,
            "code": "Accusamus.",
            "rrc_price": {
                "value": "0.0",
                "vat_sum": "0.00",
                "vat_rate": 22
            },
            "client_price": null
        },
        {
            "product_id": null,
            "code": "Dicta quos.",
            "rrc_price": {
                "value": "0.0",
                "vat_sum": "0.00",
                "vat_rate": 22
            },
            "client_price": null
        }
    ],
    "pagination": {
        "current_page": 1,
        "final_page": true
    }
}