# Report

::: 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 /summary/chart-pagin

Report summary chart paging

**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/summary/chart-pagin' \
  -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/summary/chart-pagin', {
  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/summary/chart-pagin",
    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/summary/chart-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 |
|---|---|---|---|
| `page` | `number (int32)` | Yes | Page number for pagination. |
| `limit` | `number (int32)` | Yes | Maximum number of items to return for pagination. |
| `sale_type` | `string` | No | Type of sale report. Optional for GET requests.. One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
| `to_date` | `string (date-time)` | No | End date for the report in ISO 8601 format. Optional for GET requests. |
| `custom` | `boolean` | No | Indicates if custom time ranges are used. Optional for GET requests. |
| `from_time` | `integer (int32)` | No | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `to_time` | `integer (int32)` | No | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `organizations` | `string (mongo-id)[]` | No | List of organization IDs. Optional for GET requests. |
| `employees` | `string (mongo-id)[]` | No | List of employee IDs. Optional for GET requests. |
| `divider` | `string` | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `organization_id` | `string (mongo-id)` | No | ID of the organization. |
| `sort_by` | `string` | No | Field to sort the results by. |
| `price_id` | `string (mongo-id)` | No | ID of the price list. |
| `category_id` | `string (mongo-id)` | No | ID of the product category. |
| `customer_category_id` | `string (mongo-id)` | No | ID of the customer category. |
| `supplier_id` | `string (mongo-id)` | No | ID of the supplier. |
| `supplier_category_id` | `string (mongo-id)` | No | ID of the supplier category. |
| `asc` | `integer` | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: `1`, `-1`. Default: `-1` |
| `cashbox_id` | `string (mongo-id)` | No | ID of the cashbox. |
| `income_type` | `string` | No | Type of income for the report.. One of: `product_income`, `material_income` |
| `product_id` | `string (mongo-id)` | No | ID of the product. |
| `customer_id` | `string (mongo-id)` | No | ID of the customer. |
| `date_from` | `string (date-time)` | No | Start date for the report in ISO 8601 format. |
| `date_to` | `string (date-time)` | No | End date for the report in ISO 8601 format. |
| `sort` | `object` | No | Sorting parameters for the report. |
| `sort.name` | `integer` | No | Sort order for 'name' field: 1 for ascending, -1 for descending.. One of: `1`, `-1` |
| `report_by` | `string` | No | Criteria to report employees by.. One of: `created_by`, `responsible` |
| `is_product` | `boolean` | No | Indicates if the report includes products. |
| `is_material` | `boolean` | No | Indicates if the report includes materials. |
| `is_semi_product` | `boolean` | No | Indicates if the report includes semi-products. |
| `search` | `string` | No | Search string for filtering results. Optional. |
| `trade_state` | `string` | No | Current state of the trade.. One of: `new`, `draft`, `in_progress`, `canceled`, `done` |
| `trade_states` | `string[]` | No | List of trade states to filter by. |
| `type` | `string` | No | Type of summary report.. One of: `product`, `customer`, `employee`, `payment`, `category` |
| `state` | `string` | No | State of the income.. One of: `canceled`, `done` |
| `min_items_sold` | `number (int32)` | No | Minimum number of items sold. |
| `min_gross_sales` | `number (float)` | No | Minimum gross sales amount. |
| `responsible_ids` | `string[]` | No |  |

```json
{
  "page": 0,
  "limit": 0,
  "sale_type": "receipt",
  "from_date": "2025-05-01T12:00:00Z",
  "to_date": "2025-05-01T12:00:00Z",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "product_id": "string",
  "customer_id": "string",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "sort": {
    "name": 1
  },
  "report_by": "created_by",
  "is_product": false,
  "is_material": false,
  "is_semi_product": false,
  "search": "string",
  "trade_state": "new",
  "trade_states": [
    "new"
  ],
  "type": "product",
  "state": "canceled",
  "min_items_sold": 0,
  "min_gross_sales": 0,
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ]
}
```

**Response**

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "date": "2025-05-01T12:00:00Z",
      "_id": {
        "year": 0,
        "month": 0,
        "day": 0
      },
      "gross_sales": 0,
      "refund": 0,
      "discount": 0,
      "gift": 0,
      "tax": 0,
      "cost": 0,
      "net_sales": 0,
      "profit": 0,
      "included_tax": 0,
      "added_tax": 0,
      "receipts": 0,
      "refunds": 0,
      "items_sold": 0,
      "items_refunded": 0,
      "average_receipt": 0
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /summary/chart

Report summary chart

**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/summary/chart' \
  -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",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/summary/chart', {
  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",
    "custom": false,
    "from_time": 0,
    "to_time": 0,
    "organizations": [
      "string"
    ],
    "employees": [
      "string"
    ],
    "divider": "hour",
    "field": "gross_sales",
    "organization_id": "string",
    "sort_by": "string",
    "price_id": "string",
    "category_id": "string",
    "customer_category_id": "string",
    "supplier_id": "string",
    "supplier_category_id": "string",
    "asc": 1,
    "cashbox_id": "string",
    "income_type": "product_income",
    "report_by": "created_by",
    "search": "string",
    "type": "product",
    "responsible_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "is_product": false,
    "is_material": false,
    "is_semi_product": false
  }),
})
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/summary/chart",
    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",
        "custom": False,
        "from_time": 0,
        "to_time": 0,
        "organizations": [
            "string",
        ],
        "employees": [
            "string",
        ],
        "divider": "hour",
        "field": "gross_sales",
        "organization_id": "string",
        "sort_by": "string",
        "price_id": "string",
        "category_id": "string",
        "customer_category_id": "string",
        "supplier_id": "string",
        "supplier_category_id": "string",
        "asc": 1,
        "cashbox_id": "string",
        "income_type": "product_income",
        "report_by": "created_by",
        "search": "string",
        "type": "product",
        "responsible_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "is_product": False,
        "is_material": False,
        "is_semi_product": False,
    },
)
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",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/summary/chart');
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 | Type of sale report. Optional for GET requests.. One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
| `to_date` | `string (date-time)` | No | End date for the report in ISO 8601 format. Optional for GET requests. |
| `custom` | `boolean` | No | Indicates if custom time ranges are used. Optional for GET requests. |
| `from_time` | `integer (int32)` | No | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `to_time` | `integer (int32)` | No | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `organizations` | `string (mongo-id)[]` | No | List of organization IDs. Optional for GET requests. |
| `employees` | `string (mongo-id)[]` | No | List of employee IDs. Optional for GET requests. |
| `divider` | `string` | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `organization_id` | `string (mongo-id)` | No | ID of the organization. |
| `sort_by` | `string` | No | Field to sort the results by. |
| `price_id` | `string (mongo-id)` | No | ID of the price list. |
| `category_id` | `string (mongo-id)` | No | ID of the product category. |
| `customer_category_id` | `string (mongo-id)` | No | ID of the customer category. |
| `supplier_id` | `string (mongo-id)` | No | ID of the supplier. |
| `supplier_category_id` | `string (mongo-id)` | No | ID of the supplier category. |
| `asc` | `integer` | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: `1`, `-1`. Default: `-1` |
| `cashbox_id` | `string (mongo-id)` | No | ID of the cashbox. |
| `income_type` | `string` | No | Type of income for the report.. One of: `product_income`, `material_income` |
| `report_by` | `string` | No | Criteria to report employees by.. One of: `created_by`, `responsible` |
| `search` | `string` | No | Search string for filtering results. Optional. |
| `type` | `string` | No | Type of summary report.. One of: `product`, `customer`, `employee`, `payment`, `category` |
| `responsible_ids` | `string[]` | No |  |
| `is_product` | `boolean` | No |  |
| `is_material` | `boolean` | No |  |
| `is_semi_product` | `boolean` | No |  |

