# Report sales

::: 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/trade/pagin

Paginated list of trades for the reporting window.

**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/trade/pagin' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "limit": 0,
  "page": 0
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/trade/pagin', {
  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 [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/reports/trade/pagin",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "limit": 0,
        "page": 0,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "limit": 0,
  "page": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/trade/pagin');
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 |
|---|---|---|---|
| `limit` | `number` | Yes | Maximum number of rows to return. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `organization_id` | `string` | No | Organization ObjectId. |
| `warehouse_id` | `string` | No |  |
| `customer_category_id` | `string` | No |  |
| `customer_id` | `string` | No |  |
| `date_from` | `string (date-time)` | No | Start of the date range. |
| `date_to` | `string (date-time)` | No | End of the date range. |
| `sort` | `object` | No |  |
| `sort.name` | `integer` | No | One of: `1`, `-1` |
| `state` | `string` | No | One of: `canceled`, `done` |

```json
{
  "limit": 0,
  "page": 0,
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "sort": {
    "name": 1
  },
  "state": "canceled"
}
```

**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/trade/by-product/pagin

Trade aggregation grouped by product.

**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/trade/by-product/pagin' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "limit": 0,
  "page": 0
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/trade/by-product/pagin', {
  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 [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/reports/trade/by-product/pagin",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "limit": 0,
        "page": 0,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "limit": 0,
  "page": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/trade/by-product/pagin');
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 |
|---|---|---|---|
| `limit` | `number` | Yes | Maximum number of rows to return. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `organization_id` | `string` | No | Organization ObjectId. |
| `warehouse_id` | `string` | No |  |
| `category_id` | `string` | No |  |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `customer_id` | `string` | No |  |
| `contract_id` | `string` | No |  |
| `date_from` | `string (date-time)` | No | Start of the date range. |
| `date_to` | `string (date-time)` | No | End of the date range. |
| `sort` | `object` | No |  |
| `sort.name` | `integer` | No | One of: `1`, `-1` |
| `trade_state` | `string` | No | One of: `new`, `in_progress`, `canceled`, `done` |
| `trade_states` | `string[]` | No |  |
| `state` | `string` | No | One of: `canceled`, `done` |

```json
{
  "limit": 0,
  "page": 0,
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "contract_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "sort": {
    "name": 1
  },
  "trade_state": "new",
  "trade_states": [
    "new"
  ],
  "state": "canceled"
}
```

**Response**

Same response shape as [POST /reports/trade/pagin](#post-reports-trade-pagin).

## POST /reports/trade/by-customer/pagin

Trade aggregation grouped by customer.

**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/trade/by-customer/pagin' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "limit": 0,
  "page": 0
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/trade/by-customer/pagin', {
  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 [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/reports/trade/by-customer/pagin",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "limit": 0,
        "page": 0,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "limit": 0,
  "page": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/trade/by-customer/pagin');
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 |
|---|---|---|---|
| `limit` | `number` | Yes | Maximum number of rows to return. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `organization_id` | `string` | No | Organization ObjectId. |
| `warehouse_id` | `string` | No |  |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `customer_id` | `string` | No |  |
| `contract_id` | `string` | No |  |
| `date_from` | `string (date-time)` | No | Start of the date range. |
| `date_to` | `string (date-time)` | No | End of the date range. |
| `sort` | `object` | No |  |
| `sort.name` | `integer` | No | One of: `1`, `-1` |
| `state` | `string` | No | One of: `canceled`, `done` |

```json
{
  "limit": 0,
  "page": 0,
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "contract_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "sort": {
    "name": 1
  },
  "state": "canceled"
}
```

**Response**

Same response shape as [POST /reports/trade/pagin](#post-reports-trade-pagin).

## POST /reports/trade/items/pagin

Paginated list of individual trade line items.

**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/trade/items/pagin' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "limit": 0,
  "page": 0,
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/trade/items/pagin', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "limit": 0,
    "page": 0,
    "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
  }),
})
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/trade/items/pagin",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "limit": 0,
        "page": 0,
        "_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "limit": 0,
  "page": 0,
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/trade/items/pagin');
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 |
|---|---|---|---|
| `limit` | `number` | Yes | Maximum number of rows to return. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `organization_id` | `string` | No | Organization ObjectId. |
| `_id` | `string` | Yes |  |

```json
{
  "limit": 0,
  "page": 0,
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "_id": "64b7f4d9e2b3b6a0b7c5d7ff"
}
```

**Response**

Same response shape as [POST /reports/trade/pagin](#post-reports-trade-pagin).

## POST /reports/sales/items/unsold-paging

Products that have not been sold in the reporting window.

**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/sales/items/unsold-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 0
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/items/unsold-paging', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 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/sales/items/unsold-paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 0,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "page": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/items/unsold-paging');
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 |
|---|---|---|---|
| `sale_type` | `string` | No | One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start of the reporting window. |
| `to_date` | `string (date-time)` | No | End of the reporting window. |
| `organizations` | `string[]` | No |  |
| `employees` | `string[]` | No |  |
| `responsible_ids` | `string[]` | No |  |
| `mediator_ids` | `string[]` | No |  |
| `divider` | `string` | No | Time bucket of the chart series.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Metric the chart plots.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `limit` | `number` | No | Maximum number of rows to return. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `organization_id` | `string` | No | Organization ObjectId. |
| `warehouse_id` | `string` | No |  |
| `sort_by` | `string` | No | Field name to sort by. |
| `category_id` | `string` | No |  |
| `customer_category_id` | `string` | No |  |
| `supplier_id` | `string` | No |  |
| `supplier_category_id` | `string` | No |  |
| `asc` | `integer` | No | Sort direction: `1` ascending, `-1` descending.. One of: `1`, `-1`. Default: `-1` |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `customer_id` | `string` | No |  |
| `contract_id` | `string` | No |  |
| `sort` | `object` | No |  |
| `sort.name` | `integer` | No | One of: `1`, `-1` |
| `report_by` | `string` | No | One of: `created_by`, `responsible` |
| `is_product` | `boolean` | No |  |
| `is_material` | `boolean` | No |  |
| `is_semi_product` | `boolean` | No |  |
| `type` | `string` | No | One of: `product`, `customer`, `employee`, `payment`, `category` |
| `min_items_sold` | `number` | No |  |
| `min_gross_sales` | `number` | No |  |
| `product_type` | `string` | No | One of: `is_semi_product`, `is_product`, `is_material`, `is_service` |
| `quantity` | `number` | No |  |
| `min_quantity` | `number` | No |  |
| `stock_status` | `string` | No | One of: `out_of_stock`, `in_stock` |

```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"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "limit": 0,
  "page": 0,
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "sort_by": "string",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "asc": 1,
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "contract_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "sort": {
    "name": 1
  },
  "report_by": "created_by",
  "is_product": false,
  "is_material": false,
  "is_semi_product": false,
  "type": "product",
  "min_items_sold": 0,
  "min_gross_sales": 0,
  "product_type": "is_semi_product",
  "quantity": 0,
  "min_quantity": 0,
  "stock_status": "out_of_stock"
}
```

**Response**

Same response shape as [POST /reports/trade/pagin](#post-reports-trade-pagin).

## POST /reports/sales/by-employee-pagin

Sales aggregated by employee (salesperson).

**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/sales/by-employee-pagin' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 0
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-employee-pagin', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 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/sales/by-employee-pagin",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 0,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "page": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-employee-pagin');
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 |
|---|---|---|---|
| `sale_type` | `string` | No | One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start of the reporting window. |
| `to_date` | `string (date-time)` | No | End of the reporting window. |
| `organizations` | `string[]` | No |  |
| `employees` | `string[]` | No |  |
| `responsible_ids` | `string[]` | No |  |
| `mediator_ids` | `string[]` | No |  |
| `divider` | `string` | No | Time bucket of the chart series.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Metric the chart plots.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `limit` | `number` | No | Maximum number of rows to return. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `organization_id` | `string` | No | Organization ObjectId. |
| `warehouse_id` | `string` | No |  |
| `sort_by` | `string` | No | Field name to sort by. |
| `category_id` | `string` | No |  |
| `customer_category_id` | `string` | No |  |
| `supplier_id` | `string` | No |  |
| `supplier_category_id` | `string` | No |  |
| `asc` | `integer` | No | Sort direction: `1` ascending, `-1` descending.. One of: `1`, `-1`. Default: `-1` |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `customer_id` | `string` | No |  |
| `contract_id` | `string` | No |  |
| `date_from` | `string (date-time)` | No | Start of the date range. |
| `date_to` | `string (date-time)` | No | End of the date range. |
| `sort` | `object` | No |  |
| `sort.name` | `integer` | No | One of: `1`, `-1` |
| `report_by` | `string` | No | One of: `created_by`, `responsible` |
| `type` | `string` | No | One 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"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "limit": 0,
  "page": 0,
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "sort_by": "string",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "asc": 1,
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "contract_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "sort": {
    "name": 1
  },
  "report_by": "created_by",
  "type": "product"
}
```

**Response**

Same response shape as [POST /reports/trade/pagin](#post-reports-trade-pagin).

## POST /reports/sales/by-payment-method-pagin

Sales aggregated by payment method.

**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/sales/by-payment-method-pagin' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "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"
  ],
  "divider": "hour",
  "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",
  "type": "product"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-payment-method-pagin', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "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"
    ],
    "divider": "hour",
    "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",
    "type": "product"
  }),
})
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/sales/by-payment-method-pagin",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    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",
        ],
        "divider": "hour",
        "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",
        "type": "product",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'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"
  ],
  "divider": "hour",
  "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",
  "type": "product"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-payment-method-pagin');
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 |
|---|---|---|---|
| `sale_type` | `string` | No | One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start of the reporting window. |
| `to_date` | `string (date-time)` | No | End of the reporting window. |
| `organizations` | `string[]` | No |  |
| `employees` | `string[]` | No |  |
| `responsible_ids` | `string[]` | No |  |
| `mediator_ids` | `string[]` | No |  |
| `divider` | `string` | No | Time bucket of the chart series.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Metric the chart plots.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `organization_id` | `string` | No | Organization ObjectId. |
| `category_id` | `string` | No |  |
| `customer_category_id` | `string` | No |  |
| `supplier_id` | `string` | No |  |
| `supplier_category_id` | `string` | No |  |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `contract_id` | `string` | No |  |
| `report_by` | `string` | No | One of: `created_by`, `responsible` |
| `type` | `string` | No | One 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"
  ],
  "divider": "hour",
  "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",
  "type": "product"
}
```

