Skip to content

Production order ​

Production orders

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

Create a new production order with its line items.

Request body

FieldTypeRequiredDescription
organization_idstringYesOrganization ObjectId the production order belongs to
datestring (date-time)YesProduction order date (ISO 8601)
codestringNoOptional human-readable order code
notestringNoOptional free-text note
itemsobject[]YesLine items — each references a product and a tech-map
items[].product_idstringYesProduct ObjectId to be produced
items[].tech_map_idstringYesTechnical map (recipe/BOM) ObjectId to use
items[].amountnumberYesPlanned 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
    }
  ]
}

Response

FieldTypeDescription
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.

Path parameters

ParameterTypeRequiredDescription
idstringYesProduction-order ObjectId

Request body

No request body.

Response

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

POST /production-order/get-paging ​

Paginated list of production orders, filterable by organization.

Request body

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
organization_idstringNoFilter by organization ObjectId
json
{
  "page": 1,
  "limit": 20,
  "organization_id": "string"
}

Response

FieldTypeDescription
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.

Path parameters

ParameterTypeRequiredDescription
idstringYesProduction-order ObjectId

Request body

FieldTypeRequiredDescription
organization_idstringYesOrganization ObjectId the production order belongs to
datestring (date-time)YesProduction order date (ISO 8601)
codestringNoOptional human-readable order code
notestringNoOptional free-text note
itemsobject[]YesReplacement line items for the order
items[].product_idstringYesProduct ObjectId to be produced
items[].tech_map_idstringYesTechnical map (recipe/BOM) ObjectId to use
items[].amountnumberYesPlanned 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
    }
  ]
}

Response

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

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

Soft-delete a production order by ObjectId.

Path parameters

ParameterTypeRequiredDescription
idstringYesProduction-order ObjectId

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