Skip to content
Markdown

Report analysis ​

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 /reports/analysis/abc/by-month ​

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

Kerakli ruxsat: yo‘q — ruxsat e’lon qilgan ilova uchun yopiq · ruxsatlar qanday ishlaydi

So‘rov namunasi

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

So‘rov tanasi

MaydonTurMajburiyTavsif
sale_typestringYo‘qMumkin qiymatlar: receipt, sale_contract, trade
from_datestring (date-time)Yo‘qStart of the reporting window.
to_datestring (date-time)Yo‘qEnd of the reporting window.
organizationsstring[]Yo‘q
employeesstring[]Yo‘q
responsible_idsstring[]Yo‘q
mediator_idsstring[]Yo‘q
fieldstringYo‘qMetric the chart plots.. Mumkin qiymatlar: gross_sales, refund, discount, gift, net_sales, profit. Standart: "gross_sales"
organization_idstringYo‘qOrganization ObjectId.
category_idstringYo‘q
customer_category_idstringYo‘q
supplier_idstringYo‘q
supplier_category_idstringYo‘q
product_idstringYo‘q
product_idsstring[]Yo‘q
contract_idstringYo‘q
report_bystringYo‘qMumkin qiymatlar: created_by, responsible
anumberHa
bnumberHa
cnumberHa
typestringYo‘qMumkin qiymatlar: 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"
}

Javob

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

Kerakli ruxsat: yo‘q — ruxsat e’lon qilgan ilova uchun yopiq · ruxsatlar qanday ishlaydi

So‘rov namunasi

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

So‘rov tanasi

MaydonTurMajburiyTavsif
sale_typestringYo‘qMumkin qiymatlar: receipt, sale_contract, trade
from_datestring (date-time)Yo‘qStart of the reporting window.
to_datestring (date-time)Yo‘qEnd of the reporting window.
organizationsstring[]Yo‘q
employeesstring[]Yo‘q
responsible_idsstring[]Yo‘q
mediator_idsstring[]Yo‘q
fieldstringYo‘qMetric the chart plots.. Mumkin qiymatlar: gross_sales, refund, discount, gift, net_sales, profit. Standart: "gross_sales"
organization_idstringYo‘qOrganization ObjectId.
category_idstringYo‘q
customer_category_idstringYo‘q
supplier_idstringYo‘q
supplier_category_idstringYo‘q
product_idstringYo‘q
product_idsstring[]Yo‘q
contract_idstringYo‘q
report_bystringYo‘qMumkin qiymatlar: created_by, responsible
anumberHa
bnumberHa
cnumberHa
typestringYo‘qMumkin qiymatlar: 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"
}

Javob

Javob tuzilishi quyidagi bilan bir xil: 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).

Kerakli ruxsat: yo‘q — ruxsat e’lon qilgan ilova uchun yopiq · ruxsatlar qanday ishlaydi

So‘rov namunasi

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

So‘rov tanasi

MaydonTurMajburiyTavsif
limitnumberHaMaximum number of rows to return.
pagenumberHaPage number, starting from 1.
organization_idstringYo‘qOrganization ObjectId.
warehouse_idstringYo‘q
category_idstringYo‘q
customer_category_idstringYo‘q
supplier_idstringYo‘q
supplier_category_idstringYo‘q
product_idstringYo‘q
product_idsstring[]Yo‘q
customer_idstringYo‘q
date_fromstring (date-time)Yo‘qStart of the date range.
date_tostring (date-time)Yo‘qEnd of the date range.
sortobjectYo‘q
sort.nameintegerYo‘qMumkin qiymatlar: 1, -1
report_bystringYo‘qMumkin qiymatlar: created_by, responsible
abc_classstringYo‘qMumkin qiymatlar: A, B, C, C-LOSS
xyz_classstringYo‘qMumkin qiymatlar: X, Y, Z, Z-NEW
segmentstringYo‘qMumkin qiymatlar: 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_typestringYo‘qMumkin qiymatlar: 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"
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /reports/analysis/abc/by-month.


Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.

Bito 2.0 Integration API