Skip to content
Markdown

Product stock ​

INFO

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

POST /product-stock/get-paging ​

Get product-stocks by paging

Нужное разрешение: product_stock · как работают разрешения

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/product-stock/get-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product-stock/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
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/product-stock/get-paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product-stock/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);

Тело запроса

ПолеТипОбязательноОписание
pagenumberДаПо умолчанию: 1
limitnumberДаПо умолчанию: 20
organization_idstringНет
warehouse_idstringНет
product_idstringНет
statesstring[]Нет
is_markedbooleanНет
searchstringНет
ninstring[]Нет
purchase_idstringНет
trade_idstringНет
category_idstringНет
sortobjectНет
sort.amountbooleanНет
sort.namenumberНетasc 1 , desc -1
update_trade_idstringНет
is_semi_productbooleanНет
is_productbooleanНет
is_materialbooleanНет
is_main_warehousebooleanНет
updated_atstring (date-time)НетOnly records updated at or after this time.
json
{
  "page": 1,
  "limit": 20,
  "organization_id": "string",
  "warehouse_id": "string",
  "product_id": "string",
  "states": [
    "string"
  ],
  "is_marked": false,
  "search": "string",
  "nin": [
    "string"
  ],
  "purchase_id": "string",
  "trade_id": "string",
  "category_id": "string",
  "sort": {
    "amount": false,
    "name": 0
  },
  "update_trade_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "is_semi_product": false,
  "is_product": false,
  "is_material": false,
  "is_main_warehouse": false,
  "updated_at": "2025-05-01T12:00:00Z"
}

Ответ

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

ПолеТипОписание
productobject
product._idstring
product.measureobject
product.measure._idstring
product.measure.system_codestring
product.measure.codestring
product.measure.short_namestring
product.measure.namestring
product.measure.decimal_countnumber
product.namestring
product.barcodestring
product.skustring
product.box_itemnumber
product.box_typeobject
product.box_type._idstring
product.box_type.codestring
product.box_type.short_namestring
product.box_type.namestring
purchase_idstring
trade_idstring
organizationobject
organization._idstring
organization.namestring
warehouseobject
warehouse._idstring
warehouse.namestring
statestring
markstring
costnumber
amountnumber
cost_currency_idstring
initial_costnumber
initial_cost_currency_idstring
created_atstring
updated_atstring
income_idstring
revision_idstring
transfer_idstring
write_off_idstring
purchase_return_idstring
production_operation_idstring
operation_item_idstring
totalnumber
income_datestring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "product": {
          "_id": "string",
          "measure": {
            "_id": "string",
            "system_code": "string",
            "code": "string",
            "short_name": "string",
            "name": "string",
            "decimal_count": 0
          },
          "name": "string",
          "barcode": "string",
          "sku": "string",
          "box_item": 0,
          "box_type": {
            "_id": "string",
            "code": "string",
            "short_name": "string",
            "name": "string"
          }
        },
        "purchase_id": "string",
        "trade_id": "string",
        "organization": {
          "_id": "string",
          "name": "string"
        },
        "warehouse": {
          "_id": "string",
          "name": "string"
        },
        "state": "string",
        "mark": "string",
        "cost": 0,
        "amount": 0,
        "cost_currency_id": "string",
        "initial_cost": 0,
        "initial_cost_currency_id": "string",
        "created_at": "string",
        "updated_at": "string",
        "income_id": "string",
        "revision_id": "string",
        "transfer_id": "string",
        "write_off_id": "string",
        "purchase_return_id": "string",
        "production_operation_id": "string",
        "operation_item_id": "string",
        "total": 0,
        "income_date": "string"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

POST /product-stock/get-by-mark ​

Get the product that a marked (serial/IMEI) stock belongs to, enriched for sale (prices, taxes, available quantity). When warehouse_id is omitted, the organization's main warehouse is used. Returns a not-found error if no stock matches the mark.

Нужное разрешение: product_stock · как работают разрешения

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/product-stock/get-by-mark' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "mark": "string"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/product-stock/get-by-mark', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "mark": "string"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/product-stock/get-by-mark",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "mark": "string",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "mark": "string"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/product-stock/get-by-mark');
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);

Тело запроса

ПолеТипОбязательноОписание
markstringДаMark (serial/IMEI) of the marked product-stock to look up
organization_idstringНетOrganization id the stock belongs to
warehouse_idstringНетWarehouse id. When omitted, the organization's main warehouse is used
statesstring[]НетOptional product-stock states to filter by (e.g. stock, sold)
statestringНетДопустимые значения: stock, in_transit, trash, sold, booked, on_the_way, deleted, used
json
{
  "mark": "string",
  "organization_id": "string",
  "warehouse_id": "string",
  "states": [
    "string"
  ],
  "state": "stock"
}

Ответ

ПолеТипОписание
_idstring
namestring
skustring
barcodestring
imagestring
measure_idstring
measureobject
box_itemnumber
is_markedboolean
is_compoundboolean
is_serviceboolean
categoryobject
pricesobject[]
taxesobject[]
costnumber
cost_currency_idstring
quantitynumberAvailable amount of the product in the resolved warehouse
parent_idstring
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "name": "string",
    "sku": "string",
    "barcode": "string",
    "image": "string",
    "measure_id": "string",
    "measure": {},
    "box_item": 0,
    "is_marked": false,
    "is_compound": false,
    "is_service": false,
    "category": {},
    "prices": [
      {}
    ],
    "taxes": [
      {}
    ],
    "cost": 0,
    "cost_currency_id": "string",
    "quantity": 0,
    "parent_id": "string"
  },
  "time": "2025-05-01T12:00:00Z"
}

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

Bito 2.0 Integration API