```json
{
  "sale_type": "receipt",
  "from_date": "2025-05-01T12:00:00Z",
  "to_date": "2025-05-01T12:00:00Z",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}
```

**Response**

| Field | Type | Description |
|---|---|---|
| `total` | `object` | Total aggregated sales data for the current period. |
| `total.gross_sales` | `number (float)` | Total gross sales. |
| `total.refund` | `number (float)` | Total refunds. |
| `total.discount` | `number (float)` | Total discounts applied. |
| `total.gift` | `number (float)` | Total value of gifts. |
| `total.tax` | `number (float)` | Total tax amount. |
| `total.included_tax` | `number (float)` | Total included tax. |
| `total.added_tax` | `number (float)` | Total added tax. |
| `total.cost` | `number (float)` | Total cost of goods sold. |
| `total.net_sales` | `number (float)` | Total net sales. |
| `total.profit` | `number (float)` | Total profit. |
| `total.receipts` | `integer` | Total number of receipts. |
| `total.items_sold` | `integer` | Total number of items sold. |
| `total.refunds` | `integer` | Total number of refunds. |
| `total_prev` | `object` | Total aggregated sales data for the previous period. |
| `total_prev.gross_sales` | `number (float)` | Total gross sales for the previous period. |
| `total_prev.refund` | `number (float)` | Total refunds for the previous period. |
| `total_prev.discount` | `number (float)` | Total discounts applied for the previous period. |
| `total_prev.gift` | `number (float)` | Total value of gifts for the previous period. |
| `total_prev.tax` | `number (float)` | Total tax amount for the previous period. |
| `total_prev.included_tax` | `number (float)` | Total included tax for the previous period. |
| `total_prev.added_tax` | `number (float)` | Total added tax for the previous period. |
| `total_prev.cost` | `number (float)` | Total cost of goods sold for the previous period. |
| `total_prev.net_sales` | `number (float)` | Total net sales for the previous period. |
| `total_prev.profit` | `number (float)` | Total profit for the previous period. |
| `total_prev.receipts` | `integer` | Total number of receipts for the previous period. |
| `total_prev.items_sold` | `integer` | Total number of items sold for the previous period. |
| `total_prev.refunds` | `integer` | Total number of refunds for the previous period. |
| `chart` | `object[]` | Data points for the sales chart. |
| `chart[].date` | `string (date-time)` | Date of the chart data point. |
| `chart[].value` | `number (float)` | The value for the chart data point (e.g., gross sales). |
| `plan` | `object` | Sales plan data, can be null. |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": {
      "gross_sales": 0,
      "refund": 0,
      "discount": 0,
      "gift": 0,
      "tax": 0,
      "included_tax": 0,
      "added_tax": 0,
      "cost": 0,
      "net_sales": 0,
      "profit": 0,
      "receipts": 0,
      "items_sold": 0,
      "refunds": 0
    },
    "total_prev": {
      "gross_sales": 0,
      "refund": 0,
      "discount": 0,
      "gift": 0,
      "tax": 0,
      "included_tax": 0,
      "added_tax": 0,
      "cost": 0,
      "net_sales": 0,
      "profit": 0,
      "receipts": 0,
      "items_sold": 0,
      "refunds": 0
    },
    "chart": [
      {
        "date": "2025-05-01T12:00:00Z",
        "value": 0
      }
    ],
    "plan": {}
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /summary/income/chart