**Response**

Same response shape as [POST /reports/trade/pagin](#post-reports-trade-pagin).

## POST /reports/sales/by-category-pagin

Sales aggregated 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/sales/by-category-pagin' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 0
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-category-pagin', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 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/sales/by-category-pagin",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 0,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "page": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-category-pagin');
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 |
|---|---|---|---|
| `sale_type` | `string` | No | One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start of the reporting window. |
| `to_date` | `string (date-time)` | No | End of the reporting window. |
| `organizations` | `string[]` | No |  |
| `employees` | `string[]` | No |  |
| `responsible_ids` | `string[]` | No |  |
| `mediator_ids` | `string[]` | No |  |
| `divider` | `string` | No | Time bucket of the chart series.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Metric the chart plots.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `limit` | `number` | No | Maximum number of rows to return. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `organization_id` | `string` | No | Organization ObjectId. |
| `warehouse_id` | `string` | No |  |
| `category_id` | `string` | No |  |
| `customer_category_id` | `string` | No |  |
| `supplier_id` | `string` | No |  |
| `supplier_category_id` | `string` | No |  |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `customer_id` | `string` | No |  |
| `contract_id` | `string` | No |  |
| `sort` | `object` | No |  |
| `sort.name` | `integer` | No | One of: `1`, `-1` |
| `report_by` | `string` | No | One of: `created_by`, `responsible` |
| `type` | `string` | No | One 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"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "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",
  "contract_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "sort": {
    "name": 1
  },
  "report_by": "created_by",
  "type": "product"
}
```

**Response**

Same response shape as [POST /reports/trade/pagin](#post-reports-trade-pagin).

## POST /reports/sales/by-category-all

Sales aggregated by category (full / non-paged variant).

**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/sales/by-category-all' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "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",
  "type": "product"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-category-all', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "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",
    "type": "product"
  }),
})
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/sales/by-category-all",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    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",
        "type": "product",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'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",
  "type": "product"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-category-all');
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 |
|---|---|---|---|
| `sale_type` | `string` | No | One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start of the reporting window. |
| `to_date` | `string (date-time)` | No | End of the reporting window. |
| `organizations` | `string[]` | No |  |
| `employees` | `string[]` | No |  |
| `responsible_ids` | `string[]` | No |  |
| `mediator_ids` | `string[]` | No |  |
| `field` | `string` | No | Metric the chart plots.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `organization_id` | `string` | No | Organization ObjectId. |
| `category_id` | `string` | No |  |
| `customer_category_id` | `string` | No |  |
| `supplier_id` | `string` | No |  |
| `supplier_category_id` | `string` | No |  |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `contract_id` | `string` | No |  |
| `report_by` | `string` | No | One of: `created_by`, `responsible` |
| `type` | `string` | No | One 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",
  "type": "product"
}
```

