# Product

::: info
Каждый ответ приходит в общем конверте — `code`, `message`, `messages`, `status_code`, `time` — а полезная нагрузка лежит в `data`. Таблицы ниже описывают содержимое `data`.
:::

## POST /product/create

This method allows adding product into the account.

**Нужное разрешение:** `product_create` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/product/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "measure_id": "67b486d242ed76693cd2cc59",
  "is_product": false,
  "is_semi_product": false,
  "is_material": false
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string",
    "measure_id": "67b486d242ed76693cd2cc59",
    "is_product": false,
    "is_semi_product": false,
    "is_material": false
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/product/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
        "measure_id": "67b486d242ed76693cd2cc59",
        "is_product": False,
        "is_semi_product": False,
        "is_material": False,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "name": "string",
  "measure_id": "67b486d242ed76693cd2cc59",
  "is_product": false,
  "is_semi_product": false,
  "is_material": false
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/create');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `name` | `string` | Да |  |
| `note` | `string` | Нет |  |
| `measure_id` | `string` | Да | id of measure unit |
| `category_id` | `string` | Нет | id of product categories |
| `box_type_id` | `string` | Нет | id of Box type |
| `box_item` | `number` | Нет | number of items that exist in one box Required when `box_type_id` is set.. По умолчанию: `0` |
| `box_item_barcode` | `string` | Нет | id of box item's barcode |
| `sku` | `string` | Нет | local unique id of product |
| `barcode` | `string` | Нет | barcode of product |
| `supplier_ids` | `string[]` | Нет | list of supplier ids |
| `warehouse_number` | `string` | Нет | Product's location in the warehouse (aisle/shelf/bin label). Optional, free-form. |
| `image` | `string` | Нет | image path of product that uploaded to the server |
| `is_compound` | `boolean` | Нет | is compound product or not. По умолчанию: `false` |
| `materials` | `object[]` | Нет | list of materials of product. required if is_compound is true |
| `materials[].material_id` | `string` | Да |  |
| `materials[].amount` | `number` | Да |  |
| `materials[].box_count` | `integer` | Нет |  |
| `barcodes` | `object[]` | Нет | list of barcodes of product |
| `barcodes[].is_active` | `boolean` | Да |  |
| `barcodes[].barcode` | `string` | Да |  |
| `is_semi_product` | `boolean` | Да | is semi product or not. По умолчанию: `false` |
| `is_product` | `boolean` | Да | is product or not. По умолчанию: `false` |
| `is_material` | `boolean` | Да | is material or not. По умолчанию: `false` |
| `is_marked` | `boolean` | Нет | is marked or not. По умолчанию: `false` |
| `dimension` | `object` | Нет | dimension of product |
| `dimension.shape` | `string` | Да | Допустимые значения: `circular`, `rectangular`, `other` |
| `dimension.netto_weight` | `number` | Да |  |
| `dimension.gross_weight` | `number` | Да |  |
| `dimension.height` | `number` | Нет | Required when `shape` is `circular` or `rectangular`. |
| `dimension.volume` | `number` | Да |  |
| `dimension.diameter` | `number` | Нет | Required when `shape` is `circular` or `rectangular`. |
| `dimension.width` | `number` | Нет | Required when `shape` is `rectangular`. |
| `dimension.length` | `number` | Нет | Required when `shape` is `rectangular`. |
| `is_variant` | `boolean` | Нет | is variant or not. По умолчанию: `false` |
| `variants` | `object[]` | Нет | Required when `is_variant` is true. |
| `variants[].sku` | `string` | Да |  |
| `variants[].barcode` | `string` | Нет |  |
| `variants[].image` | `boolean` | Нет |  |
| `variants[].organizations` | `object[]` | Да |  |
| `variants[].organizations[].organization_id` | `string` | Да |  |
| `variants[].organizations[].is_available` | `boolean` | Да |  |
| `variants[].organizations[].max_stock` | `number` | Нет |  |
| `variants[].organizations[].yellow_line` | `number` | Нет |  |
| `variants[].organizations[].red_line` | `number` | Нет |  |
| `variants[].organizations[].standard` | `number` | Нет |  |
| `variants[].organizations[].is_available_for_sale` | `boolean` | Нет |  |
| `variants[].organizations[].warehouses` | `object[]` | Нет |  |
| `variants[].organizations[].prices` | `object[]` | Нет |  |
| `variants[].organizations[].service_cost` | `number` | Нет |  |
| `variants[].organizations[].service_cost_currency_id` | `string` | Нет |  |
| `variants[].attributes` | `object[]` | Да |  |
| `variants[].attributes[].attribute_id` | `string` | Да |  |
| `variants[].attributes[].attribute_item_id` | `string` | Да |  |
| `organizations` | `object[]` | Нет | Required unless `is_variant` is true. |
| `organizations[].organization_id` | `string` | Да |  |
| `organizations[].is_available` | `boolean` | Да |  |
| `organizations[].max_stock` | `number` | Нет |  |
| `organizations[].yellow_line` | `number` | Нет |  |
| `organizations[].red_line` | `number` | Нет |  |
| `organizations[].standard` | `number` | Нет |  |
| `organizations[].is_available_for_sale` | `boolean` | Нет |  |
| `organizations[].prices` | `object[]` | Нет | list of prices with optional UOM prices |
| `organizations[].prices[].price_id` | `string` | Да |  |
| `organizations[].prices[].amount` | `number` | Нет |  |
| `organizations[].prices[].uom_prices` | `object[]` | Нет |  |
| `organizations[].warehouses` | `object[]` | Нет |  |
| `organizations[].warehouses[].warehouse_id` | `string` | Да |  |
| `organizations[].warehouses[].max_stock` | `number` | Нет |  |
| `organizations[].warehouses[].yellow_line` | `number` | Нет |  |
| `organizations[].warehouses[].red_line` | `number` | Нет |  |
| `organizations[].warehouses[].standard` | `number` | Нет | По умолчанию: `10` |
| `organizations[].service_cost` | `number` | Нет |  |
| `organizations[].service_cost_currency_id` | `string` | Нет | Required when `service_cost` is set. |
| `supplier_id` | `string` | Нет |  |
| `max_stock` | `number` | Нет |  |
| `images` | `string[]` | Нет |  |
| `is_service` | `boolean` | Нет | По умолчанию: `false` |
| `apply_tax` | `boolean` | Нет | По умолчанию: `false` |
| `apply_discount` | `boolean` | Нет | По умолчанию: `false` |
| `has_expiration` | `boolean` | Нет | По умолчанию: `false` |
| `service_cost_id` | `string` | Нет |  |
| `custom_fields` | `object` | Нет | Custom-field values. |
| `custom_fields._id` | `string` | Да |  |
| `custom_fields.value` | `any` | Нет | Field value; its type depends on the custom field. |
| `is_parent` | `boolean` | Нет |  |
| `measure_ratios` | `object[]` | Нет |  |
| `measure_ratios[].measure_id` | `string` | Да |  |
| `measure_ratios[].ratio` | `number` | Да |  |
| `measure_ratios[].barcode` | `string` | Нет |  |