Report summary income chart

**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/summary/income/chart' \
  -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",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/summary/income/chart', {
  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",
    "custom": false,
    "from_time": 0,
    "to_time": 0,
    "organizations": [
      "string"
    ],
    "employees": [
      "string"
    ],
    "divider": "hour",
    "field": "gross_sales",
    "organization_id": "string",
    "sort_by": "string",
    "price_id": "string",
    "category_id": "string",
    "customer_category_id": "string",
    "supplier_id": "string",
    "supplier_category_id": "string",
    "asc": 1,
    "cashbox_id": "string",
    "income_type": "product_income",
    "report_by": "created_by",
    "search": "string",
    "type": "product",
    "responsible_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "is_product": false,
    "is_material": false,
    "is_semi_product": false
  }),
})
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/summary/income/chart",
    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",
        "custom": False,
        "from_time": 0,
        "to_time": 0,
        "organizations": [
            "string",
        ],
        "employees": [
            "string",
        ],
        "divider": "hour",
        "field": "gross_sales",
        "organization_id": "string",
        "sort_by": "string",
        "price_id": "string",
        "category_id": "string",
        "customer_category_id": "string",
        "supplier_id": "string",
        "supplier_category_id": "string",
        "asc": 1,
        "cashbox_id": "string",
        "income_type": "product_income",
        "report_by": "created_by",
        "search": "string",
        "type": "product",
        "responsible_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "is_product": False,
        "is_material": False,
        "is_semi_product": False,
    },
)
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",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/summary/income/chart');
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 | Type of sale report. Optional for GET requests.. One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
| `to_date` | `string (date-time)` | No | End date for the report in ISO 8601 format. Optional for GET requests. |
| `custom` | `boolean` | No | Indicates if custom time ranges are used. Optional for GET requests. |
| `from_time` | `integer (int32)` | No | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `to_time` | `integer (int32)` | No | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `organizations` | `string (mongo-id)[]` | No | List of organization IDs. Optional for GET requests. |
| `employees` | `string (mongo-id)[]` | No | List of employee IDs. Optional for GET requests. |
| `divider` | `string` | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `organization_id` | `string (mongo-id)` | No | ID of the organization. |
| `sort_by` | `string` | No | Field to sort the results by. |
| `price_id` | `string (mongo-id)` | No | ID of the price list. |
| `category_id` | `string (mongo-id)` | No | ID of the product category. |
| `customer_category_id` | `string (mongo-id)` | No | ID of the customer category. |
| `supplier_id` | `string (mongo-id)` | No | ID of the supplier. |
| `supplier_category_id` | `string (mongo-id)` | No | ID of the supplier category. |
| `asc` | `integer` | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: `1`, `-1`. Default: `-1` |
| `cashbox_id` | `string (mongo-id)` | No | ID of the cashbox. |
| `income_type` | `string` | No | Type of income for the report.. One of: `product_income`, `material_income` |
| `report_by` | `string` | No | Criteria to report employees by.. One of: `created_by`, `responsible` |
| `search` | `string` | No | Search string for filtering results. Optional. |
| `type` | `string` | No | Type of summary report.. One of: `product`, `customer`, `employee`, `payment`, `category` |
| `responsible_ids` | `string[]` | No |  |
| `is_product` | `boolean` | No |  |
| `is_material` | `boolean` | No |  |
| `is_semi_product` | `boolean` | No |  |

