Category
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /category/create
This method allows adding category into the account.
Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения
Пример запроса
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/category/create' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"organization_ids": [
"string"
]
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/category/create', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "string",
"organization_ids": [
"string"
]
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/category/create",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"name": "string",
"organization_ids": [
"string",
],
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"name": "string",
"organization_ids": [
"string"
]
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/category/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 | Да | |
type | string | Нет | type categories. Допустимые значения: product, material, semi_product |
parent_id | string | Нет | id of parent category |
is_available_for_sale | boolean | Нет | is available for sale. По умолчанию: true |
organization_ids | string[] | Да | ids of organization |
image | string | Нет | image path of category that uploaded to the server |
{
"name": "string",
"type": "product",
"parent_id": "string",
"is_available_for_sale": true,
"organization_ids": [
"string"
],
"image": "string"
}Ответ
| Поле | Тип | Описание |
|---|---|---|
_id | string | id of category |
name | string | |
is_main_material | boolean | |
is_available_for_sale | boolean | |
type | string | |
parent_id | string | id of parent category |
organization_ids | string[] | ids of organizations |
child_cound | number | |
item_count | number | count off all child |
count | number | |
image | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"name": "string",
"is_main_material": false,
"is_available_for_sale": false,
"type": "string",
"parent_id": "string",
"organization_ids": [
"string"
],
"child_cound": 0,
"item_count": 0,
"count": 0,
"image": "string"
},
"time": "2025-05-01T12:00:00Z"
}PUT /category/update
This method allows updating category in the account.
Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения
Пример запроса
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/category/update' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"organization_ids": [
"string"
],
"_id": "string"
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/category/update', {
method: 'PUT',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"name": "string",
"organization_ids": [
"string"
],
"_id": "string"
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"PUT",
"https://api.bito.uz/integration-api/integration/api/v2/category/update",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"name": "string",
"organization_ids": [
"string",
],
"_id": "string",
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"name": "string",
"organization_ids": [
"string"
],
"_id": "string"
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/category/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);Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | |
type | string | Нет | type categories. Допустимые значения: product, material, semi_product |
parent_id | string | Нет | id of parent category |
is_available_for_sale | boolean | Нет | is available for sale. По умолчанию: true |
organization_ids | string[] | Да | ids of organization |
image | string | Нет | image path of category that uploaded to the server |
_id | string | Да | id of category |
{
"name": "string",
"type": "product",
"parent_id": "string",
"is_available_for_sale": true,
"organization_ids": [
"string"
],
"image": "string",
"_id": "string"
}Ответ
Структура ответа совпадает с POST /category/create.
DELETE /category/delete/{id}
Delete a category
Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения
Пример запроса
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/category/delete/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/category/delete/6712f0a9c4d1e87b3a0f9911', {
method: 'DELETE',
headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"DELETE",
"https://api.bito.uz/integration-api/integration/api/v2/category/delete/6712f0a9c4d1e87b3a0f9911",
headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/category/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 | Да |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}GET /category/get-by-id/{id}
Get category using its _id
Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения
Пример запроса
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/category/get-by-id/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/category/get-by-id/6712f0a9c4d1e87b3a0f9911', {
method: 'GET',
headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"GET",
"https://api.bito.uz/integration-api/integration/api/v2/category/get-by-id/6712f0a9c4d1e87b3a0f9911",
headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/category/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 /category/create.
POST /category/get-paging
Get categories by paging
Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения
Пример запроса
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/category/get-paging' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"page": 1,
"limit": 20
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/category/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()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/category/get-paging",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"page": 1,
"limit": 20,
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"page": 1,
"limit": 20
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/category/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 |
search | string | Нет | |
top | boolean | Нет | |
updated_at | string (date-time) | Нет | |
organization_id | string | Нет | |
parent_id | string | Нет | |
is_available_for_sale | boolean | Нет |
{
"page": 1,
"limit": 20,
"search": "string",
"top": false,
"updated_at": "2023-10-01T12:00:00Z",
"organization_id": "64b7f4d9e2b3b6a0b7c5d800",
"parent_id": "63f8b0c4e4b0d3a2f8e4b0c4",
"is_available_for_sale": false
}Ответ
data.total — общее количество записей, data.data[] — записи текущей страницы. Таблица ниже описывает одну запись.
| Поле | Тип | Описание |
|---|---|---|
_id | string | id of category |
name | string | |
is_main_material | boolean | |
is_available_for_sale | boolean | |
type | string | |
parent_id | string | id of parent category |
organization_ids | string[] | ids of organizations |
child_cound | number | |
item_count | number | count off all child |
count | number | |
image | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"_id": "string",
"name": "string",
"is_main_material": false,
"is_available_for_sale": false,
"type": "string",
"parent_id": "string",
"organization_ids": [
"string"
],
"child_cound": 0,
"item_count": 0,
"count": 0,
"image": "string"
}
]
},
"time": "2025-05-01T12:00:00Z"
}GET /category/get-deleted
Get deleted category ids
Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения
Пример запроса
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/category/get-deleted?deleted_at=DELETED_AT' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/category/get-deleted?deleted_at=DELETED_AT', {
method: 'GET',
headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"GET",
"https://api.bito.uz/integration-api/integration/api/v2/category/get-deleted?deleted_at=DELETED_AT",
headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/category/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 | Да |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": [
"string"
],
"time": "2025-05-01T12:00:00Z"
}GET /category/get-by-name
Get a category by its exact name.
Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения
Пример запроса
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/category/get-by-name?name=NAME' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/category/get-by-name?name=NAME', {
method: 'GET',
headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"GET",
"https://api.bito.uz/integration-api/integration/api/v2/category/get-by-name?name=NAME",
headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/category/get-by-name?name=NAME');
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);Параметры запроса
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да |
Тело запроса
Тело запроса не требуется.
Ответ
Структура ответа совпадает с POST /category/create.
Эта страница сгенерирована из спецификации OpenAPI.