Skip to content
Markdown

Report distribution ​

INFO

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

POST /reports/distribution/get-summary ​

Aggregate distribution KPIs for the window (orders, deliveries, revenue).

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

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/reports/distribution/get-summary' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/distribution/get-summary', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "date_from": "2025-05-01T12:00:00Z",
    "date_to": "2025-05-01T12:00:00Z"
  }),
})
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/distribution/get-summary",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "date_from": "2025-05-01T12:00:00Z",
        "date_to": "2025-05-01T12:00:00Z",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z"
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
organization_idstringНетOrganization ObjectId.
product_category_idstringНет
employee_idsstring[]Нет
customer_idsstring[]Нет
date_fromstring (date-time)ДаStart of the date range.
date_tostring (date-time)ДаEnd of the date range.
json
{
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "employee_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "customer_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z"
}

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {},
  "time": "2025-05-01T12:00:00Z"
}

POST /reports/distribution/get-by-product-category ​

Distribution volume grouped by product category.

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

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/reports/distribution/get-by-product-category' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 0,
  "limit": 0
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/distribution/get-by-product-category', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 0,
    "limit": 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/distribution/get-by-product-category",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 0,
        "limit": 0,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "page": 0,
  "limit": 0
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
organization_idstringНетOrganization ObjectId.
product_category_idstringНет
employee_idsstring[]Нет
customer_idsstring[]Нет
date_fromstring (date-time)НетStart of the date range.
date_tostring (date-time)НетEnd of the date range.
pagenumberДаPage number, starting from 1.
limitnumberДаMaximum number of rows to return.
json
{
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "employee_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "customer_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "page": 0,
  "limit": 0
}

Ответ

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

POST /reports/distribution/get-by-agent-and-type ​

Distribution metrics grouped by (agent, distribution type).

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

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/reports/distribution/get-by-agent-and-type' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/distribution/get-by-agent-and-type', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "date_from": "2025-05-01T12:00:00Z",
    "date_to": "2025-05-01T12:00:00Z"
  }),
})
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/distribution/get-by-agent-and-type",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "date_from": "2025-05-01T12:00:00Z",
        "date_to": "2025-05-01T12:00:00Z",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/distribution/get-by-agent-and-type');
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);

Тело запроса

ПолеТипОбязательноОписание
organization_idstringНетOrganization ObjectId.
product_category_idstringНет
employee_idsstring[]Нет
customer_idsstring[]Нет
date_fromstring (date-time)ДаStart of the date range.
date_tostring (date-time)ДаEnd of the date range.
json
{
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "employee_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "customer_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z"
}

Ответ

Структура ответа совпадает с POST /reports/distribution/get-by-product-category.

POST /reports/distribution/get-by-agent ​

Distribution metrics aggregated by agent (sales rep).

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

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

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/reports/distribution/get-by-agent' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 0,
  "limit": 0
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/distribution/get-by-agent', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 0,
    "limit": 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/distribution/get-by-agent",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 0,
        "limit": 0,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "page": 0,
  "limit": 0
}
JSON;

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

Тело запроса

ПолеТипОбязательноОписание
organization_idstringНетOrganization ObjectId.
product_category_idstringНет
employee_idsstring[]Нет
customer_idsstring[]Нет
date_fromstring (date-time)НетStart of the date range.
date_tostring (date-time)НетEnd of the date range.
pagenumberДаPage number, starting from 1.
limitnumberДаMaximum number of rows to return.
json
{
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "employee_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "customer_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "page": 0,
  "limit": 0
}

Ответ

Структура ответа совпадает с POST /reports/distribution/get-by-product-category.


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

Bito 2.0 Integration API