```json
{
  "name": "string",
  "note": "string",
  "measure_id": "67b486d242ed76693cd2cc59",
  "category_id": "67b486d242ed76693cd2cc59",
  "box_type_id": "67b486d242ed76693cd2cc59",
  "box_item": 0,
  "box_item_barcode": "string",
  "sku": "string",
  "barcode": "string",
  "supplier_ids": [
    "string"
  ],
  "warehouse_number": "string",
  "image": "string",
  "is_compound": false,
  "materials": [
    {
      "material_id": "67b486d242ed76693cd2cc59",
      "amount": 0,
      "box_count": 0
    }
  ],
  "barcodes": [
    {
      "is_active": false,
      "barcode": "string"
    }
  ],
  "is_semi_product": false,
  "is_product": false,
  "is_material": false,
  "is_marked": false,
  "dimension": {
    "shape": "circular",
    "netto_weight": 0,
    "gross_weight": 0,
    "height": 0,
    "volume": 0,
    "diameter": 0,
    "width": 0,
    "length": 0
  },
  "is_variant": false,
  "variants": [
    {
      "sku": "string",
      "barcode": "string",
      "image": false,
      "organizations": [],
      "attributes": []
    }
  ],
  "organizations": [
    {
      "organization_id": "67b486d242ed76693cd2cc59",
      "is_available": false,
      "max_stock": 0,
      "yellow_line": 0,
      "red_line": 0,
      "standard": 0,
      "is_available_for_sale": false,
      "prices": [],
      "warehouses": [],
      "service_cost": 0,
      "service_cost_currency_id": "64b7f4d9e2b3b6a0b7c5d7ff"
    }
  ],
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "max_stock": 0,
  "images": [
    "string"
  ],
  "is_service": false,
  "apply_tax": false,
  "apply_discount": false,
  "has_expiration": false,
  "service_cost_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "custom_fields": {
    "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "value": null
  },
  "is_parent": false,
  "measure_ratios": [
    {
      "measure_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "ratio": 0,
      "barcode": "string"
    }
  ]
}
```

**Ответ**