```json
{
  "sale_type": "receipt",
  "from_date": "2025-05-01T12:00:00Z",
  "to_date": "2025-05-01T12:00:00Z",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}
```

**Response**

| Field | Type | Description |
|---|---|---|
| `chart` | `object[]` | An array of data points for the chart, typically representing values over time. |
| `chart[].date` | `string (date-time)` | The date and time for the chart data point in ISO 8601 format. |
| `chart[].value` | `number (float)` | The numerical value for the given date. |
| `total` | `object` | Aggregated total data for the report. |
| `total.total` | `number (float)` | The grand total amount. |
| `total.data` | `object[]` | An array containing details of various payment types and their amounts. |
| `total.data[]._id` | `string (mongo-id)` | The unique identifier for the payment type. |
| `total.data[].payment_type` | `object` | Details of the payment type. |
| `total.data[].amount` | `number (float)` | The amount associated with this payment type. |
| `divider` | `string` | The time unit by which the data is divided in the chart (e.g., 'week'). |
| `currency` | `object` | Information about the currency used in the report. |
| `currency._id` | `string (mongo-id)` | The unique identifier for the currency. |
| `currency.name` | `string` | The name of the currency (e.g., 'US Dollar'). |
| `currency.symbol` | `string` | The symbol of the currency (e.g., '$'). |
| `currency.side` | `string` | Indicates where the currency symbol should be placed ('start' or 'end'). |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "chart": [
      {
        "date": "2025-05-01T12:00:00Z",
        "value": 0
      }
    ],
    "total": {
      "total": 0,
      "data": [
        {
          "_id": null,
          "payment_type": null,
          "amount": null
        }
      ]
    },
    "divider": "string",
    "currency": {
      "_id": "string",
      "name": "string",
      "symbol": "string",
      "side": "string"
    }
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /summary/expense/chart

Report summary expense chart

**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/summary/expense/chart' \
  -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",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/summary/expense/chart', {
  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",
    "custom": false,
    "from_time": 0,
    "to_time": 0,
    "organizations": [
      "string"
    ],
    "employees": [
      "string"
    ],
    "divider": "hour",
    "field": "gross_sales",
    "organization_id": "string",
    "sort_by": "string",
    "price_id": "string",
    "category_id": "string",
    "customer_category_id": "string",
    "supplier_id": "string",
    "supplier_category_id": "string",
    "asc": 1,
    "cashbox_id": "string",
    "income_type": "product_income",
    "report_by": "created_by",
    "search": "string",
    "type": "product",
    "responsible_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "is_product": false,
    "is_material": false,
    "is_semi_product": false
  }),
})
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/summary/expense/chart",
    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",
        "custom": False,
        "from_time": 0,
        "to_time": 0,
        "organizations": [
            "string",
        ],
        "employees": [
            "string",
        ],
        "divider": "hour",
        "field": "gross_sales",
        "organization_id": "string",
        "sort_by": "string",
        "price_id": "string",
        "category_id": "string",
        "customer_category_id": "string",
        "supplier_id": "string",
        "supplier_category_id": "string",
        "asc": 1,
        "cashbox_id": "string",
        "income_type": "product_income",
        "report_by": "created_by",
        "search": "string",
        "type": "product",
        "responsible_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "is_product": False,
        "is_material": False,
        "is_semi_product": False,
    },
)
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",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/summary/expense/chart');
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 | Type of sale report. Optional for GET requests.. One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
| `to_date` | `string (date-time)` | No | End date for the report in ISO 8601 format. Optional for GET requests. |
| `custom` | `boolean` | No | Indicates if custom time ranges are used. Optional for GET requests. |
| `from_time` | `integer (int32)` | No | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `to_time` | `integer (int32)` | No | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `organizations` | `string (mongo-id)[]` | No | List of organization IDs. Optional for GET requests. |
| `employees` | `string (mongo-id)[]` | No | List of employee IDs. Optional for GET requests. |
| `divider` | `string` | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `organization_id` | `string (mongo-id)` | No | ID of the organization. |
| `sort_by` | `string` | No | Field to sort the results by. |
| `price_id` | `string (mongo-id)` | No | ID of the price list. |
| `category_id` | `string (mongo-id)` | No | ID of the product category. |
| `customer_category_id` | `string (mongo-id)` | No | ID of the customer category. |
| `supplier_id` | `string (mongo-id)` | No | ID of the supplier. |
| `supplier_category_id` | `string (mongo-id)` | No | ID of the supplier category. |
| `asc` | `integer` | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: `1`, `-1`. Default: `-1` |
| `cashbox_id` | `string (mongo-id)` | No | ID of the cashbox. |
| `income_type` | `string` | No | Type of income for the report.. One of: `product_income`, `material_income` |
| `report_by` | `string` | No | Criteria to report employees by.. One of: `created_by`, `responsible` |
| `search` | `string` | No | Search string for filtering results. Optional. |
| `type` | `string` | No | Type of summary report.. One of: `product`, `customer`, `employee`, `payment`, `category` |
| `responsible_ids` | `string[]` | No |  |
| `is_product` | `boolean` | No |  |
| `is_material` | `boolean` | No |  |
| `is_semi_product` | `boolean` | No |  |

