Skip to content
Markdown

Report analysis ​

INFO

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

POST /reports/analysis/abc/by-month ​

ABC analysis aggregated by month — classifies products into A/B/C buckets by contribution to revenue.

Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/reports/analysis/abc/by-month' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "a": 0,
  "b": 0,
  "c": 0
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/analysis/abc/by-month', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "a": 0,
    "b": 0,
    "c": 0
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/reports/analysis/abc/by-month",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "a": 0,
        "b": 0,
        "c": 0,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "a": 0,
  "b": 0,
  "c": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/analysis/abc/by-month');
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);

Тело запроса

ПолеТипОбязательноОписание
sale_typestringНетДопустимые значения: receipt, sale_contract, trade
from_datestring (date-time)НетStart of the reporting window.
to_datestring (date-time)НетEnd of the reporting window.
organizationsstring[]Нет
employeesstring[]Нет
responsible_idsstring[]Нет
mediator_idsstring[]Нет
fieldstringНетMetric the chart plots.. Допустимые значения: gross_sales, refund, discount, gift, net_sales, profit. По умолчанию: "gross_sales"
organization_idstringНетOrganization ObjectId.
category_idstringНет
customer_category_idstringНет
supplier_idstringНет
supplier_category_idstringНет
product_idstringНет
product_idsstring[]Нет
contract_idstringНет
report_bystringНетДопустимые значения: created_by, responsible
anumberДа
bnumberДа
cnumberДа
typestringНетДопустимые значения: product, customer, employee, payment, category
json
{
  "sale_type": "receipt",
  "from_date": "2025-05-01T12:00:00Z",
  "to_date": "2025-05-01T12:00:00Z",
  "organizations": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "employees": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "mediator_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "field": "gross_sales",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "contract_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "report_by": "created_by",
  "a": 0,
  "b": 0,
  "c": 0,
  "type": "product"
}

Ответ

ПолеТипОписание
listobject[]
totalnumber
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "list": [
      {}
    ],
    "total": 0
  },
  "time": "2025-05-01T12:00:00Z"
}

POST /reports/analysis/abc/by-product ​

ABC analysis aggregated by product over the reporting window.

Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения

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

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

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/reports/analysis/abc/by-product",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "a": 0,
        "b": 0,
        "c": 0,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "a": 0,
  "b": 0,
  "c": 0
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
sale_typestringНетДопустимые значения: receipt, sale_contract, trade
from_datestring (date-time)НетStart of the reporting window.
to_datestring (date-time)НетEnd of the reporting window.
organizationsstring[]Нет
employeesstring[]Нет
responsible_idsstring[]Нет
mediator_idsstring[]Нет
fieldstringНетMetric the chart plots.. Допустимые значения: gross_sales, refund, discount, gift, net_sales, profit. По умолчанию: "gross_sales"
organization_idstringНетOrganization ObjectId.
category_idstringНет
customer_category_idstringНет
supplier_idstringНет
supplier_category_idstringНет
product_idstringНет
product_idsstring[]Нет
contract_idstringНет
report_bystringНетДопустимые значения: created_by, responsible
anumberДа
bnumberДа
cnumberДа
typestringНетДопустимые значения: product, customer, employee, payment, category
json
{
  "sale_type": "receipt",
  "from_date": "2025-05-01T12:00:00Z",
  "to_date": "2025-05-01T12:00:00Z",
  "organizations": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "employees": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "mediator_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "field": "gross_sales",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "contract_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "report_by": "created_by",
  "a": 0,
  "b": 0,
  "c": 0,
  "type": "product"
}

Ответ

Структура ответа совпадает с POST /reports/analysis/abc/by-month.

POST /reports/analysis/customers/abc-xyz ​

ABC/XYZ analysis on customers — combines revenue contribution (ABC) with demand variability (XYZ).

Нужное разрешение: нет — закрыто для приложения, объявившего разрешения · как работают разрешения

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/reports/analysis/customers/abc-xyz' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "limit": 0,
  "page": 0
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/analysis/customers/abc-xyz', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "limit": 0,
    "page": 0
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/reports/analysis/customers/abc-xyz",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "limit": 0,
        "page": 0,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "limit": 0,
  "page": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/analysis/customers/abc-xyz');
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);

Тело запроса

ПолеТипОбязательноОписание
limitnumberДаMaximum number of rows to return.
pagenumberДаPage number, starting from 1.
organization_idstringНетOrganization ObjectId.
warehouse_idstringНет
category_idstringНет
customer_category_idstringНет
supplier_idstringНет
supplier_category_idstringНет
product_idstringНет
product_idsstring[]Нет
customer_idstringНет
date_fromstring (date-time)НетStart of the date range.
date_tostring (date-time)НетEnd of the date range.
sortobjectНет
sort.nameintegerНетДопустимые значения: 1, -1
report_bystringНетДопустимые значения: created_by, responsible
abc_classstringНетДопустимые значения: A, B, C, C-LOSS
xyz_classstringНетДопустимые значения: X, Y, Z, Z-NEW
segmentstringНетДопустимые значения: AX, AY, AZ, AZ-NEW, BX, BY, BZ, BZ-NEW, CX, CY, CZ, CZ-NEW, C-LOSSX, C-LOSSY, C-LOSSZ, C-LOSSZ-NEW
customer_typestringНетДопустимые значения: legal, natural
json
{
  "limit": 0,
  "page": 0,
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "sort": {
    "name": 1
  },
  "report_by": "created_by",
  "abc_class": "A",
  "xyz_class": "X",
  "segment": "AX",
  "customer_type": "legal"
}

Ответ

Структура ответа совпадает с POST /reports/analysis/abc/by-month.


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

Bito 2.0 Integration API