Revision
Stock revisions (inventory counts)
INFO
Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.
POST /revision/create
Create a new products revision (stock inventory count). type is forced to products. created_by is set from the integration principal.
Kerakli ruxsat: revision_customer_cashback_create · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/revision/create' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "string",
"starting_date": "2025-05-01T12:00:00Z",
"responsible_id": "string"
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/revision/create', {
method: 'POST',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"organization_id": "string",
"starting_date": "2025-05-01T12:00:00Z",
"responsible_id": "string"
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"POST",
"https://api.bito.uz/integration-api/integration/api/v2/revision/create",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"organization_id": "string",
"starting_date": "2025-05-01T12:00:00Z",
"responsible_id": "string",
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"organization_id": "string",
"starting_date": "2025-05-01T12:00:00Z",
"responsible_id": "string"
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/revision/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);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
organization_id | string | Ha | Organization ObjectId the revision belongs to |
warehouse_id | string | Yo‘q | Warehouse ObjectId to count stock in (optional — defaults to org's primary warehouse) |
responsible_id | string | Ha | Employee ObjectId responsible for this revision (optional — defaults to the integration principal) |
starting_date | string (date-time) | Ha | Date and time the revision counting period starts (ISO 8601) |
ending_date | string (date-time) | Yo‘q | Optional date and time the counting period ends (ISO 8601) |
description | string | Yo‘q | Optional free-text description or notes |
set_counted | boolean | Yo‘q | When true, pre-populates counted quantities from current stock levels |
category_ids | string[] | Yo‘q | Filter products by category ObjectIds (optional) |
supplier_ids | string[] | Yo‘q | Filter products by supplier ObjectIds (optional) |
additional_ids | string[] | Yo‘q | Additional product ObjectIds to include (optional) |
removed_ids | string[] | Yo‘q | Product ObjectIds to exclude from the revision (optional) |
attachments | object[] | Yo‘q | File attachments (optional) |
balance_type | string | Yo‘q | Required when type is balance.. Mumkin qiymatlar: customer, supplier, employee, cashbox, person |
is_all | boolean | Yo‘q | Standart: false |
{
"organization_id": "string",
"warehouse_id": "string",
"responsible_id": "string",
"starting_date": "2025-05-01T12:00:00Z",
"ending_date": "2025-05-01T12:00:00Z",
"description": "string",
"set_counted": false,
"category_ids": [
"string"
],
"supplier_ids": [
"string"
],
"additional_ids": [
"string"
],
"removed_ids": [
"string"
],
"attachments": [
{}
],
"balance_type": "customer",
"is_all": false
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | |
state | string | Mumkin qiymatlar: pending, in_progress, canceled, done |
number | string | |
starting_date | string (date-time) | |
ending_date | string (date-time) | |
description | string | |
organization_id | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
warehouse_id | string | |
warehouse | object | |
warehouse._id | string | |
warehouse.name | string | |
responsible_id | string | |
responsible | object | |
responsible._id | string | |
responsible.full_name | string | |
responsible.phone_number | string | |
currency | object | |
total_expected | number | |
total_counted | number | |
total_profit | number | |
total_loss | number | |
difference | number | |
profit_list | object[] | |
profit_list[].currency_id | string | |
profit_list[].amount | number | |
loss_list | object[] | |
loss_list[].currency_id | string | |
loss_list[].amount | number | |
attachments | object[] | |
created_at | string (date-time) | |
updated_at | string (date-time) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"state": "pending",
"number": "string",
"starting_date": "2025-05-01T12:00:00Z",
"ending_date": "2025-05-01T12:00:00Z",
"description": "string",
"organization_id": "string",
"organization": {
"_id": "string",
"name": "string"
},
"warehouse_id": "string",
"warehouse": {
"_id": "string",
"name": "string"
},
"responsible_id": "string",
"responsible": {
"_id": "string",
"full_name": "string",
"phone_number": "string"
},
"currency": {},
"total_expected": 0,
"total_counted": 0,
"total_profit": 0,
"total_loss": 0,
"difference": 0,
"profit_list": [
{
"currency_id": "string",
"amount": 0
}
],
"loss_list": [
{
"currency_id": "string",
"amount": 0
}
],
"attachments": [
{}
],
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
},
"time": "2025-05-01T12:00:00Z"
}GET /revision/get-by-id/{id}
Fetch a single revision by ObjectId. Returns full detail including responsible, organization, warehouse, totals, profit_list, loss_list.
Kerakli ruxsat: revision_customer_cashback · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/revision/get-by-id/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY"const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/revision/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/revision/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/revision/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);Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Revision ObjectId |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
Javob tuzilishi quyidagi bilan bir xil: POST /revision/create.
POST /revision/get-paging
Paginated list of product revisions (type is forced to products). Filterable by organization, warehouse, responsible, and state.
Kerakli ruxsat: revision_customer_cashback · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/revision/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/revision/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/revision/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/revision/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);So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
organization_id | string | Yo‘q | Filter by organization ObjectId |
warehouse_id | string | Yo‘q | Filter by warehouse ObjectId |
responsible_id | string | Yo‘q | Filter by responsible employee ObjectId |
state | string | Yo‘q | Filter by revision state. Mumkin qiymatlar: pending, in_progress, canceled, done |
balance_type | string | Yo‘q | Mumkin qiymatlar: customer, supplier, employee, cashbox, person |
state_id | string | Yo‘q | |
search | string | Yo‘q | Free-text search. |
updated_at | string (date-time) | Yo‘q | Only records updated at or after this time. |
date_from | string (date-time) | Yo‘q | Start of the date range. |
date_to | string (date-time) | Yo‘q | End of the date range. |
{
"page": 1,
"limit": 20,
"organization_id": "string",
"warehouse_id": "string",
"responsible_id": "string",
"state": "pending",
"balance_type": "customer",
"state_id": "64b7f4d9e2b3b6a0b7c5d7ff",
"search": "string",
"updated_at": "2025-05-01T12:00:00Z",
"date_from": "2025-05-01T12:00:00Z",
"date_to": "2025-05-01T12:00:00Z"
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
total | number | |
list | object[] | |
list[]._id | string | |
list[].state | string | Mumkin qiymatlar: pending, in_progress, canceled, done |
list[].number | string | |
list[].starting_date | string (date-time) | |
list[].ending_date | string (date-time) | |
list[].description | string | |
list[].organization_id | string | |
list[].organization | object | |
list[].organization._id | string | |
list[].organization.name | string | |
list[].warehouse_id | string | |
list[].warehouse | object | |
list[].warehouse._id | string | |
list[].warehouse.name | string | |
list[].responsible | object | |
list[].responsible._id | string | |
list[].responsible.full_name | string | |
list[].responsible.phone_number | string | |
list[].total_expected | number | |
list[].total_counted | number | |
list[].total_profit | number | |
list[].total_loss | number | |
list[].total_difference | number | |
list[].created_at | string (date-time) | |
list[].updated_at | string (date-time) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"list": [
{
"_id": "string",
"state": "pending",
"number": "string",
"starting_date": "2025-05-01T12:00:00Z",
"ending_date": "2025-05-01T12:00:00Z",
"description": "string",
"organization_id": "string",
"organization": {
"_id": null,
"name": null
},
"warehouse_id": "string",
"warehouse": {
"_id": null,
"name": null
},
"responsible": {
"_id": null,
"full_name": null,
"phone_number": null
},
"total_expected": 0,
"total_counted": 0,
"total_profit": 0,
"total_loss": 0,
"total_difference": 0,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
}
]
},
"time": "2025-05-01T12:00:00Z"
}PUT /revision/update/{id}
Update an existing revision. Only allowed while state is pending; returns AlreadyInProgress otherwise.
Kerakli ruxsat: revision_customer_cashback · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/revision/update/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "string",
"responsible_id": "string",
"starting_date": "2025-05-01T12:00:00Z"
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/revision/update/6712f0a9c4d1e87b3a0f9911', {
method: 'PUT',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"organization_id": "string",
"responsible_id": "string",
"starting_date": "2025-05-01T12:00:00Z"
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"PUT",
"https://api.bito.uz/integration-api/integration/api/v2/revision/update/6712f0a9c4d1e87b3a0f9911",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"organization_id": "string",
"responsible_id": "string",
"starting_date": "2025-05-01T12:00:00Z",
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"organization_id": "string",
"responsible_id": "string",
"starting_date": "2025-05-01T12:00:00Z"
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/revision/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);Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Revision ObjectId to update |
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
organization_id | string | Ha | Organization ObjectId |
warehouse_id | string | Yo‘q | Warehouse ObjectId |
responsible_id | string | Ha | Employee ObjectId responsible for this revision |
starting_date | string (date-time) | Ha | Date and time the revision counting period starts (ISO 8601) |
ending_date | string (date-time) | Yo‘q | Date and time the counting period ends (ISO 8601) |
description | string | Yo‘q | Free-text description or notes |
set_counted | boolean | Yo‘q | Re-populate counted quantities from current stock levels |
category_ids | string[] | Yo‘q | Filter products by category ObjectIds |
supplier_ids | string[] | Yo‘q | Filter products by supplier ObjectIds |
additional_ids | string[] | Yo‘q | Additional product ObjectIds to include |
removed_ids | string[] | Yo‘q | Product ObjectIds to exclude |
attachments | object[] | Yo‘q | File attachments |
balance_type | string | Yo‘q | Required when type is balance.. Mumkin qiymatlar: customer, supplier, employee, cashbox, person |
is_all | boolean | Yo‘q | Standart: false |
{
"organization_id": "string",
"warehouse_id": "string",
"responsible_id": "string",
"starting_date": "2025-05-01T12:00:00Z",
"ending_date": "2025-05-01T12:00:00Z",
"description": "string",
"set_counted": false,
"category_ids": [
"string"
],
"supplier_ids": [
"string"
],
"additional_ids": [
"string"
],
"removed_ids": [
"string"
],
"attachments": [
{}
],
"balance_type": "customer",
"is_all": false
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /revision/create.
PUT /revision/set-status/{id}
Transition a revision to a new state. Valid transitions: pending→in_progress|canceled; in_progress→done|canceled; done→canceled (blocked for products type). DONE triggers stock reconciliation and invoice creation.
Kerakli ruxsat: revision_customer_cashback · ruxsatlar qanday ishlaydi
So‘rov namunasi
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/revision/set-status/6712f0a9c4d1e87b3a0f9911' \
-H "api-key: $BITO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"status": "pending"
}'const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/revision/set-status/6712f0a9c4d1e87b3a0f9911', {
method: 'PUT',
headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"status": "pending"
}),
})
const { code, data } = await res.json()import os
import requests
res = requests.request(
"PUT",
"https://api.bito.uz/integration-api/integration/api/v2/revision/set-status/6712f0a9c4d1e87b3a0f9911",
headers={"api-key": os.environ["BITO_API_KEY"]},
json={
"status": "pending",
},
)
print(res.json())<?php
$body = <<<'JSON'
{
"status": "pending"
}
JSON;
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/revision/set-status/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);Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Revision ObjectId |
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
status | string | Yo‘q | Target state. Transitions: pending→in_progress|canceled; in_progress→done|canceled; done→canceled (blocked for products revisions). Mumkin qiymatlar: pending, in_progress, canceled, done |
{
"status": "pending"
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /revision/create.
Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.