Skip to content
View as Markdown

Production step ​

Production process steps

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-step/create ​

Create a new production step (an individual manufacturing stage such as cutting, assembly, or QC).

Required permission: production · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/production-step/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production-step/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/production-step/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "name": "string"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production-step/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

FieldTypeRequiredDescription
namestringYesDisplay name of the production step (required)
codestringNoOptional human-readable code for this step
notestringNoOptional free-text note
used_warehouse_idstringNoObjectId of the warehouse used in this step (optional)
employee_idsstring[]NoObjectIds of employees assigned to this step (optional)
attachmentsobject[]NoPre-uploaded attachment object references (optional)
attachments[].namestringNoFile name of the attachment
attachments[].sizenumberNoFile size in bytes
attachments[].pathstringYes
attachments[].notestringNo
json
{
  "name": "string",
  "code": "string",
  "note": "string",
  "used_warehouse_id": "string",
  "employee_ids": [
    "string"
  ],
  "attachments": [
    {
      "name": "string",
      "size": 0,
      "path": "string",
      "note": "string"
    }
  ]
}

Response

FieldTypeDescription
_idstringProduction step ObjectId
namestringDisplay name of the step
numberstringAuto-assigned sequential number
codestringHuman-readable code
notestringFree-text note
used_warehouseobjectDenormalized warehouse used in this step (present when used_warehouse_id is set)
used_warehouse._idstring
used_warehouse.namestring
used_warehouse.numberstring
employeesobject[]Denormalized employee records assigned to this step
employees[]._idstring
employees[].full_namestring
employees[].numberstring
employees[].attachmentsobject[]
attachmentsobject[]Attachment records linked to this step
created_atstring (date-time)ISO 8601 creation timestamp
updated_atstring (date-time)ISO 8601 last-update timestamp
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "name": "string",
    "number": "string",
    "code": "string",
    "note": "string",
    "used_warehouse": {
      "_id": "string",
      "name": "string",
      "number": "string"
    },
    "employees": [
      {
        "_id": "string",
        "full_name": "string",
        "number": "string",
        "attachments": []
      }
    ],
    "attachments": [
      {}
    ],
    "created_at": "2025-05-01T12:00:00Z",
    "updated_at": "2025-05-01T12:00:00Z"
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /production-step/get-by-id/{id} ​

Fetch a single production step by ObjectId.

Required permission: production · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/production-step/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production-step/get-by-id/6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/production-step/get-by-id/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production-step/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

ParameterTypeRequiredDescription
idstringYesProduction step ObjectId

Request body

No request body.

Response

Same response shape as POST /production-step/create.

POST /production-step/get-paging ​

Paginated list of production steps, filterable by name/code/number search.

Required permission: production · how permissions work

Example request

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/production-step/get-paging' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "page": 1,
  "limit": 20
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production-step/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
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/production-step/get-paging",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "page": 1,
        "limit": 20,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "page": 1,
  "limit": 20
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production-step/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

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
searchstringNoFree-text search.
updated_atstring (date-time)NoOnly records updated at or after this time.
organization_idstringNoOrganization ObjectId.
sort_bystringNoField name to sort by.
ascintegerNoSort direction: 1 ascending, -1 descending.. One of: -1, 1
json
{
  "page": 1,
  "limit": 20,
  "search": "string",
  "updated_at": "2025-05-01T12:00:00Z",
  "organization_id": "64b7f4d9e2b3b6a0b7c5d7ff",
  "sort_by": "string",
  "asc": -1
}

Response

FieldTypeDescription
totalnumber
listobject[]
list[]._idstringProduction step ObjectId
list[].namestringDisplay name of the step
list[].numberstringAuto-assigned sequential number
list[].codestringHuman-readable code
list[].notestringFree-text note
list[].used_warehouseobjectDenormalized warehouse used in this step (present when used_warehouse_id is set)
list[].used_warehouse._idstring
list[].used_warehouse.namestring
list[].used_warehouse.numberstring
list[].employeesobject[]Denormalized employee records assigned to this step
list[].employees[]._idstring
list[].employees[].full_namestring
list[].employees[].numberstring
list[].employees[].attachmentsobject[]
list[].attachmentsobject[]Attachment records linked to this step
list[].created_atstring (date-time)ISO 8601 creation timestamp
list[].updated_atstring (date-time)ISO 8601 last-update timestamp
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "list": [
      {
        "_id": "string",
        "name": "string",
        "number": "string",
        "code": "string",
        "note": "string",
        "used_warehouse": {
          "_id": null,
          "name": null,
          "number": null
        },
        "employees": [],
        "attachments": [],
        "created_at": "2025-05-01T12:00:00Z",
        "updated_at": "2025-05-01T12:00:00Z"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /production-step/update ​

Update an existing production step. Requires _id plus at minimum the name field.

Required permission: production · how permissions work

Example request

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/production-step/update' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "_id": "string"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production-step/update', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string",
    "_id": "string"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/production-step/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
        "_id": "string",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "name": "string",
  "_id": "string"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production-step/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

FieldTypeRequiredDescription
namestringYesDisplay name of the production step (required)
codestringNoOptional human-readable code for this step
notestringNoOptional free-text note
used_warehouse_idstringNoObjectId of the warehouse used in this step (optional)
employee_idsstring[]NoObjectIds of employees assigned to this step (optional)
attachmentsobject[]NoPre-uploaded attachment object references (optional)
attachments[].namestringNoFile name of the attachment
attachments[].sizenumberNoFile size in bytes
attachments[].pathstringYes
attachments[].notestringNo
_idstringYesObjectId of the production step to update (required)
json
{
  "name": "string",
  "code": "string",
  "note": "string",
  "used_warehouse_id": "string",
  "employee_ids": [
    "string"
  ],
  "attachments": [
    {
      "name": "string",
      "size": 0,
      "path": "string",
      "note": "string"
    }
  ],
  "_id": "string"
}

Response

Same response shape as POST /production-step/create.

DELETE /production-step/delete/{id} ​

Soft-delete a production step by ObjectId (sets is_deleted=true). The step is no longer returned in normal listings after deletion.

Required permission: production · how permissions work

Example request

bash
curl -X DELETE 'https://api.bito.uz/integration-api/integration/api/v2/production-step/delete/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/production-step/delete/6712f0a9c4d1e87b3a0f9911', {
  method: 'DELETE',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "DELETE",
    "https://api.bito.uz/integration-api/integration/api/v2/production-step/delete/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/production-step/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

ParameterTypeRequiredDescription
idstringYesProduction step ObjectId to soft-delete

Request body

No request body.

Response

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

This page is generated from the OpenAPI spec.

Bito 2.0 Integration API