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
| Field | Type | Required | Description |
|---|---|---|---|
organization_id | string | Yes | Organization ObjectId the production order belongs to |
date | string (date-time) | Yes | Production order date (ISO 8601) |
code | string | No | Optional human-readable order code |
note | string | No | Optional free-text note |
items | object[] | Yes | Line items — each references a product and a tech-map |
items[].product_id | string | Yes | Product ObjectId to be produced |
items[].tech_map_id | string | Yes | Technical map (recipe/BOM) ObjectId to use |
items[].amount | number | Yes | Planned production quantity |
{
"organization_id": "string",
"date": "2025-05-01T12:00:00Z",
"code": "string",
"note": "string",
"items": [
{
"product_id": "string",
"tech_map_id": "string",
"amount": 0
}
]
}Response
| Field | Type | Description |
|---|---|---|
organization_id | string | Organization ObjectId the production order belongs to |
date | string (date-time) | Production order date (ISO 8601) |
code | string | Optional human-readable order code |
note | string | Optional free-text note |
items | object[] | Line items — each references a product and a tech-map |
items[].product_id | string | Product ObjectId to be produced |
items[].tech_map_id | string | Technical map (recipe/BOM) ObjectId to use |
items[].amount | number | Planned production quantity |
_id | string | Production order ObjectId |
status | string | Current production order state |
is_deleted | boolean | Soft-delete flag |
created_at | string (date-time) | Creation timestamp (ISO 8601) |
updated_at | string (date-time) | Last update timestamp (ISO 8601) |
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Production-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
| Field | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Default: 1 |
limit | number | Yes | Default: 20 |
organization_id | string | No | Filter by organization ObjectId |
{
"page": 1,
"limit": 20,
"organization_id": "string"
}Response
| Field | Type | Description |
|---|---|---|
total | number | |
list | object[] | |
list[].organization_id | string | Organization ObjectId the production order belongs to |
list[].date | string (date-time) | Production order date (ISO 8601) |
list[].code | string | Optional human-readable order code |
list[].note | string | Optional free-text note |
list[].items | object[] | Line items — each references a product and a tech-map |
list[].items[].product_id | string | Product ObjectId to be produced |
list[].items[].tech_map_id | string | Technical map (recipe/BOM) ObjectId to use |
list[].items[].amount | number | Planned production quantity |
list[]._id | string | Production order ObjectId |
list[].status | string | Current production order state |
list[].is_deleted | boolean | Soft-delete flag |
list[].created_at | string (date-time) | Creation timestamp (ISO 8601) |
list[].updated_at | string (date-time) | Last update timestamp (ISO 8601) |
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Production-order ObjectId |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
organization_id | string | Yes | Organization ObjectId the production order belongs to |
date | string (date-time) | Yes | Production order date (ISO 8601) |
code | string | No | Optional human-readable order code |
note | string | No | Optional free-text note |
items | object[] | Yes | Replacement line items for the order |
items[].product_id | string | Yes | Product ObjectId to be produced |
items[].tech_map_id | string | Yes | Technical map (recipe/BOM) ObjectId to use |
items[].amount | number | Yes | Planned production quantity |
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Production-order ObjectId |
Request body
No request body.
Response
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}This page is generated from the OpenAPI spec.