Skip to content
View as Markdown

Report analysis ​

INFO

Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.

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

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

Required permission: none — closed to an app that declares permissions · how permissions work

Example request

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);

Request body

FieldTypeRequiredDescription
sale_typestringNoOne of: receipt, sale_contract, trade
from_datestring (date-time)NoStart of the reporting window.
to_datestring (date-time)NoEnd of the reporting window.
organizationsstring[]No
employeesstring[]No
responsible_idsstring[]No
mediator_idsstring[]No
fieldstringNoMetric the chart plots.. One of: gross_sales, refund, discount, gift, net_sales, profit. Default: "gross_sales"
organization_idstringNoOrganization ObjectId.
category_idstringNo
customer_category_idstringNo
supplier_idstringNo
supplier_category_idstringNo
product_idstringNo
product_idsstring[]No
contract_idstringNo
report_bystringNoOne of: created_by, responsible
anumberYes
bnumberYes
cnumberYes
typestringNoOne of: 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"
}

Response

FieldTypeDescription
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.

Required permission: none — closed to an app that declares permissions · how permissions work

Example request

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);

Request body

FieldTypeRequiredDescription
sale_typestringNoOne of: receipt, sale_contract, trade
from_datestring (date-time)NoStart of the reporting window.
to_datestring (date-time)NoEnd of the reporting window.
organizationsstring[]No
employeesstring[]No
responsible_idsstring[]No
mediator_idsstring[]No
fieldstringNoMetric the chart plots.. One of: gross_sales, refund, discount, gift, net_sales, profit. Default: "gross_sales"
organization_idstringNoOrganization ObjectId.
category_idstringNo
customer_category_idstringNo
supplier_idstringNo
supplier_category_idstringNo
product_idstringNo
product_idsstring[]No
contract_idstringNo
report_bystringNoOne of: created_by, responsible
anumberYes
bnumberYes
cnumberYes
typestringNoOne of: 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"
}

Response

Same response shape as 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).

Required permission: none — closed to an app that declares permissions · how permissions work

Example request

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);

Request body

FieldTypeRequiredDescription
limitnumberYesMaximum number of rows to return.
pagenumberYesPage number, starting from 1.
organization_idstringNoOrganization ObjectId.
warehouse_idstringNo
category_idstringNo
customer_category_idstringNo
supplier_idstringNo
supplier_category_idstringNo
product_idstringNo
product_idsstring[]No
customer_idstringNo
date_fromstring (date-time)NoStart of the date range.
date_tostring (date-time)NoEnd of the date range.
sortobjectNo
sort.nameintegerNoOne of: 1, -1
report_bystringNoOne of: created_by, responsible
abc_classstringNoOne of: A, B, C, C-LOSS
xyz_classstringNoOne of: X, Y, Z, Z-NEW
segmentstringNoOne of: 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_typestringNoOne of: 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"
}

Response

Same response shape as POST /reports/analysis/abc/by-month.


This page is generated from the OpenAPI spec.

Bito 2.0 Integration API