```json
{
  "sale_type": "receipt",
  "from_date": "2025-05-01T12:00:00Z",
  "to_date": "2025-05-01T12:00:00Z",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}
```

**Response**

| Field | Type | Description |
|---|---|---|
| `chart` | `object[]` | Historical data points for the report, typically representing values over time. |
| `chart[].date` | `string (date-time)` | The date and time for the data point in ISO 8601 format. |
| `chart[].value` | `number (float)` | The numerical value for the given date. |
| `total` | `object` | Aggregated total data for the report. |
| `total.total` | `number (float)` | The grand total amount. |
| `total.data` | `object[]` | An array containing details of various payment types and their amounts. |
| `total.data[]._id` | `string (mongo-id)` | The unique identifier for the payment type. |
| `total.data[].payment_type` | `object` | Details of the payment type. |
| `total.data[].amount` | `number (float)` | The amount associated with this payment type. |
| `divider` | `string` | The time unit by which the data is divided in the chart (e.g., 'day'). |
| `currency` | `object` | Information about the currency used in the report. |
| `currency._id` | `string (mongo-id)` | The unique identifier for the currency. |
| `currency.name` | `string` | The name of the currency (e.g., 'usd'). |
| `currency.symbol` | `string` | The symbol of the currency (e.g., '$'). |
| `currency.side` | `string` | Indicates where the currency symbol should be placed ('start' or 'end'). |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "chart": [
      {
        "date": "2025-05-01T12:00:00Z",
        "value": 0
      }
    ],
    "total": {
      "total": 0,
      "data": [
        {
          "_id": null,
          "payment_type": null,
          "amount": null
        }
      ]
    },
    "divider": "string",
    "currency": {
      "_id": "string",
      "name": "string",
      "symbol": "string",
      "side": "string"
    }
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /sales/by-item-pagin

Report summary by-item-pagin

