# Report distribution

::: 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/distribution/get-summary

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

**Required permission:** none — closed to an app that declares permissions · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
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 [JavaScript]
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 [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]
<?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);
```

:::

**Request body**

| Field | Type | Required | Description |
|---|---|---|---|
| `organization_id` | `string` | No | Organization ObjectId. |
| `product_category_id` | `string` | No |  |
| `employee_ids` | `string[]` | No |  |
| `customer_ids` | `string[]` | No |  |
| `date_from` | `string (date-time)` | Yes | Start of the date range. |
| `date_to` | `string (date-time)` | Yes | 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"
}
```

**Response**

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

**Required permission:** none — closed to an app that declares permissions · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
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 [JavaScript]
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 [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]
<?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);
```

:::

**Request body**

| Field | Type | Required | Description |
|---|---|---|---|
| `organization_id` | `string` | No | Organization ObjectId. |
| `product_category_id` | `string` | No |  |
| `employee_ids` | `string[]` | No |  |
| `customer_ids` | `string[]` | No |  |
| `date_from` | `string (date-time)` | No | Start of the date range. |
| `date_to` | `string (date-time)` | No | End of the date range. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `limit` | `number` | Yes | 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
}
```

**Response**

| Field | Type | Description |
|---|---|---|
| `list` | `object[]` |  |
| `total` | `number` |  |

```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).

**Required permission:** none — closed to an app that declares permissions · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
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 [JavaScript]
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 [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]
<?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);
```

:::

**Request body**

| Field | Type | Required | Description |
|---|---|---|---|
| `organization_id` | `string` | No | Organization ObjectId. |
| `product_category_id` | `string` | No |  |
| `employee_ids` | `string[]` | No |  |
| `customer_ids` | `string[]` | No |  |
| `date_from` | `string (date-time)` | Yes | Start of the date range. |
| `date_to` | `string (date-time)` | Yes | 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"
}
```

**Response**

Same response shape as [POST /reports/distribution/get-by-product-category](#post-reports-distribution-get-by-product-category).

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

Distribution metrics aggregated by agent (sales rep).

**Required permission:** none — closed to an app that declares permissions · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
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 [JavaScript]
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 [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]
<?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);
```

:::

**Request body**

| Field | Type | Required | Description |
|---|---|---|---|
| `organization_id` | `string` | No | Organization ObjectId. |
| `product_category_id` | `string` | No |  |
| `employee_ids` | `string[]` | No |  |
| `customer_ids` | `string[]` | No |  |
| `date_from` | `string (date-time)` | No | Start of the date range. |
| `date_to` | `string (date-time)` | No | End of the date range. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `limit` | `number` | Yes | 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
}
```

**Response**

Same response shape as [POST /reports/distribution/get-by-product-category](#post-reports-distribution-get-by-product-category).

---

*This page is generated from the OpenAPI spec.*