| Поле | Тип | Описание |
|---|---|---|
| `_id` | `string` | id of product |
| `created_at` | `string` |  |
| `updated_at` | `string` |  |
| `name` | `string` |  |
| `number` | `string` |  |
| `note` | `string` |  |
| `box_item` | `number` |  |
| `box_item_barcode` | `string` |  |
| `box_type_id` | `string` |  |
| `box_type` | `object` |  |
| `box_type._id` | `string` |  |
| `box_type.code` | `string` |  |
| `box_type.short_name` | `string` |  |
| `box_type.name` | `string` |  |
| `measure` | `object` |  |
| `measure._id` | `string` |  |
| `measure.system_code` | `string` |  |
| `measure.code` | `string` |  |
| `measure.short_name` | `string` |  |
| `measure.name` | `string` |  |
| `measure.decimal_count` | `number` |  |
| `sku` | `string` |  |
| `barcode` | `string` |  |
| `barcodes` | `object[]` | list of barcodes of product |
| `barcodes[].is_active` | `boolean` |  |
| `barcodes[].barcode` | `string` |  |
| `supplier_ids` | `string[]` | list of supplier ids |
| `warehouse_number` | `string` | Product's location in the warehouse (aisle/shelf/bin label). Absent when not set. |
| `image` | `string` | image path of product that uploaded to the server |
| `materials` | `object[]` | list of materials of product. required if is_compound is true |
| `materials[].material_id` | `string` |  |
| `materials[].amount` | `number` |  |
| `materials[].box_count` | `integer` |  |
| `materials[].material` | `object` |  |
| `materials[].material._id` | `string` |  |
| `materials[].material.name` | `string` |  |
| `materials[].material.sku` | `string` |  |
| `is_compound` | `boolean` | is compound product or not |
| `is_marked` | `boolean` | is marked or not |
| `is_product` | `boolean` | is product or not. По умолчанию: `false` |
| `is_material` | `boolean` | is material or not. По умолчанию: `false` |
| `is_semi_product` | `boolean` | is semi product or not. По умолчанию: `false` |
| `dimension` | `object` | dimension of product |
| `dimension.shape` | `string` | Допустимые значения: `circular`, `rectangular`, `other` |
| `dimension.netto_weight` | `number` |  |
| `dimension.gross_weight` | `number` |  |
| `dimension.height` | `number` |  |
| `dimension.volume` | `number` |  |
| `dimension.diameter` | `number` |  |
| `dimension.width` | `number` |  |
| `dimension.length` | `number` |  |
| `is_variant` | `boolean` | is variant or not |
| `is_parent` | `boolean` | is parent or not |
| `attributes` | `object[]` |  |
| `attributes[].attribute_id` | `string` |  |
| `attributes[].attribute_item_id` | `string` |  |
| `parent_id` | `string` | id of parent product. it depends on variant product |
| `organizations` | `object[]` |  |
| `organizations[].organization_id` | `string` |  |
| `organizations[].is_available` | `boolean` |  |
| `organizations[].max_stock` | `number` |  |
| `organizations[].yellow_line` | `number` |  |
| `organizations[].red_line` | `number` |  |
| `organizations[].standard` | `number` |  |
| `organizations[].is_available_for_sale` | `boolean` |  |
| `organizations[].prices` | `object[]` | list of prices with optional UOM prices |
| `organizations[].prices[].price_id` | `string` |  |
| `organizations[].prices[].amount` | `number` |  |
| `organizations[].prices[].uom_prices` | `object[]` |  |
| `tax_ids` | `string[]` | list of tax ids |
| `discount_ids` | `string[]` | list of discount ids |
| `category` | `object` |  |
| `category._id` | `string` |  |
| `category.name` | `string` |  |
| `custom_fields` | `object[]` |  |
| `custom_fields[]._id` | `string` |  |
| `custom_fields[].value` | `string` |  |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "67b486d242ed76693cd2cc59",
    "created_at": "2023-10-01T12:00:00Z",
    "updated_at": "2023-10-01T12:00:00Z",
    "name": "string",
    "number": "string",
    "note": "string",
    "box_item": 0,
    "box_item_barcode": "string",
    "box_type_id": "67b486d242ed76693cd2cc59",
    "box_type": {
      "_id": "67b486d242ed76693cd2cc59",
      "code": "string",
      "short_name": "string",
      "name": "string"
    },
    "measure": {
      "_id": "67b486d242ed76693cd2cc59",
      "system_code": "string",
      "code": "string",
      "short_name": "string",
      "name": "string",
      "decimal_count": 0
    },
    "sku": "string",
    "barcode": "string",
    "barcodes": [
      {
        "is_active": false,
        "barcode": "string"
      }
    ],
    "supplier_ids": [
      "string"
    ],
    "warehouse_number": "string",
    "image": "string",
    "materials": [
      {
        "material_id": "67b486d242ed76693cd2cc59",
        "amount": 0,
        "box_count": 0,
        "material": {
          "_id": null,
          "name": null,
          "sku": null
        }
      }
    ],
    "is_compound": false,
    "is_marked": false,
    "is_product": false,
    "is_material": false,
    "is_semi_product": false,
    "dimension": {
      "shape": "circular",
      "netto_weight": 0,
      "gross_weight": 0,
      "height": 0,
      "volume": 0,
      "diameter": 0,
      "width": 0,
      "length": 0
    },
    "is_variant": false,
    "is_parent": false,
    "attributes": [
      {
        "attribute_id": "string",
        "attribute_item_id": "string"
      }
    ],
    "parent_id": "67b486d242ed76693cd2cc59",
    "organizations": [
      {
        "organization_id": "67b486d242ed76693cd2cc59",
        "is_available": false,
        "max_stock": 0,
        "yellow_line": 0,
        "red_line": 0,
        "standard": 0,
        "is_available_for_sale": false,
        "prices": []
      }
    ],
    "tax_ids": [
      "string"
    ],
    "discount_ids": [
      "string"
    ],
    "category": {
      "_id": "67b486d242ed76693cd2cc59",
      "name": "string"
    },
    "custom_fields": [
      {
        "_id": "67b486d242ed76693cd2cc59",
        "value": "string"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## PUT /product/update

This method allows updating product in the account.

**Нужное разрешение:** `product_update` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/product/update' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "measure_id": "string",
  "is_semi_product": false,
  "is_product": false,
  "is_material": false,
  "_id": "string"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/update', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string",
    "measure_id": "string",
    "is_semi_product": false,
    "is_product": false,
    "is_material": false,
    "_id": "string"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/product/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
        "measure_id": "string",
        "is_semi_product": False,
        "is_product": False,
        "is_material": False,
        "_id": "string",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "name": "string",
  "measure_id": "string",
  "is_semi_product": false,
  "is_product": false,
  "is_material": false,
  "_id": "string"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/update');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `_id` | `string` | Да | id of product |
| `name` | `string` | Да |  |
| `measure_id` | `string` | Да | id of measure unit |
| `category_id` | `string` | Нет | id of product categories |
| `box_type_id` | `string` | Нет | id of Box type |
| `box_item` | `number` | Нет | number of items that exist in one box Required when `box_type_id` is set.. По умолчанию: `0` |
| `box_item_barcode` | `string` | Нет | id of box item's barcode |
| `sku` | `string` | Нет | local unique id of product |
| `barcode` | `string` | Нет | barcode of product |
| `supplier_ids` | `string[]` | Нет | list of supplier ids |
| `warehouse_number` | `string` | Нет | Product's location in the warehouse (aisle/shelf/bin label). Optional, free-form. |
| `image` | `string` | Нет | image path of product that uploaded to the server |
| `materials` | `object[]` | Нет | list of materials of product. required if is_compound is true |
| `materials[].material_id` | `string` | Да |  |
| `materials[].amount` | `number` | Да |  |
| `materials[].box_count` | `integer` | Нет |  |
| `barcodes` | `object[]` | Нет | list of barcodes of product |
| `barcodes[].is_active` | `boolean` | Да |  |
| `barcodes[].barcode` | `string` | Да |  |
| `is_semi_product` | `boolean` | Да | is semi product or not. По умолчанию: `false` |
| `is_product` | `boolean` | Да | is product or not. По умолчанию: `false` |
| `is_material` | `boolean` | Да | is material or not. По умолчанию: `false` |
| `dimension` | `object` | Нет | dimension of product |
| `dimension.shape` | `string` | Да | Допустимые значения: `circular`, `rectangular`, `other` |
| `dimension.netto_weight` | `number` | Да |  |
| `dimension.gross_weight` | `number` | Да |  |
| `dimension.height` | `number` | Нет | Required when `shape` is `circular` or `rectangular`. |
| `dimension.volume` | `number` | Да |  |
| `dimension.diameter` | `number` | Нет | Required when `shape` is `circular` or `rectangular`. |
| `dimension.width` | `number` | Нет | Required when `shape` is `rectangular`. |
| `dimension.length` | `number` | Нет | Required when `shape` is `rectangular`. |
| `variants` | `object[]` | Нет | list of variants of product. required if is_variant is true |
| `variants[]._id` | `string` | Нет |  |
| `variants[].sku` | `string` | Да |  |
| `variants[].barcode` | `string` | Нет |  |
| `variants[].image` | `boolean` | Нет |  |
| `variants[].organizations` | `object[]` | Да |  |
| `variants[].organizations[].organization_id` | `string` | Да |  |
| `variants[].organizations[].is_available` | `boolean` | Да |  |
| `variants[].organizations[].max_stock` | `number` | Нет |  |
| `variants[].organizations[].yellow_line` | `number` | Нет |  |
| `variants[].organizations[].red_line` | `number` | Нет |  |
| `variants[].organizations[].standard` | `number` | Нет |  |
| `variants[].organizations[].is_available_for_sale` | `boolean` | Нет |  |
| `variants[].organizations[].warehouses` | `object[]` | Нет |  |
| `variants[].organizations[].prices` | `object[]` | Нет |  |
| `variants[].organizations[].service_cost` | `number` | Нет |  |
| `variants[].organizations[].service_cost_currency_id` | `string` | Нет |  |
| `variants[].attributes` | `object[]` | Да |  |
| `variants[].attributes[].attribute_id` | `string` | Да |  |
| `variants[].attributes[].attribute_item_id` | `string` | Да |  |
| `organizations` | `object[]` | Нет | Required unless `is_variant` is true. |
| `organizations[].organization_id` | `string` | Да |  |
| `organizations[].is_available` | `boolean` | Да |  |
| `organizations[].max_stock` | `number` | Нет |  |
| `organizations[].yellow_line` | `number` | Нет |  |
| `organizations[].red_line` | `number` | Нет |  |
| `organizations[].standard` | `number` | Нет |  |
| `organizations[].is_available_for_sale` | `boolean` | Нет |  |
| `organizations[].prices` | `object[]` | Нет | list of prices with optional UOM prices |
| `organizations[].prices[].price_id` | `string` | Да |  |
| `organizations[].prices[].amount` | `number` | Нет |  |
| `organizations[].prices[].uom_prices` | `object[]` | Нет |  |
| `organizations[].warehouses` | `object[]` | Нет |  |
| `organizations[].warehouses[].warehouse_id` | `string` | Да |  |
| `organizations[].warehouses[].max_stock` | `number` | Нет |  |
| `organizations[].warehouses[].yellow_line` | `number` | Нет |  |
| `organizations[].warehouses[].red_line` | `number` | Нет |  |
| `organizations[].warehouses[].standard` | `number` | Нет | По умолчанию: `10` |
| `organizations[].service_cost` | `number` | Нет |  |
| `organizations[].service_cost_currency_id` | `string` | Нет | Required when `service_cost` is set. |
| `note` | `string` | Нет |  |
| `supplier_id` | `string` | Нет |  |
| `max_stock` | `number` | Нет |  |
| `images` | `string[]` | Нет |  |
| `is_service` | `boolean` | Нет | По умолчанию: `false` |
| `apply_tax` | `boolean` | Нет | По умолчанию: `false` |
| `apply_discount` | `boolean` | Нет | По умолчанию: `false` |
| `service_cost_id` | `string` | Нет |  |
| `custom_fields` | `object` | Нет | Custom-field values. |
| `custom_fields._id` | `string` | Да |  |
| `custom_fields.value` | `any` | Нет | Field value; its type depends on the custom field. |
| `measure_ratios` | `object[]` | Нет |  |
| `measure_ratios[].measure_id` | `string` | Да |  |
| `measure_ratios[].ratio` | `number` | Да |  |
| `measure_ratios[].barcode` | `string` | Нет |  |

```json
{
  "_id": "string",
  "name": "string",
  "measure_id": "string",
  "category_id": "string",
  "box_type_id": "string",
  "box_item": 0,
  "box_item_barcode": "string",
  "sku": "string",
  "barcode": "string",
  "supplier_ids": [
    "string"
  ],
  "warehouse_number": "string",
  "image": "string",
  "materials": [
    {
      "material_id": "string",
      "amount": 0,
      "box_count": 0
    }
  ],
  "barcodes": [
    {
      "is_active": false,
      "barcode": "string"
    }
  ],
  "is_semi_product": false,
  "is_product": false,
  "is_material": false,
  "dimension": {
    "shape": "circular",
    "netto_weight": 0,
    "gross_weight": 0,
    "height": 0,
    "volume": 0,
    "diameter": 0,
    "width": 0,
    "length": 0
  },
  "variants": [
    {
      "_id": "string",
      "sku": "string",
      "barcode": "string",
      "image": false,
      "organizations": [],
      "attributes": []
    }
  ],
  "organizations": [
    {
      "organization_id": "string",
      "is_available": false,
      "max_stock": 0,
      "yellow_line": 0,
      "red_line": 0,
      "standard": 0,
      "is_available_for_sale": false,
      "prices": [],
      "warehouses": [],
      "service_cost": 0,
      "service_cost_currency_id": "64b7f4d9e2b3b6a0b7c5d7ff"
    }
  ],
  "note": "string",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "max_stock": 0,
  "images": [
    "string"
  ],
  "is_service": false,
  "apply_tax": false,
  "apply_discount": false,
  "service_cost_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "custom_fields": {
    "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "value": null
  },
  "measure_ratios": [
    {
      "measure_id": "64b7f4d9e2b3b6a0b7c5d7ff",
      "ratio": 0,
      "barcode": "string"
    }
  ]
}
```

**Ответ**

Структура ответа совпадает с [POST /product/create](#post-product-create).

## DELETE /product/delete/{id}

Delete a product

**Нужное разрешение:** `product_delete` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/product/delete/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/delete/6712f0a9c4d1e87b3a0f9911', {
  method: 'DELETE',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "DELETE",
    "https://api.bito.uz/integration-api/integration/api/v2/product/delete/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/delete/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Параметры пути**

| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
| `id` | `string` | Да |  |

**Тело запроса**

Тело запроса не требуется.

**Ответ**

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "ok",
  "time": "2025-05-01T12:00:00Z"
}
```

## GET /product/get-by-id/{id}

Get product using its _id

**Нужное разрешение:** `product` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/product/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/get-by-id/6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/product/get-by-id/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/get-by-id/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Параметры пути**

| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
| `id` | `string` | Да |  |

**Тело запроса**

Тело запроса не требуется.

**Ответ**

Структура ответа совпадает с [POST /product/create](#post-product-create).

## POST /product/get-paging

Get products by paging

**Нужное разрешение:** `product` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/product/get-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/get-paging', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 1,
    "limit": 20
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/product/get-paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/get-paging');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `page` | `number` | Да | По умолчанию: `1` |
| `limit` | `number` | Да | По умолчанию: `20` |
| `organization_id` | `string` | Нет |  |
| `is_main` | `boolean` | Нет |  |
| `category_id` | `string` | Нет |  |
| `is_archived` | `boolean` | Нет |  |
| `is_compound` | `boolean` | Нет |  |
| `is_semi_product` | `boolean` | Нет |  |
| `is_product` | `boolean` | Нет |  |
| `is_material` | `boolean` | Нет |  |
| `updated_at` | `string` | Нет | ISO time format |
| `price_id` | `string` | Нет | Price list to fill each row's prices from. Prices come back only when organization_id is sent too. |
| `is_available_for_sale` | `boolean` | Нет |  |
| `is_service` | `boolean` | Нет |  |
| `has_expiration` | `boolean` | Нет |  |
| `has_amount` | `boolean` | Нет |  |
| `search` | `string` | Нет | Free-text search. |

```json
{
  "page": 1,
  "limit": 20,
  "organization_id": "string",
  "is_main": false,
  "category_id": "string",
  "is_archived": false,
  "is_compound": false,
  "is_semi_product": false,
  "is_product": false,
  "is_material": false,
  "updated_at": "string",
  "price_id": "string",
  "is_available_for_sale": false,
  "is_service": false,
  "has_expiration": false,
  "has_amount": false,
  "search": "string"
}
```

**Ответ**

`data.total` — общее количество записей, `data.data[]` — записи текущей страницы. Таблица ниже описывает одну запись.

| Поле | Тип | Описание |
|---|---|---|
| `_id` | `string` | id of product |
| `created_at` | `string` |  |
| `updated_at` | `string` |  |
| `name` | `string` |  |
| `number` | `string` |  |
| `note` | `string` |  |
| `box_item` | `number` |  |
| `box_item_barcode` | `string` |  |
| `box_type_id` | `string` |  |
| `box_type` | `object` |  |
| `box_type._id` | `string` |  |
| `box_type.code` | `string` |  |
| `box_type.short_name` | `string` |  |
| `box_type.name` | `string` |  |
| `measure` | `object` |  |
| `measure._id` | `string` |  |
| `measure.system_code` | `string` |  |
| `measure.code` | `string` |  |
| `measure.short_name` | `string` |  |
| `measure.name` | `string` |  |
| `measure.decimal_count` | `number` |  |
| `sku` | `string` |  |
| `barcode` | `string` |  |
| `barcodes` | `object[]` | list of barcodes of product |
| `barcodes[].is_active` | `boolean` |  |
| `barcodes[].barcode` | `string` |  |
| `supplier_ids` | `string[]` | list of supplier ids |
| `warehouse_number` | `string` | Product's location in the warehouse (aisle/shelf/bin label). Absent when not set. |
| `image` | `string` | image path of product that uploaded to the server |
| `materials` | `object[]` | list of materials of product. required if is_compound is true |
| `materials[].material_id` | `string` |  |
| `materials[].amount` | `number` |  |
| `materials[].box_count` | `integer` |  |
| `materials[].material` | `object` |  |
| `materials[].material._id` | `string` |  |
| `materials[].material.name` | `string` |  |
| `materials[].material.sku` | `string` |  |
| `is_compound` | `boolean` | is compound product or not |
| `is_marked` | `boolean` | is marked or not |
| `is_product` | `boolean` | is product or not. По умолчанию: `false` |
| `is_material` | `boolean` | is material or not. По умолчанию: `false` |
| `is_semi_product` | `boolean` | is semi product or not. По умолчанию: `false` |
| `dimension` | `object` | dimension of product |
| `dimension.shape` | `string` | Допустимые значения: `circular`, `rectangular`, `other` |
| `dimension.netto_weight` | `number` |  |
| `dimension.gross_weight` | `number` |  |
| `dimension.height` | `number` |  |
| `dimension.volume` | `number` |  |
| `dimension.diameter` | `number` |  |
| `dimension.width` | `number` |  |
| `dimension.length` | `number` |  |
| `is_variant` | `boolean` | is variant or not |
| `is_parent` | `boolean` | is parent or not |
| `attributes` | `object[]` |  |
| `attributes[].attribute_id` | `string` |  |
| `attributes[].attribute_item_id` | `string` |  |
| `parent_id` | `string` | id of parent product. it depends on variant product |
| `organizations` | `object[]` |  |
| `organizations[].organization_id` | `string` |  |
| `organizations[].is_available` | `boolean` |  |
| `organizations[].max_stock` | `number` |  |
| `organizations[].yellow_line` | `number` |  |
| `organizations[].red_line` | `number` |  |
| `organizations[].standard` | `number` |  |
| `organizations[].is_available_for_sale` | `boolean` |  |
| `organizations[].prices` | `object[]` | list of prices with optional UOM prices |
| `organizations[].prices[].price_id` | `string` |  |
| `organizations[].prices[].amount` | `number` |  |
| `organizations[].prices[].uom_prices` | `object[]` |  |
| `tax_ids` | `string[]` | list of tax ids |
| `discount_ids` | `string[]` | list of discount ids |
| `category` | `object` |  |
| `category._id` | `string` |  |
| `category.name` | `string` |  |
| `custom_fields` | `object[]` |  |
| `custom_fields[]._id` | `string` |  |
| `custom_fields[].value` | `string` |  |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "67b486d242ed76693cd2cc59",
        "created_at": "2023-10-01T12:00:00Z",
        "updated_at": "2023-10-01T12:00:00Z",
        "name": "string",
        "number": "string",
        "note": "string",
        "box_item": 0,
        "box_item_barcode": "string",
        "box_type_id": "67b486d242ed76693cd2cc59",
        "box_type": {
          "_id": "67b486d242ed76693cd2cc59",
          "code": "string",
          "short_name": "string",
          "name": "string"
        },
        "measure": {
          "_id": "67b486d242ed76693cd2cc59",
          "system_code": "string",
          "code": "string",
          "short_name": "string",
          "name": "string",
          "decimal_count": 0
        },
        "sku": "string",
        "barcode": "string",
        "barcodes": [
          {
            "is_active": false,
            "barcode": "string"
          }
        ],
        "supplier_ids": [
          "string"
        ],
        "warehouse_number": "string",
        "image": "string",
        "materials": [
          {
            "material_id": "67b486d242ed76693cd2cc59",
            "amount": 0,
            "box_count": 0,
            "material": {
              "_id": null,
              "name": null,
              "sku": null
            }
          }
        ],
        "is_compound": false,
        "is_marked": false,
        "is_product": false,
        "is_material": false,
        "is_semi_product": false,
        "dimension": {
          "shape": "circular",
          "netto_weight": 0,
          "gross_weight": 0,
          "height": 0,
          "volume": 0,
          "diameter": 0,
          "width": 0,
          "length": 0
        },
        "is_variant": false,
        "is_parent": false,
        "attributes": [
          {
            "attribute_id": "string",
            "attribute_item_id": "string"
          }
        ],
        "parent_id": "67b486d242ed76693cd2cc59",
        "organizations": [
          {
            "organization_id": "67b486d242ed76693cd2cc59",
            "is_available": false,
            "max_stock": 0,
            "yellow_line": 0,
            "red_line": 0,
            "standard": 0,
            "is_available_for_sale": false,
            "prices": []
          }
        ],
        "tax_ids": [
          "string"
        ],
        "discount_ids": [
          "string"
        ],
        "category": {
          "_id": "67b486d242ed76693cd2cc59",
          "name": "string"
        },
        "custom_fields": [
          {
            "_id": "67b486d242ed76693cd2cc59",
            "value": "string"
          }
        ]
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## GET /product/get-deleted

Get deleted product ids

**Нужное разрешение:** `product` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/product/get-deleted?deleted_at=DELETED_AT' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/get-deleted?deleted_at=DELETED_AT', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/product/get-deleted?deleted_at=DELETED_AT",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/get-deleted?deleted_at=DELETED_AT');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Параметры запроса**

| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
| `deleted_at` | `string` | Да |  |

**Тело запроса**

Тело запроса не требуется.

**Ответ**

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    "string"
  ],
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /product/get-paging/by-price

Paginated list of products with prices for a specific price list.

**Нужное разрешение:** `product` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/product/get-paging/by-price' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/get-paging/by-price', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 1,
    "limit": 20
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/product/get-paging/by-price",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/get-paging/by-price');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `page` | `number` | Да | По умолчанию: `1` |
| `limit` | `number` | Да | По умолчанию: `20` |
| `price_id` | `string` | Нет | Price list to fetch prices from. |
| `search` | `string` | Нет |  |
| `is_main` | `boolean` | Нет |  |
| `is_compound` | `boolean` | Нет |  |
| `is_archived` | `boolean` | Нет |  |
| `is_product` | `boolean` | Нет |  |
| `is_semi_product` | `boolean` | Нет |  |
| `is_service` | `boolean` | Нет |  |
| `has_expiration` | `boolean` | Нет |  |
| `is_material` | `boolean` | Нет |  |
| `organization_id` | `string` | Нет | Organization ObjectId. |
| `category_id` | `string` | Нет |  |
| `is_available_for_sale` | `boolean` | Нет |  |
| `has_amount` | `boolean` | Нет |  |
| `updated_at` | `string (date-time)` | Нет | Only records updated at or after this time. |

```json
{
  "page": 1,
  "limit": 20,
  "price_id": "string",
  "search": "string",
  "is_main": false,
  "is_compound": false,
  "is_archived": false,
  "is_product": false,
  "is_semi_product": false,
  "is_service": false,
  "has_expiration": false,
  "is_material": false,
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "is_available_for_sale": false,
  "has_amount": false,
  "updated_at": "2025-05-01T12:00:00Z"
}
```

**Ответ**

| Поле | Тип | Описание |
|---|---|---|
| `list` | `object[]` |  |
| `list[]._id` | `string` | id of product |
| `list[].created_at` | `string` |  |
| `list[].updated_at` | `string` |  |
| `list[].name` | `string` |  |
| `list[].number` | `string` |  |
| `list[].note` | `string` |  |
| `list[].box_item` | `number` |  |
| `list[].box_item_barcode` | `string` |  |
| `list[].box_type_id` | `string` |  |
| `list[].box_type` | `object` |  |
| `list[].box_type._id` | `string` |  |
| `list[].box_type.code` | `string` |  |
| `list[].box_type.short_name` | `string` |  |
| `list[].box_type.name` | `string` |  |
| `list[].measure` | `object` |  |
| `list[].measure._id` | `string` |  |
| `list[].measure.system_code` | `string` |  |
| `list[].measure.code` | `string` |  |
| `list[].measure.short_name` | `string` |  |
| `list[].measure.name` | `string` |  |
| `list[].measure.decimal_count` | `number` |  |
| `list[].sku` | `string` |  |
| `list[].barcode` | `string` |  |
| `list[].barcodes` | `object[]` | list of barcodes of product |
| `list[].barcodes[].is_active` | `boolean` |  |
| `list[].barcodes[].barcode` | `string` |  |
| `list[].supplier_ids` | `string[]` | list of supplier ids |
| `list[].warehouse_number` | `string` | Product's location in the warehouse (aisle/shelf/bin label). Absent when not set. |
| `list[].image` | `string` | image path of product that uploaded to the server |
| `list[].materials` | `object[]` | list of materials of product. required if is_compound is true |
| `list[].materials[].material_id` | `string` |  |
| `list[].materials[].amount` | `number` |  |
| `list[].materials[].box_count` | `integer` |  |
| `list[].materials[].material` | `object` |  |
| `list[].is_compound` | `boolean` | is compound product or not |
| `list[].is_marked` | `boolean` | is marked or not |
| `list[].is_product` | `boolean` | is product or not. По умолчанию: `false` |
| `list[].is_material` | `boolean` | is material or not. По умолчанию: `false` |
| `list[].is_semi_product` | `boolean` | is semi product or not. По умолчанию: `false` |
| `list[].dimension` | `object` | dimension of product |
| `list[].dimension.shape` | `string` | Допустимые значения: `circular`, `rectangular`, `other` |
| `list[].dimension.netto_weight` | `number` |  |
| `list[].dimension.gross_weight` | `number` |  |
| `list[].dimension.height` | `number` |  |
| `list[].dimension.volume` | `number` |  |
| `list[].dimension.diameter` | `number` |  |
| `list[].dimension.width` | `number` |  |
| `list[].dimension.length` | `number` |  |
| `list[].is_variant` | `boolean` | is variant or not |
| `list[].is_parent` | `boolean` | is parent or not |
| `list[].attributes` | `object[]` |  |
| `list[].attributes[].attribute_id` | `string` |  |
| `list[].attributes[].attribute_item_id` | `string` |  |
| `list[].parent_id` | `string` | id of parent product. it depends on variant product |
| `list[].organizations` | `object[]` |  |
| `list[].organizations[].organization_id` | `string` |  |
| `list[].organizations[].is_available` | `boolean` |  |
| `list[].organizations[].max_stock` | `number` |  |
| `list[].organizations[].yellow_line` | `number` |  |
| `list[].organizations[].red_line` | `number` |  |
| `list[].organizations[].standard` | `number` |  |
| `list[].organizations[].is_available_for_sale` | `boolean` |  |
| `list[].organizations[].prices` | `object[]` | list of prices with optional UOM prices |
| `list[].tax_ids` | `string[]` | list of tax ids |
| `list[].discount_ids` | `string[]` | list of discount ids |
| `list[].category` | `object` |  |
| `list[].category._id` | `string` |  |
| `list[].category.name` | `string` |  |
| `list[].custom_fields` | `object[]` |  |
| `list[].custom_fields[]._id` | `string` |  |
| `list[].custom_fields[].value` | `string` |  |
| `total` | `number` |  |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "list": [
      {
        "_id": "67b486d242ed76693cd2cc59",
        "created_at": "2023-10-01T12:00:00Z",
        "updated_at": "2023-10-01T12:00:00Z",
        "name": "string",
        "number": "string",
        "note": "string",
        "box_item": 0,
        "box_item_barcode": "string",
        "box_type_id": "67b486d242ed76693cd2cc59",
        "box_type": {
          "_id": null,
          "code": null,
          "short_name": null,
          "name": null
        },
        "measure": {
          "_id": null,
          "system_code": null,
          "code": null,
          "short_name": null,
          "name": null,
          "decimal_count": null
        },
        "sku": "string",
        "barcode": "string",
        "barcodes": [],
        "supplier_ids": [],
        "warehouse_number": "string",
        "image": "string",
        "materials": [],
        "is_compound": false,
        "is_marked": false,
        "is_product": false,
        "is_material": false,
        "is_semi_product": false,
        "dimension": {
          "shape": null,
          "netto_weight": null,
          "gross_weight": null,
          "height": null,
          "volume": null,
          "diameter": null,
          "width": null,
          "length": null
        },
        "is_variant": false,
        "is_parent": false,
        "attributes": [],
        "parent_id": "67b486d242ed76693cd2cc59",
        "organizations": [],
        "tax_ids": [],
        "discount_ids": [],
        "category": {
          "_id": null,
          "name": null
        },
        "custom_fields": []
      }
    ],
    "total": 0
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /product/get-by-name

Find a product by its exact name.

**Нужное разрешение:** `product` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/product/get-by-name' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "price_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/get-by-name', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string",
    "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "price_id": "64b7f4d9e2b3b6a0b7c5d7ff"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/product/get-by-name",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
        "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "price_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "name": "string",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "price_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/get-by-name');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `name` | `string` | Нет |  |
| `organization_id` | `string` | Нет | Organization ObjectId. |
| `price_id` | `string` | Нет |  |

```json
{
  "name": "string",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "price_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
```

**Ответ**

Структура ответа совпадает с [POST /product/create](#post-product-create).

## POST /product/get-by-barcode

Find a product by its barcode within an organization.

**Нужное разрешение:** `product` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/product/get-by-barcode' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "barcode": "string",
  "organization_id": "string"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/get-by-barcode', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "barcode": "string",
    "organization_id": "string"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/product/get-by-barcode",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "barcode": "string",
        "organization_id": "string",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "barcode": "string",
  "organization_id": "string"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/get-by-barcode');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `barcode` | `string` | Да | barcode of product to look up |
| `organization_id` | `string` | Да | organization ObjectId to scope the lookup |

```json
{
  "barcode": "string",
  "organization_id": "string"
}
```

**Ответ**

Структура ответа совпадает с [POST /product/create](#post-product-create).

## POST /product/get-by-sku

Find a product by its SKU within an organization.

**Нужное разрешение:** `product` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/product/get-by-sku' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "sku": "string",
  "organization_id": "string"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/get-by-sku', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "sku": "string",
    "organization_id": "string"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/product/get-by-sku",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "sku": "string",
        "organization_id": "string",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "sku": "string",
  "organization_id": "string"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/get-by-sku');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `sku` | `string` | Да | local unique id (SKU) of product to look up |
| `organization_id` | `string` | Да | organization ObjectId to scope the lookup |

```json
{
  "sku": "string",
  "organization_id": "string"
}
```

**Ответ**

Структура ответа совпадает с [POST /product/create](#post-product-create).

## POST /product/delete-many

Soft-delete multiple products by their ObjectIds. Each product is marked is_deleted=true; no physical deletion occurs. Products that are currently in stock, in transit, on-the-way, or booked cannot be deleted and will return an error.

**Нужное разрешение:** `product_delete` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/product/delete-many' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "ids": [
    "string"
  ]
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/delete-many', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "ids": [
      "string"
    ]
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/product/delete-many",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "ids": [
            "string",
        ],
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "ids": [
    "string"
  ]
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/delete-many');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `ids` | `string[]` | Да | List of product ObjectIds to soft-delete |

```json
{
  "ids": [
    "string"
  ]
}
```

**Ответ**

Структура ответа совпадает с [GET /product/get-deleted](#get-product-get-deleted).

## POST /product/update-status-many

Archive or unarchive multiple products by their ObjectIds. Set is_archived=true to archive, false to unarchive. Archived products remain visible but are excluded from active product lookups by default.

**Нужное разрешение:** `product_update` · [как работают разрешения](https://docs.bito.uz/ru/api/permissions.md)

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

::: code-group

```bash [curl]
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/product/update-status-many' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "ids": [
    "string"
  ]
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product/update-status-many', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "ids": [
      "string"
    ]
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/product/update-status-many",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "ids": [
            "string",
        ],
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "ids": [
    "string"
  ]
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product/update-status-many');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Тело запроса**

| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
| `ids` | `string[]` | Да | List of product ObjectIds to archive or unarchive |
| `is_archived` | `boolean` | Нет | true to archive the products, false to unarchive them. Defaults to true when omitted. |

```json
{
  "ids": [
    "string"
  ],
  "is_archived": false
}
```

**Ответ**

Структура ответа совпадает с [GET /product/get-deleted](#get-product-get-deleted).

---

*Эта страница сгенерирована из спецификации OpenAPI.*