**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/sales/by-item-pagin' \
  -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/sales/by-item-pagin', {
  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/sales/by-item-pagin",
    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/sales/by-item-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 |
|---|---|---|---|
| `page` | `number (int32)` | Yes | Page number for pagination. |
| `limit` | `number (int32)` | Yes | Maximum number of items to return for pagination. |
| `sale_type` | `string` | No | Type of sale report. Optional for GET requests.. One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
| `to_date` | `string (date-time)` | No | End date for the report in ISO 8601 format. Optional for GET requests. |
| `custom` | `boolean` | No | Indicates if custom time ranges are used. Optional for GET requests. |
| `from_time` | `integer (int32)` | No | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `to_time` | `integer (int32)` | No | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `organizations` | `string (mongo-id)[]` | No | List of organization IDs. Optional for GET requests. |
| `employees` | `string (mongo-id)[]` | No | List of employee IDs. Optional for GET requests. |
| `divider` | `string` | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `organization_id` | `string (mongo-id)` | No | ID of the organization. |
| `sort_by` | `string` | No | Field to sort the results by. |
| `price_id` | `string (mongo-id)` | No | ID of the price list. |
| `category_id` | `string (mongo-id)` | No | ID of the product category. |
| `customer_category_id` | `string (mongo-id)` | No | ID of the customer category. |
| `supplier_id` | `string (mongo-id)` | No | ID of the supplier. |
| `supplier_category_id` | `string (mongo-id)` | No | ID of the supplier category. |
| `asc` | `integer` | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: `1`, `-1`. Default: `-1` |
| `cashbox_id` | `string (mongo-id)` | No | ID of the cashbox. |
| `income_type` | `string` | No | Type of income for the report.. One of: `product_income`, `material_income` |
| `product_id` | `string (mongo-id)` | No | ID of the product. |
| `customer_id` | `string (mongo-id)` | No | ID of the customer. |
| `date_from` | `string (date-time)` | No | Start date for the report in ISO 8601 format. |
| `date_to` | `string (date-time)` | No | End date for the report in ISO 8601 format. |
| `sort` | `object` | No | Sorting parameters for the report. |
| `sort.name` | `integer` | No | Sort order for 'name' field: 1 for ascending, -1 for descending.. One of: `1`, `-1` |
| `report_by` | `string` | No | Criteria to report employees by.. One of: `created_by`, `responsible` |
| `is_product` | `boolean` | No | Indicates if the report includes products. |
| `is_material` | `boolean` | No | Indicates if the report includes materials. |
| `is_semi_product` | `boolean` | No | Indicates if the report includes semi-products. |
| `search` | `string` | No | Search string for filtering results. Optional. |
| `trade_state` | `string` | No | Current state of the trade.. One of: `new`, `draft`, `in_progress`, `canceled`, `done` |
| `trade_states` | `string[]` | No | List of trade states to filter by. |
| `type` | `string` | No | Type of summary report.. One of: `product`, `customer`, `employee`, `payment`, `category` |
| `state` | `string` | No | State of the income.. One of: `canceled`, `done` |
| `min_items_sold` | `number (int32)` | No | Minimum number of items sold. |
| `min_gross_sales` | `number (float)` | No | Minimum gross sales amount. |
| `responsible_ids` | `string[]` | No |  |

```json
{
  "page": 0,
  "limit": 0,
  "sale_type": "receipt",
  "from_date": "2025-05-01T12:00:00Z",
  "to_date": "2025-05-01T12:00:00Z",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "product_id": "string",
  "customer_id": "string",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "sort": {
    "name": 1
  },
  "report_by": "created_by",
  "is_product": false,
  "is_material": false,
  "is_semi_product": false,
  "search": "string",
  "trade_state": "new",
  "trade_states": [
    "new"
  ],
  "type": "product",
  "state": "canceled",
  "min_items_sold": 0,
  "min_gross_sales": 0,
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ]
}
```

**Response**

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "_id": "string",
      "date": "2025-05-01T12:00:00Z",
      "product_id": "string",
      "category_id": "string",
      "gross_sales": 0,
      "refund": 0,
      "discount": 0,
      "gift": 0,
      "tax": 0,
      "included_tax": 0,
      "added_tax": 0,
      "cost": 0,
      "net_sales": 0,
      "profit": 0,
      "items_sold": 0,
      "items_refunded": 0,
      "product_name": "string",
      "dimension": {
        "shape": "string",
        "netto_weight": 0,
        "gross_weight": 0,
        "height": 0,
        "volume": 0,
        "diameter": 0,
        "width": 0,
        "length": 0,
        "_id": "string"
      },
      "measure": {
        "system_code": "string",
        "code": "string",
        "short_name": "string",
        "name": "string",
        "decimal_count": 0,
        "_id": "string"
      },
      "category_name": "string"
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /sales/by-item

Report summary by-item

**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/sales/by-item' \
  -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",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/sales/by-item', {
  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",
    "custom": false,
    "from_time": 0,
    "to_time": 0,
    "organizations": [
      "string"
    ],
    "employees": [
      "string"
    ],
    "divider": "hour",
    "field": "gross_sales",
    "organization_id": "string",
    "sort_by": "string",
    "price_id": "string",
    "category_id": "string",
    "customer_category_id": "string",
    "supplier_id": "string",
    "supplier_category_id": "string",
    "asc": 1,
    "cashbox_id": "string",
    "income_type": "product_income",
    "report_by": "created_by",
    "search": "string",
    "type": "product",
    "responsible_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "is_product": false,
    "is_material": false,
    "is_semi_product": false
  }),
})
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/sales/by-item",
    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",
        "custom": False,
        "from_time": 0,
        "to_time": 0,
        "organizations": [
            "string",
        ],
        "employees": [
            "string",
        ],
        "divider": "hour",
        "field": "gross_sales",
        "organization_id": "string",
        "sort_by": "string",
        "price_id": "string",
        "category_id": "string",
        "customer_category_id": "string",
        "supplier_id": "string",
        "supplier_category_id": "string",
        "asc": 1,
        "cashbox_id": "string",
        "income_type": "product_income",
        "report_by": "created_by",
        "search": "string",
        "type": "product",
        "responsible_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "is_product": False,
        "is_material": False,
        "is_semi_product": False,
    },
)
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",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/sales/by-item');
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 | Type of sale report. Optional for GET requests.. One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
| `to_date` | `string (date-time)` | No | End date for the report in ISO 8601 format. Optional for GET requests. |
| `custom` | `boolean` | No | Indicates if custom time ranges are used. Optional for GET requests. |
| `from_time` | `integer (int32)` | No | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `to_time` | `integer (int32)` | No | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `organizations` | `string (mongo-id)[]` | No | List of organization IDs. Optional for GET requests. |
| `employees` | `string (mongo-id)[]` | No | List of employee IDs. Optional for GET requests. |
| `divider` | `string` | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `organization_id` | `string (mongo-id)` | No | ID of the organization. |
| `sort_by` | `string` | No | Field to sort the results by. |
| `price_id` | `string (mongo-id)` | No | ID of the price list. |
| `category_id` | `string (mongo-id)` | No | ID of the product category. |
| `customer_category_id` | `string (mongo-id)` | No | ID of the customer category. |
| `supplier_id` | `string (mongo-id)` | No | ID of the supplier. |
| `supplier_category_id` | `string (mongo-id)` | No | ID of the supplier category. |
| `asc` | `integer` | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: `1`, `-1`. Default: `-1` |
| `cashbox_id` | `string (mongo-id)` | No | ID of the cashbox. |
| `income_type` | `string` | No | Type of income for the report.. One of: `product_income`, `material_income` |
| `report_by` | `string` | No | Criteria to report employees by.. One of: `created_by`, `responsible` |
| `search` | `string` | No | Search string for filtering results. Optional. |
| `type` | `string` | No | Type of summary report.. One of: `product`, `customer`, `employee`, `payment`, `category` |
| `responsible_ids` | `string[]` | No |  |
| `is_product` | `boolean` | No |  |
| `is_material` | `boolean` | No |  |
| `is_semi_product` | `boolean` | No |  |

