# Production route sheet

::: 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 /production/route-sheet/create

This method allows adding production-route-sheet into the account.

**Required permission:** `production` · [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/production/route-sheet/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "items": [
    {
      "product_id": "646b0c2f3d4e1a001f8b4567",
      "amount": 100,
      "type": "used",
      "cost_percentage": 10,
      "extra_costs": [],
      "consumption_type": "variable",
      "used_measure": {
        "_id": null,
        "ratio": null,
        "amount": null
      }
    }
  ],
  "name": "name",
  "organization_ids": [
    "646b0c2f3d4e1a001f8b4567"
  ]
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "items": [
      {
        "product_id": "646b0c2f3d4e1a001f8b4567",
        "amount": 100,
        "type": "used",
        "cost_percentage": 10,
        "extra_costs": [],
        "consumption_type": "variable",
        "used_measure": {
          "_id": null,
          "ratio": null,
          "amount": null
        }
      }
    ],
    "name": "name",
    "organization_ids": [
      "646b0c2f3d4e1a001f8b4567"
    ]
  }),
})
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/production/route-sheet/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "items": [
            {
                "product_id": "646b0c2f3d4e1a001f8b4567",
                "amount": 100,
                "type": "used",
                "cost_percentage": 10,
                "extra_costs": [],
                "consumption_type": "variable",
                "used_measure": {
                    "_id": None,
                    "ratio": None,
                    "amount": None,
                },
            },
        ],
        "name": "name",
        "organization_ids": [
            "646b0c2f3d4e1a001f8b4567",
        ],
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "items": [
    {
      "product_id": "646b0c2f3d4e1a001f8b4567",
      "amount": 100,
      "type": "used",
      "cost_percentage": 10,
      "extra_costs": [],
      "consumption_type": "variable",
      "used_measure": {
        "_id": null,
        "ratio": null,
        "amount": null
      }
    }
  ],
  "name": "name",
  "organization_ids": [
    "646b0c2f3d4e1a001f8b4567"
  ]
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/create');
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 |
|---|---|---|---|
| `items` | `object[]` | Yes |  |
| `items[].product_id` | `string` | Yes |  |
| `items[].amount` | `number` | No |  |
| `items[].type` | `string` | Yes | One of: `used`, `produced` |
| `items[].cost_percentage` | `number` | No | Required when `type` is `produced`. |
| `items[].extra_costs` | `object[]` | No |  |
| `items[].extra_costs[].cost_id` | `string` | Yes |  |
| `items[].extra_costs[].amount` | `number` | Yes |  |
| `items[].consumption_type` | `string` | No | One of: `variable`, `fixed` |
| `items[].used_measure` | `object` | No |  |
| `items[].used_measure._id` | `string` | Yes |  |
| `items[].used_measure.ratio` | `number` | Yes |  |
| `items[].used_measure.amount` | `number` | Yes |  |
| `code` | `string` | No |  |
| `name` | `string` | Yes |  |
| `note` | `string` | No |  |
| `is_active` | `boolean` | No | Default: `false` |
| `organization_ids` | `string[]` | Yes |  |
| `additional_costs` | `object[]` | No |  |
| `additional_costs[].cost_id` | `string` | Yes |  |
| `additional_costs[].amount` | `number` | Yes |  |
| `additional_costs[].customer_id` | `string` | No |  |
| `additional_costs[].supplier_id` | `string` | No |  |
| `additional_costs[].employee_id` | `string` | No |  |
| `additional_costs[].person_id` | `string` | No |  |
| `additional_costs[].consumption_type` | `string` | No | One of: `variable`, `fixed` |

```json
{
  "items": [
    {
      "product_id": "646b0c2f3d4e1a001f8b4567",
      "amount": 100,
      "type": "used",
      "cost_percentage": 10,
      "extra_costs": [],
      "consumption_type": "variable",
      "used_measure": {
        "_id": null,
        "ratio": null,
        "amount": null
      }
    }
  ],
  "code": "code",
  "name": "name",
  "note": "note",
  "is_active": false,
  "organization_ids": [
    "646b0c2f3d4e1a001f8b4567"
  ],
  "additional_costs": [
    {
      "cost_id": "646b0c2f3d4e1a001f8b4567",
      "amount": 100,
      "customer_id": "646b0c2f3d4e1a001f8b4567",
      "supplier_id": "646b0c2f3d4e1a001f8b4567",
      "employee_id": "646b0c2f3d4e1a001f8b4567",
      "person_id": "646b0c2f3d4e1a001f8b4567",
      "consumption_type": "variable"
    }
  ]
}
```

**Response**