**Response**

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

## POST /reports/sales/by-mediator-pagin

Sales aggregated by mediator (broker / referrer).

**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/sales/by-mediator-pagin' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 0
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-mediator-pagin', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 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/sales/by-mediator-pagin",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 0,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "page": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-mediator-pagin');
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 |
|---|---|---|---|
| `sale_type` | `string` | No | One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start of the reporting window. |
| `to_date` | `string (date-time)` | No | End of the reporting window. |
| `organizations` | `string[]` | No |  |
| `employees` | `string[]` | No |  |
| `responsible_ids` | `string[]` | No |  |
| `mediator_ids` | `string[]` | No |  |
| `divider` | `string` | No | Time bucket of the chart series.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Metric the chart plots.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `limit` | `number` | No | Maximum number of rows to return. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `organization_id` | `string` | No | Organization ObjectId. |
| `warehouse_id` | `string` | No |  |
| `sort_by` | `string` | No | Field name to sort by. |
| `category_id` | `string` | No |  |
| `customer_category_id` | `string` | No |  |
| `supplier_id` | `string` | No |  |
| `supplier_category_id` | `string` | No |  |
| `asc` | `integer` | No | Sort direction: `1` ascending, `-1` descending.. One of: `1`, `-1`. Default: `-1` |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `customer_id` | `string` | No |  |
| `contract_id` | `string` | No |  |
| `sort` | `object` | No |  |
| `sort.name` | `integer` | No | One of: `1`, `-1` |
| `report_by` | `string` | No | One of: `created_by`, `responsible` |
| `type` | `string` | No | One 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"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "limit": 0,
  "page": 0,
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "sort_by": "string",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "supplier_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "asc": 1,
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "contract_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "sort": {
    "name": 1
  },
  "report_by": "created_by",
  "type": "product"
}
```

**Response**

Same response shape as [POST /reports/trade/pagin](#post-reports-trade-pagin).

## POST /reports/sales/by-supplier-pagin

Sales aggregated by supplier (for products sourced from each supplier).

**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/sales/by-supplier-pagin' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 0
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-supplier-pagin', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "page": 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/sales/by-supplier-pagin",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 0,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "page": 0
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/sales/by-supplier-pagin');
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 |
|---|---|---|---|
| `sale_type` | `string` | No | One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start of the reporting window. |
| `to_date` | `string (date-time)` | No | End of the reporting window. |
| `organizations` | `string[]` | No |  |
| `employees` | `string[]` | No |  |
| `responsible_ids` | `string[]` | No |  |
| `mediator_ids` | `string[]` | No |  |
| `divider` | `string` | No | Time bucket of the chart series.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Metric the chart plots.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `limit` | `number` | No | Maximum number of rows to return. |
| `page` | `number` | Yes | Page number, starting from 1. |
| `organization_id` | `string` | No | Organization ObjectId. |
| `warehouse_id` | `string` | No |  |
| `category_id` | `string` | No |  |
| `customer_category_id` | `string` | No |  |
| `supplier_id` | `string` | No |  |
| `supplier_category_id` | `string` | No |  |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `customer_id` | `string` | No |  |
| `contract_id` | `string` | No |  |
| `sort` | `object` | No |  |
| `sort.name` | `integer` | No | One of: `1`, `-1` |
| `report_by` | `string` | No | One of: `created_by`, `responsible` |
| `type` | `string` | No | One 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"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "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",
  "contract_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "sort": {
    "name": 1
  },
  "report_by": "created_by",
  "type": "product"
}
```