```json
{
  "sale_type": "receipt",
  "from_date": "2025-05-01T12:00:00Z",
  "to_date": "2025-05-01T12:00:00Z",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "report_by": "created_by",
  "search": "string",
  "type": "product",
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "is_product": false,
  "is_material": false,
  "is_semi_product": false
}
```

**Response**

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "_id": "string",
      "product": {
        "name": "string",
        "sku": "string"
      },
      "net_sales": 0,
      "chart": [
        {
          "date": null,
          "value": null
        }
      ]
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}
```

## POST /sales/by-customer-pagin

Report summary by-customer-pagin

**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/sales/by-customer-pagin' \
  -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/sales/by-customer-pagin', {
  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/sales/by-customer-pagin",
    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/sales/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 |
|---|---|---|---|
| `page` | `number (int32)` | Yes | Page number for pagination. |
| `limit` | `number (int32)` | Yes | Maximum number of items to return for pagination. |
| `sale_type` | `string` | No | Type of sale report. Optional for GET requests.. One of: `receipt`, `sale_contract`, `trade` |
| `from_date` | `string (date-time)` | No | Start date for the report in ISO 8601 format. Optional for GET requests. |
| `to_date` | `string (date-time)` | No | End date for the report in ISO 8601 format. Optional for GET requests. |
| `custom` | `boolean` | No | Indicates if custom time ranges are used. Optional for GET requests. |
| `from_time` | `integer (int32)` | No | Start hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `to_time` | `integer (int32)` | No | End hour for custom time range (0-24). Required if 'custom' is true for GET requests. |
| `organizations` | `string (mongo-id)[]` | No | List of organization IDs. Optional for GET requests. |
| `employees` | `string (mongo-id)[]` | No | List of employee IDs. Optional for GET requests. |
| `divider` | `string` | No | Specifies how data should be divided in the chart. Defaults to 'day'.. One of: `hour`, `day`, `week`, `month`, `quarter`, `year`. Default: `"day"` |
| `field` | `string` | No | Specifies the field to be displayed in the chart. Defaults to 'gross_sales'.. One of: `gross_sales`, `refund`, `discount`, `gift`, `net_sales`, `profit`. Default: `"gross_sales"` |
| `organization_id` | `string (mongo-id)` | No | ID of the organization. |
| `sort_by` | `string` | No | Field to sort the results by. |
| `price_id` | `string (mongo-id)` | No | ID of the price list. |
| `category_id` | `string (mongo-id)` | No | ID of the product category. |
| `customer_category_id` | `string (mongo-id)` | No | ID of the customer category. |
| `supplier_id` | `string (mongo-id)` | No | ID of the supplier. |
| `supplier_category_id` | `string (mongo-id)` | No | ID of the supplier category. |
| `asc` | `integer` | No | Sort order: 1 for ascending, -1 for descending. Defaults to descending.. One of: `1`, `-1`. Default: `-1` |
| `cashbox_id` | `string (mongo-id)` | No | ID of the cashbox. |
| `income_type` | `string` | No | Type of income for the report.. One of: `product_income`, `material_income` |
| `product_id` | `string (mongo-id)` | No | ID of the product. |
| `customer_id` | `string (mongo-id)` | No | ID of the customer. |
| `date_from` | `string (date-time)` | No | Start date for the report in ISO 8601 format. |
| `date_to` | `string (date-time)` | No | End date for the report in ISO 8601 format. |
| `sort` | `object` | No | Sorting parameters for the report. |
| `sort.name` | `integer` | No | Sort order for 'name' field: 1 for ascending, -1 for descending.. One of: `1`, `-1` |
| `report_by` | `string` | No | Criteria to report employees by.. One of: `created_by`, `responsible` |
| `is_product` | `boolean` | No | Indicates if the report includes products. |
| `is_material` | `boolean` | No | Indicates if the report includes materials. |
| `is_semi_product` | `boolean` | No | Indicates if the report includes semi-products. |
| `search` | `string` | No | Search string for filtering results. Optional. |
| `trade_state` | `string` | No | Current state of the trade.. One of: `new`, `draft`, `in_progress`, `canceled`, `done` |
| `trade_states` | `string[]` | No | List of trade states to filter by. |
| `type` | `string` | No | Type of summary report.. One of: `product`, `customer`, `employee`, `payment`, `category` |
| `state` | `string` | No | State of the income.. One of: `canceled`, `done` |
| `min_items_sold` | `number (int32)` | No | Minimum number of items sold. |
| `min_gross_sales` | `number (float)` | No | Minimum gross sales amount. |
| `responsible_ids` | `string[]` | No |  |

```json
{
  "page": 0,
  "limit": 0,
  "sale_type": "receipt",
  "from_date": "2025-05-01T12:00:00Z",
  "to_date": "2025-05-01T12:00:00Z",
  "custom": false,
  "from_time": 0,
  "to_time": 0,
  "organizations": [
    "string"
  ],
  "employees": [
    "string"
  ],
  "divider": "hour",
  "field": "gross_sales",
  "organization_id": "string",
  "sort_by": "string",
  "price_id": "string",
  "category_id": "string",
  "customer_category_id": "string",
  "supplier_id": "string",
  "supplier_category_id": "string",
  "asc": 1,
  "cashbox_id": "string",
  "income_type": "product_income",
  "product_id": "string",
  "customer_id": "string",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "sort": {
    "name": 1
  },
  "report_by": "created_by",
  "is_product": false,
  "is_material": false,
  "is_semi_product": false,
  "search": "string",
  "trade_state": "new",
  "trade_states": [
    "new"
  ],
  "type": "product",
  "state": "canceled",
  "min_items_sold": 0,
  "min_gross_sales": 0,
  "responsible_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ]
}
```

**Response**

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "_id": "string",
      "customer_id": "string",
      "customer_category_id": "string",
      "gross_sales": 0,
      "refund": 0,
      "discount": 0,
      "included_tax": 0,
      "added_tax": 0,
      "gift": 0,
      "net_sales": 0,
      "profit": 0,
      "receipts": 0,
      "refunds": 0,
      "sale_contracts": 0,
      "customer": {
        "_id": "string",
        "is_deleted": false,
        "is_archived": false,
        "created_at": "2025-05-01T12:00:00Z",
        "updated_at": "2025-05-01T12:00:00Z",
        "completely_deleted": false,
        "type": "string",
        "number": "string",
        "state": "string",
        "name": "string",
        "phone_number": "string",
        "phone_numbers": [],
        "organization_ids": [],
        "total_sale": 0,
        "avg_sale": 0,
        "avg_product": 0,
        "total_spent": 0,
        "point": 0,
        "balance": 0,
        "refund": 0,
        "queue_status": "string",
        "person_id": "string",
        "used_count": 0,
        "created_from_bot": false,
        "balance_action": "string",
        "custom_fields": [],
        "__v": 0,
        "telegram_id": 0,
        "locale": "string",
        "balance_currency_id": "string",
        "balances": {},
        "first_sale_at": "2025-05-01T12:00:00Z",
        "first_sale_id": "string",
        "first_sale_uuid": "string",
        "last_sale_at": "2025-05-01T12:00:00Z",
        "last_sale_id": "string",
        "last_sale_uuid": "string",
        "organizations": {},
        "updated_by": "string",
        "category_id": "string",
        "send_notification": false,
        "created_by": "string",
        "delivery_address": {
          "long": null,
          "lat": null,
          "human_address": null,
          "_id": null
        },
        "responsible_id": "string"
      },
      "customer_category": {
        "_id": "string",
        "is_deleted": false,
        "is_archived": false,
        "created_by": "string",
        "created_at": "2025-05-01T12:00:00Z",
        "updated_at": "2025-05-01T12:00:00Z",
        "completely_deleted": false,
        "name": "string",
        "organization_ids": [],
        "child_count": 0,
        "item_count": 0,
        "__v": 0
      },
      "average_sale": 0
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}
```

---

*This page is generated from the OpenAPI spec.*