| Field | Type | Description |
|---|---|---|
| `_id` | `string` |  |
| `product` | `object` |  |
| `product._id` | `string` |  |
| `product.name` | `string` |  |
| `product.box_item` | `number` | Default: `0` |
| `product.barcodes` | `object[]` |  |
| `product.barcodes[]._id` | `string` |  |
| `product.barcodes[].barcode` | `string` |  |
| `product.barcodes[].is_active` | `boolean` | Default: `false` |
| `product.barcode` | `string` |  |
| `product.measure` | `object` |  |
| `product.measure.name` | `string` |  |
| `product.measure.system_code` | `string` |  |
| `product.measure.code` | `string` |  |
| `product.measure.short_name` | `string` |  |
| `product.measure.decimal_count` | `number` | Default: `0` |
| `product.measure_id` | `string` |  |
| `product.dimension` | `object` |  |
| `product.dimension.shape` | `string` | One of: `circular`, `rectangular`, `other`. Default: `"other"` |
| `product.dimension.netto_weight` | `number` | Default: `0` |
| `product.dimension.gross_weight` | `number` | Default: `0` |
| `product.dimension.height` | `number` | Default: `0` |
| `product.dimension.volume` | `number` | Default: `0` |
| `product.dimension.diameter` | `number` | Default: `0` |
| `product.dimension.width` | `number` | Default: `0` |
| `product.dimension.length` | `number` | Default: `0` |
| `product.is_material` | `boolean` | Default: `false` |
| `product.is_product` | `boolean` | Default: `false` |
| `product.is_semi_product` | `boolean` | Default: `false` |
| `product.is_variant` | `boolean` | Default: `false` |
| `product.sku` | `string` |  |
| `warehouse_amount` | `number` |  |
| `type` | `string` |  |
| `measure_id` | `string` |  |
| `measure` | `object` |  |
| `measure.name` | `string` |  |
| `measure.system_code` | `string` |  |
| `measure.code` | `string` |  |
| `measure.short_name` | `string` |  |
| `measure.decimal_count` | `number` | Default: `0` |
| `amount` | `number` |  |
| `marks` | `string[]` |  |
| `route_sheet_id` | `string` |  |
| `cost_percentage` | `number` |  |
| `extra_costs` | `object[]` |  |
| `extra_costs[]._id` | `string` |  |
| `extra_costs[].cost_id` | `string` |  |
| `extra_costs[].amount` | `number` |  |
| `extra_costs[].employee_id` | `string` |  |
| `extra_costs[].customer_id` | `string` |  |
| `extra_costs[].supplier_id` | `string` |  |
| `extra_costs[].person_id` | `string` |  |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "646b0c2f3d4e1a001f8b4567",
    "product": {
      "_id": "646b0c2f3d4e1a001f8b4567",
      "name": "name",
      "box_item": 0,
      "barcodes": [
        {
          "_id": null,
          "barcode": null,
          "is_active": null
        }
      ],
      "barcode": "barcode",
      "measure": {
        "name": "name",
        "system_code": "system_code",
        "code": "code",
        "short_name": "short_name",
        "decimal_count": 0
      },
      "measure_id": "646b0c2f3d4e1a001f8b4567",
      "dimension": {
        "shape": "circular",
        "netto_weight": 0,
        "gross_weight": 0,
        "height": 0,
        "volume": 0,
        "diameter": 0,
        "width": 0,
        "length": 0
      },
      "is_material": false,
      "is_product": false,
      "is_semi_product": false,
      "is_variant": false,
      "sku": "sku"
    },
    "warehouse_amount": 0,
    "type": "string",
    "measure_id": "646b0c2f3d4e1a001f8b4567",
    "measure": {
      "name": "name",
      "system_code": "system_code",
      "code": "code",
      "short_name": "short_name",
      "decimal_count": 0
    },
    "amount": 100,
    "marks": [
      "string"
    ],
    "route_sheet_id": "646b0c2f3d4e1a001f8b4567",
    "cost_percentage": 10,
    "extra_costs": [
      {
        "_id": "646b0c2f3d4e1a001f8b4567",
        "cost_id": "646b0c2f3d4e1a001f8b4567",
        "amount": 100,
        "employee_id": "646b0c2f3d4e1a001f8b4567",
        "customer_id": "646b0c2f3d4e1a001f8b4567",
        "supplier_id": "646b0c2f3d4e1a001f8b4567",
        "person_id": "646b0c2f3d4e1a001f8b4567"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## PUT /production/route-sheet/update

This method allows updating production-route-sheet in the account.

**Required permission:** `production` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/update' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "items": [
    {
      "_id": "646b0c2f3d4e1a001f8b4567",
      "product_id": "646b0c2f3d4e1a001f8b4567",
      "amount": 100,
      "type": "used",
      "cost_percentage": 10,
      "extra_costs": [],
      "consumption_type": "variable",
      "used_measure": {
        "_id": null,
        "ratio": null,
        "amount": null
      }
    }
  ],
  "_id": "646b0c2f3d4e1a001f8b4567"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/update', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "items": [
      {
        "_id": "646b0c2f3d4e1a001f8b4567",
        "product_id": "646b0c2f3d4e1a001f8b4567",
        "amount": 100,
        "type": "used",
        "cost_percentage": 10,
        "extra_costs": [],
        "consumption_type": "variable",
        "used_measure": {
          "_id": null,
          "ratio": null,
          "amount": null
        }
      }
    ],
    "_id": "646b0c2f3d4e1a001f8b4567"
  }),
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "items": [
            {
                "_id": "646b0c2f3d4e1a001f8b4567",
                "product_id": "646b0c2f3d4e1a001f8b4567",
                "amount": 100,
                "type": "used",
                "cost_percentage": 10,
                "extra_costs": [],
                "consumption_type": "variable",
                "used_measure": {
                    "_id": None,
                    "ratio": None,
                    "amount": None,
                },
            },
        ],
        "_id": "646b0c2f3d4e1a001f8b4567",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "items": [
    {
      "_id": "646b0c2f3d4e1a001f8b4567",
      "product_id": "646b0c2f3d4e1a001f8b4567",
      "amount": 100,
      "type": "used",
      "cost_percentage": 10,
      "extra_costs": [],
      "consumption_type": "variable",
      "used_measure": {
        "_id": null,
        "ratio": null,
        "amount": null
      }
    }
  ],
  "_id": "646b0c2f3d4e1a001f8b4567"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/update');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    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 |
