# API для товаров

## Получение всего списка товаров

Данный метод возвращает все товары вашего аккаунта.

```jsx
GET: "https://europe-west1-kaspi-2e75a.cloudfunctions.net/backend/api/v1/products/list?client_id=68e2fa3d-2918-45cb-9aa3-4dcb5fa575bc"
// headers
X-API-KEY: "nx5kjZxJUYlLBDpdsyVi3t0dEVBcV60x5kjZxJUYlLBDpdsyVi3t0dEVBcV60x"
```

<details>

<summary>Пример ответа</summary>

```json
{
  products: [
    {
      sku: "ABC123",
      price: 15000,
      available: true,
      quantity: 10,
    },
  ],
  page: 0,
  pages: 15,
  limit: 100,
  total: 1500,
}
```

</details>

## Редактирование товаров

Данный метод позволяет менять данные у одного или нескольких товаров. В теле запроса должен содержаться массив с товарами и их новыми данными. Каждый товар обязательно должен иметь поле `sku` для идентификации и хотя-бы одно поле с параметром подлежащем изменению, например `price`

```jsx
POST: "https://europe-west1-kaspi-2e75a.cloudfunctions.net/backend/api/v1/products/update?client_id=68e2fa3d-2918-45cb-9aa3-4dcb5fa575bc"
// headers
X-API-KEY: "nx5kjZxJUYlLBDpdsyVi3t0dEVBcV60x5kjZxJUYlLBDpdsyVi3t0dEVBcV60x"
// body
{
    products: [
        {
            sku: "ABC123", //обязательное поле
            price: 15000
        }
    ]        
}
```

#### **Ограничения**

* Максимальный размер массива 5000 товаров.
* Доступные поля для изменения: `price`, `name`, `brand`, `category`
* Изменения на товары применяются сразу же, в UI на сайте может быть задержка в несколько секунд.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.marketradar.kz/api-marketradar/api-dlya-tovarov.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
