Skip to content

Production order ​

Production orders

INFO

Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.

POST /production-order/create ​

Create a new production order with its line items.

So‘rov tanasi

MaydonTurMajburiyTavsif
organization_idstringHaOrganization ObjectId the production order belongs to
datestring (date-time)HaProduction order date (ISO 8601)
codestringYo‘qOptional human-readable order code
notestringYo‘qOptional free-text note
itemsobject[]HaLine items — each references a product and a tech-map
items[].product_idstringHaProduct ObjectId to be produced
items[].tech_map_idstringHaTechnical map (recipe/BOM) ObjectId to use
items[].amountnumberHaPlanned production quantity
json
{
  "organization_id": "string",
  "date": "2025-05-01T12:00:00Z",
  "code": "string",
  "note": "string",
  "items": [
    {
      "product_id": "string",
      "tech_map_id": "string",
      "amount": 0
    }
  ]
}

Javob

MaydonTurTavsif
organization_idstringOrganization ObjectId the production order belongs to
datestring (date-time)Production order date (ISO 8601)
codestringOptional human-readable order code
notestringOptional free-text note
itemsobject[]Line items — each references a product and a tech-map
items[].product_idstringProduct ObjectId to be produced
items[].tech_map_idstringTechnical map (recipe/BOM) ObjectId to use
items[].amountnumberPlanned production quantity
_idstringProduction order ObjectId
statusstringCurrent production order state
is_deletedbooleanSoft-delete flag
created_atstring (date-time)Creation timestamp (ISO 8601)
updated_atstring (date-time)Last update timestamp (ISO 8601)
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "organization_id": "string",
    "date": "2025-05-01T12:00:00Z",
    "code": "string",
    "note": "string",
    "items": [
      {
        "product_id": "string",
        "tech_map_id": "string",
        "amount": 0
      }
    ],
    "_id": "string",
    "status": "string",
    "is_deleted": false,
    "created_at": "2025-05-01T12:00:00Z",
    "updated_at": "2025-05-01T12:00:00Z"
  },
  "time": "2025-05-01T12:00:00Z"
}

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

Fetch a single production order by ObjectId.

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaProduction-order ObjectId

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /production-order/create.

POST /production-order/get-paging ​

Paginated list of production orders, filterable by organization.

So‘rov tanasi

MaydonTurMajburiyTavsif
pagenumberHaStandart: 1
limitnumberHaStandart: 20
organization_idstringYo‘qFilter by organization ObjectId
json
{
  "page": 1,
  "limit": 20,
  "organization_id": "string"
}

Javob

MaydonTurTavsif
totalnumber
listobject[]
list[].organization_idstringOrganization ObjectId the production order belongs to
list[].datestring (date-time)Production order date (ISO 8601)
list[].codestringOptional human-readable order code
list[].notestringOptional free-text note
list[].itemsobject[]Line items — each references a product and a tech-map
list[].items[].product_idstringProduct ObjectId to be produced
list[].items[].tech_map_idstringTechnical map (recipe/BOM) ObjectId to use
list[].items[].amountnumberPlanned production quantity
list[]._idstringProduction order ObjectId
list[].statusstringCurrent production order state
list[].is_deletedbooleanSoft-delete flag
list[].created_atstring (date-time)Creation timestamp (ISO 8601)
list[].updated_atstring (date-time)Last update timestamp (ISO 8601)
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "list": [
      {
        "organization_id": "string",
        "date": "2025-05-01T12:00:00Z",
        "code": "string",
        "note": "string",
        "items": [],
        "_id": "string",
        "status": "string",
        "is_deleted": false,
        "created_at": "2025-05-01T12:00:00Z",
        "updated_at": "2025-05-01T12:00:00Z"
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /production-order/update/{id} ​

Update an existing production order and its line items.

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaProduction-order ObjectId

So‘rov tanasi

MaydonTurMajburiyTavsif
organization_idstringHaOrganization ObjectId the production order belongs to
datestring (date-time)HaProduction order date (ISO 8601)
codestringYo‘qOptional human-readable order code
notestringYo‘qOptional free-text note
itemsobject[]HaReplacement line items for the order
items[].product_idstringHaProduct ObjectId to be produced
items[].tech_map_idstringHaTechnical map (recipe/BOM) ObjectId to use
items[].amountnumberHaPlanned production quantity
json
{
  "organization_id": "string",
  "date": "2025-05-01T12:00:00Z",
  "code": "string",
  "note": "string",
  "items": [
    {
      "product_id": "string",
      "tech_map_id": "string",
      "amount": 0
    }
  ]
}

Javob

Javob tuzilishi quyidagi bilan bir xil: POST /production-order/create.

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

Soft-delete a production order by ObjectId.

Yo‘l parametrlari

ParametrTurMajburiyTavsif
idstringHaProduction-order ObjectId

So‘rov tanasi

So‘rov tanasi talab qilinmaydi.

Javob

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

Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.

Bito 2.0 Integration API