# Report production

::: 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/production/by-product

Manufacturing output aggregated 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/production/by-product' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "used",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "product_type": "is_semi_product",
  "sort_by": "string",
  "asc": -1
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/production/by-product', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "type": "used",
    "organization_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "organization_id": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "product_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "date_from": "2025-05-01T12:00:00Z",
    "date_to": "2025-05-01T12:00:00Z",
    "product_type": "is_semi_product",
    "sort_by": "string",
    "asc": -1
  }),
})
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/production/by-product",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "type": "used",
        "organization_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "organization_id": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "product_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "date_from": "2025-05-01T12:00:00Z",
        "date_to": "2025-05-01T12:00:00Z",
        "product_type": "is_semi_product",
        "sort_by": "string",
        "asc": -1,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "type": "used",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "product_type": "is_semi_product",
  "sort_by": "string",
  "asc": -1
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/production/by-product');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Request body**

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | `string` | No | One of: `used`, `produced` |
| `organization_ids` | `string[]` | No | Organization ObjectIds. |
| `organization_id` | `string[]` | No | Organization ObjectId. |
| `responsible_id` | `string` | No |  |
| `category_id` | `string` | No |  |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `date_from` | `string (date-time)` | No | Start of the date range. |
| `date_to` | `string (date-time)` | No | End of the date range. |
| `product_type` | `string` | No | One of: `is_semi_product`, `is_product`, `is_material`, `is_service` |
| `sort_by` | `string` | No | Field name to sort by. |
| `asc` | `integer` | No | Sort direction: `1` ascending, `-1` descending.. One of: `-1`, `1` |

```json
{
  "type": "used",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "product_type": "is_semi_product",
  "sort_by": "string",
  "asc": -1
}
```

**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/production/by-responsible

Manufacturing output aggregated by responsible user.

**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/production/by-responsible' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "used",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/production/by-responsible', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "type": "used",
    "organization_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "organization_id": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "date_from": "2025-05-01T12:00:00Z",
    "date_to": "2025-05-01T12:00:00Z"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/reports/production/by-responsible",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "type": "used",
        "organization_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "organization_id": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "date_from": "2025-05-01T12:00:00Z",
        "date_to": "2025-05-01T12:00:00Z",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "type": "used",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/production/by-responsible');
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 |
|---|---|---|---|
| `type` | `string` | No | One of: `used`, `produced` |
| `organization_ids` | `string[]` | No | Organization ObjectIds. |
| `organization_id` | `string[]` | No | Organization ObjectId. |
| `responsible_id` | `string` | No |  |
| `warehouse_id` | `string` | No |  |
| `product_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. |

```json
{
  "type": "used",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z"
}
```

**Response**

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

## POST /reports/production/by-responsible-and-product

Manufacturing output aggregated by (responsible, product) pair.

**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/production/by-responsible-and-product' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "used",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "product_type": "is_semi_product"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/production/by-responsible-and-product', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "type": "used",
    "organization_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "organization_id": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "product_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "date_from": "2025-05-01T12:00:00Z",
    "date_to": "2025-05-01T12:00:00Z",
    "product_type": "is_semi_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/production/by-responsible-and-product",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "type": "used",
        "organization_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "organization_id": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "product_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "date_from": "2025-05-01T12:00:00Z",
        "date_to": "2025-05-01T12:00:00Z",
        "product_type": "is_semi_product",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "type": "used",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "product_type": "is_semi_product"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/production/by-responsible-and-product');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Request body**

| Field | Type | Required | Description |
|---|---|---|---|
| `type` | `string` | No | One of: `used`, `produced` |
| `organization_ids` | `string[]` | No | Organization ObjectIds. |
| `organization_id` | `string[]` | No | Organization ObjectId. |
| `responsible_id` | `string` | No |  |
| `warehouse_id` | `string` | No |  |
| `category_id` | `string` | No |  |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `date_from` | `string (date-time)` | No | Start of the date range. |
| `date_to` | `string (date-time)` | No | End of the date range. |
| `product_type` | `string` | No | One of: `is_semi_product`, `is_product`, `is_material`, `is_service` |

```json
{
  "type": "used",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "responsible_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "date_from": "2025-05-01T12:00:00Z",
  "date_to": "2025-05-01T12:00:00Z",
  "product_type": "is_semi_product"
}
```

**Response**

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

## POST /reports/production/recommended-to-be-used

Recommended raw-materials to use for upcoming production based on stock + open orders.

**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/production/recommended-to-be-used' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "search": "string",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "days_ago": 0,
  "sort_by": "string",
  "asc": -1
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/reports/production/recommended-to-be-used', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "search": "string",
    "organization_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "organization_id": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
    "product_ids": [
      "64b7f4d9e2b3b6a0b7c5d7ff"
    ],
    "days_ago": 0,
    "sort_by": "string",
    "asc": -1
  }),
})
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/production/recommended-to-be-used",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "search": "string",
        "organization_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "organization_id": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
        "product_ids": [
            "64b7f4d9e2b3b6a0b7c5d7ff",
        ],
        "days_ago": 0,
        "sort_by": "string",
        "asc": -1,
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "search": "string",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "days_ago": 0,
  "sort_by": "string",
  "asc": -1
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/reports/production/recommended-to-be-used');
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 |
|---|---|---|---|
| `search` | `string` | No | Free-text search. |
| `organization_ids` | `string[]` | No | Organization ObjectIds. |
| `organization_id` | `string[]` | No | Organization ObjectId. |
| `warehouse_id` | `string` | No |  |
| `category_id` | `string` | No |  |
| `product_id` | `string` | No |  |
| `product_ids` | `string[]` | No |  |
| `days_ago` | `number` | No |  |
| `sort_by` | `string` | No | Field name to sort by. |
| `asc` | `integer` | No | Sort direction: `1` ascending, `-1` descending.. One of: `-1`, `1` |

```json
{
  "search": "string",
  "organization_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "organization_id": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "warehouse_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "category_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "product_ids": [
    "64b7f4d9e2b3b6a0b7c5d7ff"
  ],
  "days_ago": 0,
  "sort_by": "string",
  "asc": -1
}
```

**Response**

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

---

*This page is generated from the OpenAPI spec.*