**Response**

Same response shape as [POST /reports/trade/pagin](#post-reports-trade-pagin).

## POST /reports/sales/settlements

Sales settlements report (cash-vs-bank / settlement reconciliation).

**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/sales/settlements' \
  -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/sales/settlements', {
  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/sales/settlements",
    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/sales/settlements');
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_ids` | `string[]` | No | Organization ObjectIds. |
| `responsible_id` | `string` | No |  |
| `customer_id` | `string` | No |  |
| `customer_category_id` | `string` | No |  |
| `paid_states` | `string[]` | No |  |
| `page` | `number` | Yes | Page number, starting from 1. |
| `limit` | `number` | Yes | Maximum number of rows to return. |
| `search` | `string` | No | Free-text search. |
| `date_from` | `string (date-time)` | No | Start of the date range. |
| `date_to` | `string (date-time)` | No | End of the date range. |
| `organization_id` | `string` | No | Organization ObjectId. |
| `sort_by` | `string` | No | Field name to sort by. |
| `asc` | `integer` | No | Sort direction: `1` ascending, `-1` descending.. One of: `-1`, `1` |

```json
{
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "customer_category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "paid_states": [
    "fully_paid"
  ],
  "page": 0,
  "limit": 0,
  "search": "string",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "sort_by": "string",
  "asc": -1
}
```

**Response**

Same response shape as [POST /reports/sales/by-category-all](#post-reports-sales-by-category-all).

---

*This page is generated from the OpenAPI spec.*