|---|---|---|---|
| `_id` | `string` | Yes |  |
| `items` | `object[]` | Yes |  |
| `items[]._id` | `string` | No |  |
| `items[].product_id` | `string` | No |  |
| `items[].amount` | `number` | No |  |
| `items[].type` | `string` | No | One of: `used`, `produced` |
| `items[].cost_percentage` | `number` | No | Required when `type` is `produced`. |
| `items[].extra_costs` | `object[]` | No |  |
| `items[].extra_costs[].cost_id` | `string` | Yes |  |
| `items[].extra_costs[].amount` | `number` | Yes |  |
| `items[].consumption_type` | `string` | No | One of: `variable`, `fixed` |
| `items[].used_measure` | `object` | No |  |
| `items[].used_measure._id` | `string` | Yes |  |
| `items[].used_measure.ratio` | `number` | Yes |  |
| `items[].used_measure.amount` | `number` | Yes |  |
| `code` | `string` | No |  |
| `name` | `string` | No |  |
| `note` | `string` | No |  |
| `is_active` | `boolean` | No | Default: `false` |
| `organization_ids` | `string[]` | No |  |
| `additional_costs` | `object[]` | No |  |
| `additional_costs[].cost_id` | `string` | Yes |  |
| `additional_costs[].amount` | `number` | Yes |  |
| `additional_costs[].customer_id` | `string` | No |  |
| `additional_costs[].supplier_id` | `string` | No |  |
| `additional_costs[].employee_id` | `string` | No |  |
| `additional_costs[].person_id` | `string` | No |  |
| `additional_costs[].consumption_type` | `string` | No | One of: `variable`, `fixed` |

```json
{
  "_id": "646b0c2f3d4e1a001f8b4567",
  "items": [
    {
      "_id": "646b0c2f3d4e1a001f8b4567",
      "product_id": "646b0c2f3d4e1a001f8b4567",
      "amount": 100,
      "type": "used",
      "cost_percentage": 10,
      "extra_costs": [],
      "consumption_type": "variable",
      "used_measure": {
        "_id": null,
        "ratio": null,
        "amount": null
      }
    }
  ],
  "code": "code",
  "name": "name",
  "note": "note",
  "is_active": false,
  "organization_ids": [
    "646b0c2f3d4e1a001f8b4567"
  ],
  "additional_costs": [
    {
      "cost_id": "646b0c2f3d4e1a001f8b4567",
      "amount": 100,
      "customer_id": "646b0c2f3d4e1a001f8b4567",
      "supplier_id": "646b0c2f3d4e1a001f8b4567",
      "employee_id": "646b0c2f3d4e1a001f8b4567",
      "person_id": "646b0c2f3d4e1a001f8b4567",
      "consumption_type": "variable"
    }
  ]
}
```

