Production order
Production orders
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /production-order/create
Create a new production order with its line items.
Нужное разрешение: production · как работают разрешения
Пример запроса
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/production-order/create' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production-order/create', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/production-order/create",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0,
},
],
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production-order/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);Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
organization_id | string | Да | Organization ObjectId the production order belongs to |
date | string (date-time) | Да | Production order date (ISO 8601) |
code | string | Нет | Optional human-readable order code |
note | string | Нет | Optional free-text note |
items | object[] | Да | Line items — each references a product and a tech-map |
items[].product_id | string | Да | Product ObjectId to be produced |
items[].tech_map_id | string | Да | Technical map (recipe/BOM) ObjectId to use |
items[].amount | number | Да | Planned production quantity |
{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"code": "string",
"note": "string",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}Ответ
| Поле | Тип | Описание |
|---|---|---|
organization_id | string | Organization ObjectId the production order belongs to |
date | string (date-time) | Production order date (ISO 8601) |
code | string | Optional human-readable order code |
note | string | Optional free-text note |
items | object[] | Line items — each references a product and a tech-map |
items[].product_id | string | Product ObjectId to be produced |
items[].tech_map_id | string | Technical map (recipe/BOM) ObjectId to use |
items[].amount | number | Planned production quantity |
_id | string | Production order ObjectId |
status | string | Current production order state |
is_deleted | boolean | Soft-delete flag |
created_at | string (date-time) | Creation timestamp (ISO 8601) |
updated_at | string (date-time) | Last update timestamp (ISO 8601) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"code": "string",
"note": "string",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
],
"_id": "string",
"status": "string",
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
},
"time": "2025-05-01T12:00:00Z"
}GET /production-order/get-by-id/{id}
Fetch a single production order by ObjectId.
Нужное разрешение: production · как работают разрешения
Пример запроса
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/production-order/get-by-id/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production-order/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/production-order/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/production-order/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 | Да | Production-order ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
Структура ответа совпадает с POST /production-order/create.
POST /production-order/get-paging
Paginated list of production orders, filterable by organization.
Нужное разрешение: production · как работают разрешения
Пример запроса
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/production-order/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/production-order/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/production-order/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/production-order/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 | Нет | Filter by organization ObjectId |
search | string | Нет | Free-text search. |
updated_at | string (date-time) | Нет | Only records updated at or after this time. |
{
"page": 1,
"limit": 20,
"organization_id": "string",
"search": "string",
"updated_at": "2025-05-01T12:00:00Z"
}Ответ
| Поле | Тип | Описание |
|---|---|---|
total | number | |
list | object[] | |
list[].organization_id | string | Organization ObjectId the production order belongs to |
list[].date | string (date-time) | Production order date (ISO 8601) |
list[].code | string | Optional human-readable order code |
list[].note | string | Optional free-text note |
list[].items | object[] | Line items — each references a product and a tech-map |
list[].items[].product_id | string | Product ObjectId to be produced |
list[].items[].tech_map_id | string | Technical map (recipe/BOM) ObjectId to use |
list[].items[].amount | number | Planned production quantity |
list[]._id | string | Production order ObjectId |
list[].status | string | Current production order state |
list[].is_deleted | boolean | Soft-delete flag |
list[].created_at | string (date-time) | Creation timestamp (ISO 8601) |
list[].updated_at | string (date-time) | Last update timestamp (ISO 8601) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"list": [
{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"code": "string",
"note": "string",
"items": [],
"_id": "string",
"status": "string",
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
}
]
},
"time": "2025-05-01T12:00:00Z"
}PUT /production-order/update/{id}
Update an existing production order and its line items.
Нужное разрешение: production · как работают разрешения
Пример запроса
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/production-order/update/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production-order/update/6712f0a9c4d1e87b3a0f9911', {
method: 'PUT',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"PUT",
"https://api.bito.uz/integration-api/integration/api/v2/production-order/update/6712f0a9c4d1e87b3a0f9911",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0,
},
],
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production-order/update/6712f0a9c4d1e87b3a0f9911');
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 | Да | Production-order ObjectId |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
organization_id | string | Да | Organization ObjectId the production order belongs to |
date | string (date-time) | Да | Production order date (ISO 8601) |
code | string | Нет | Optional human-readable order code |
note | string | Нет | Optional free-text note |
items | object[] | Да | Replacement line items for the order |
items[].product_id | string | Да | Product ObjectId to be produced |
items[].tech_map_id | string | Да | Technical map (recipe/BOM) ObjectId to use |
items[].amount | number | Да | Planned production quantity |
{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"code": "string",
"note": "string",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}Ответ
Структура ответа совпадает с POST /production-order/create.
DELETE /production-order/delete/{id}
Soft-delete a production order by ObjectId.
Нужное разрешение: production · как работают разрешения
Приложению, которое отменяет документ, стоит запросить и production_order_cancel.
Пример запроса
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/production-order/delete/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production-order/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/production-order/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/production-order/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 | Да | Production-order ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}Эта страница сгенерирована из спецификации OpenAPI.