**Response**

Same response shape as [POST /production/route-sheet/create](#post-production-route-sheet-create).

## POST /production/route-sheet/get-paging

Get production-route-sheet by paging

**Required permission:** `production` · [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/production/route-sheet/get-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
```

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

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

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-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 |
|---|---|---|---|
| `page` | `number` | Yes | Default: `1` |
| `limit` | `number` | Yes | Default: `20` |
| `search` | `string` | No |  |
| `organization_id` | `string` | No |  |
| `is_active` | `boolean` | No | Default: `false` |

```json
{
  "page": 1,
  "limit": 20,
  "search": "string",
  "organization_id": "646b0c2f3d4e1a001f8b4567",
  "is_active": false
}
```

**Response**

`data.total` is the total number of records and `data.data[]` holds the current page. The table below describes one record.

| Field | Type | Description |
|---|---|---|
| `_id` | `string` |  |
| `product` | `object` |  |
| `product._id` | `string` |  |
| `product.name` | `string` |  |
| `product.box_item` | `number` | Default: `0` |
| `product.barcodes` | `object[]` |  |
| `product.barcodes[]._id` | `string` |  |
| `product.barcodes[].barcode` | `string` |  |
| `product.barcodes[].is_active` | `boolean` | Default: `false` |
| `product.barcode` | `string` |  |
| `product.measure` | `object` |  |
| `product.measure.name` | `string` |  |
| `product.measure.system_code` | `string` |  |
| `product.measure.code` | `string` |  |
| `product.measure.short_name` | `string` |  |
| `product.measure.decimal_count` | `number` | Default: `0` |
| `product.measure_id` | `string` |  |
| `product.dimension` | `object` |  |
| `product.dimension.shape` | `string` | One of: `circular`, `rectangular`, `other`. Default: `"other"` |
| `product.dimension.netto_weight` | `number` | Default: `0` |
| `product.dimension.gross_weight` | `number` | Default: `0` |
| `product.dimension.height` | `number` | Default: `0` |
| `product.dimension.volume` | `number` | Default: `0` |
| `product.dimension.diameter` | `number` | Default: `0` |
| `product.dimension.width` | `number` | Default: `0` |
| `product.dimension.length` | `number` | Default: `0` |
| `product.is_material` | `boolean` | Default: `false` |
| `product.is_product` | `boolean` | Default: `false` |
| `product.is_semi_product` | `boolean` | Default: `false` |
| `product.is_variant` | `boolean` | Default: `false` |
| `product.sku` | `string` |  |
| `warehouse_amount` | `number` |  |
| `type` | `string` |  |
| `measure_id` | `string` |  |
| `measure` | `object` |  |
| `measure.name` | `string` |  |
| `measure.system_code` | `string` |  |
| `measure.code` | `string` |  |
| `measure.short_name` | `string` |  |
| `measure.decimal_count` | `number` | Default: `0` |
| `amount` | `number` |  |
| `marks` | `string[]` |  |
| `route_sheet_id` | `string` |  |
| `cost_percentage` | `number` |  |
| `extra_costs` | `object[]` |  |
| `extra_costs[]._id` | `string` |  |
| `extra_costs[].cost_id` | `string` |  |
| `extra_costs[].amount` | `number` |  |
| `extra_costs[].employee_id` | `string` |  |
| `extra_costs[].customer_id` | `string` |  |
| `extra_costs[].supplier_id` | `string` |  |
| `extra_costs[].person_id` | `string` |  |

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "data": [
      {
        "_id": "646b0c2f3d4e1a001f8b4567",
        "product": {
          "_id": "646b0c2f3d4e1a001f8b4567",
          "name": "name",
          "box_item": 0,
          "barcodes": [
            {
              "_id": null,
              "barcode": null,
              "is_active": null
            }
          ],
          "barcode": "barcode",
          "measure": {
            "name": "name",
            "system_code": "system_code",
            "code": "code",
            "short_name": "short_name",
            "decimal_count": 0
          },
          "measure_id": "646b0c2f3d4e1a001f8b4567",
          "dimension": {
            "shape": "circular",
            "netto_weight": 0,
            "gross_weight": 0,
            "height": 0,
            "volume": 0,
            "diameter": 0,
            "width": 0,
            "length": 0
          },
          "is_material": false,
          "is_product": false,
          "is_semi_product": false,
          "is_variant": false,
          "sku": "sku"
        },
        "warehouse_amount": 0,
        "type": "string",
        "measure_id": "646b0c2f3d4e1a001f8b4567",
        "measure": {
          "name": "name",
          "system_code": "system_code",
          "code": "code",
          "short_name": "short_name",
          "decimal_count": 0
        },
        "amount": 100,
        "marks": [
          "string"
        ],
        "route_sheet_id": "646b0c2f3d4e1a001f8b4567",
        "cost_percentage": 10,
        "extra_costs": [
          {
            "_id": "646b0c2f3d4e1a001f8b4567",
            "cost_id": "646b0c2f3d4e1a001f8b4567",
            "amount": 100,
            "employee_id": "646b0c2f3d4e1a001f8b4567",
            "customer_id": "646b0c2f3d4e1a001f8b4567",
            "supplier_id": "646b0c2f3d4e1a001f8b4567",
            "person_id": "646b0c2f3d4e1a001f8b4567"
          }
        ]
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}
```

## GET /production/route-sheet/get-by-id/{id}

Get production-route-sheet using its _id

**Required permission:** `production` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-by-id/6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-by-id/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-by-id/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Path parameters**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | Yes |  |

**Request body**

No request body.

**Response**

Same response shape as [POST /production/route-sheet/create](#post-production-route-sheet-create).

## DELETE /production/route-sheet/delete/{id}

Delete a production-route-sheet

**Required permission:** `production` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/delete/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/delete/6712f0a9c4d1e87b3a0f9911', {
  method: 'DELETE',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "DELETE",
    "https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/delete/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/delete/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Path parameters**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | Yes |  |

**Request body**

No request body.

**Response**

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

## GET /production/route-sheet/get-deleted

Get deleted production-route-sheet ids

**Required permission:** `production` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-deleted?deleted_at=DELETED_AT' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-deleted?deleted_at=DELETED_AT', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-deleted?deleted_at=DELETED_AT",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-deleted?deleted_at=DELETED_AT');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Query parameters**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `deleted_at` | `string` | Yes |  |

**Request body**

No request body.

**Response**

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

## POST /production/route-sheet/get-with-quantity/{id}

Fetch one route sheet together with live per-warehouse stock for every material it consumes. get-by-id returns the recipe; this returns the recipe plus whether the warehouse can actually cover it — the read to make before launching production. Substitute products are hydrated with their own warehouse balances.

**Required permission:** `production` · [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/production/route-sheet/get-with-quantity/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "organization_id": "string",
  "warehouse_id": "string",
  "produced_warehouse_id": "string"
}'
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-with-quantity/6712f0a9c4d1e87b3a0f9911', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "organization_id": "string",
    "warehouse_id": "string",
    "produced_warehouse_id": "string"
  }),
})
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/production/route-sheet/get-with-quantity/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "organization_id": "string",
        "warehouse_id": "string",
        "produced_warehouse_id": "string",
    },
)
print(res.json())
```

```php [PHP]
<?php
$body = <<<'JSON'
{
  "organization_id": "string",
  "warehouse_id": "string",
  "produced_warehouse_id": "string"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-with-quantity/6712f0a9c4d1e87b3a0f9911');
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);
```

:::

**Path parameters**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | Yes | Production route-sheet ObjectId |

**Request body**

| Field | Type | Required | Description |
|---|---|---|---|
| `organization_id` | `string` | No | Scope the returned quantities to this organization ObjectId |
| `warehouse_id` | `string` | No | Warehouse ObjectId materials would be consumed from |
| `produced_warehouse_id` | `string` | No | Warehouse ObjectId the output would land in |

```json
{
  "organization_id": "string",
  "warehouse_id": "string",
  "produced_warehouse_id": "string"
}
```

**Response**

Same response shape as [POST /production/route-sheet/create](#post-production-route-sheet-create).

## GET /production/route-sheet/get-alternatives/{itemId}

List the substitute products registered for a single route-sheet item. Lets you resolve what may be swapped in when the primary material is short, without pulling the whole route sheet. Note the path param is the ITEM ObjectId, not the route sheet's.

**Required permission:** `production` · [how permissions work](https://docs.bito.uz/en/api/permissions.md)

**Example request**

::: code-group

```bash [curl]
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-alternatives/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
```

```js [JavaScript]
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-alternatives/6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
```

```python [Python]
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-alternatives/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
```

```php [PHP]
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production/route-sheet/get-alternatives/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
```

:::

**Path parameters**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `itemId` | `string` | Yes | Route-sheet item ObjectId (from products[]._id on get-by-id), NOT the route sheet ObjectId |

**Request body**

No request body.

**Response**

```json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "_id": "string",
      "product_id": "string",
      "amount": 0,
      "product": {
        "_id": "string",
        "name": "string",
        "_warehouses": []
      }
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}
```

---

*This page is generated from the OpenAPI spec.*
