Production operation
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-operation/create
This method allows adding production-operation into the account.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
items | object[] | Yes | list of materials of product. required if is_compound is true |
items[].product_id | string | Yes | |
items[].amount | number | No | |
items[].type | string | Yes | One of: used, produced |
items[].cost_percentage | number | Yes | |
items[].extra_costs | object[] | Yes | |
items[].extra_costs[].cost_id | string | Yes | |
items[].extra_costs[].amount | number | Yes | |
code | string | No | |
note | string | No | |
state | string | No | One of: canceled, new, done, in_progress |
organization_id | string | Yes | |
responsible_id | string | No | |
used_warehouse_id | string | Yes | |
used_date | string (date-time) | Yes | |
produced_warehouse_id | string | Yes | |
produced_date | string (date-time) | Yes | |
currency_id | string | Yes | |
route_sheet_id | string | No | |
amount | number | No | Default: 0 |
create_reminder | boolean | No | Default: false |
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 |
{
"items": [
{
"product_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"type": "produced",
"cost_percentage": 10,
"extra_costs": []
}
],
"code": "string",
"note": "string",
"state": "canceled",
"organization_id": "string",
"responsible_id": "string",
"used_warehouse_id": "string",
"used_date": "2024-07-20T10:30:00Z",
"produced_warehouse_id": "string",
"produced_date": "2024-07-20T10:30:00Z",
"currency_id": "string",
"route_sheet_id": "string",
"amount": 0,
"create_reminder": false,
"additional_costs": [
{
"cost_id": "string",
"amount": 0,
"customer_id": "string",
"supplier_id": "string",
"employee_id": "string",
"person_id": "string"
}
]
}Response
| Field | Type | Description |
|---|---|---|
_id | string | |
product | object | |
product._id | string | |
product.name | string | |
product.box_item | number | |
product.barcode | string | |
product.barcodes | object[] | |
product.barcodes[]._id | string | |
product.barcodes[].is_active | boolean | |
product.barcodes[].barcode | string | |
product.measure | object | |
product.measure._id | string | |
product.measure.name | string | |
product.measure.code | string | |
product.measure.short_name | string | |
product.measure.decimal_count | integer | |
product.measure.system_code | string | |
product.dimension | object | |
product.dimension.shape | string | One of: circular, rectangular, other |
product.dimension.netto_weight | number | |
product.dimension.gross_weight | number | |
product.dimension.height | number | |
product.dimension.volume | number | |
product.dimension.diameter | number | |
product.dimension.width | number | |
product.dimension.length | number | |
product.is_material | boolean | |
product.is_product | boolean | |
product.is_semi_product | boolean | |
product.is_variant | boolean | |
product.sku | string | |
type | string | |
amount | number | |
marks | string[] | |
warehouse_amount | number | |
total_cost | number | |
total_expense | number | |
extra_costs | object[] | |
cost_percentage | number | |
used_warehouse | object | |
used_warehouse._id | string | |
used_warehouse.name | string | |
produced_warehouse | object | |
produced_warehouse._id | string | |
produced_warehouse.name | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
currency | object | |
currency._id | string | |
currency.name | string | |
currency_id | string | |
items | object[] | |
state | string | |
is_overused | boolean | |
code | string | |
total_produced | number | |
total_used | number | |
number | string | |
produced_date | string (date-time) | |
total_used: | number | |
used_date | string (date-time) | |
additional_costs | object[] | |
additional_costs[]._id | string | |
additional_costs[].cost_id | string | |
additional_costs[].amount | number | |
additional_costs[].customer_id | string | |
additional_costs[].employee_id | string | |
additional_costs[].supplier_id | string | |
additional_costs[].person_id | string | |
created_at | string (date-time) | |
created_by | object | |
created_by._id | string | |
created_by.full_name | string | |
route_sheet | object | |
route_sheet._id | string | |
route_sheet.name | string | |
route_sheet.code | string | |
responsible | object | |
responsible._id | string | |
responsible.full_name | string | |
responsible.phone_number | string | |
note | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"product": {
"_id": "string",
"name": "string",
"box_item": 0,
"barcode": "string",
"barcodes": [
{
"_id": null,
"is_active": null,
"barcode": null
}
],
"measure": {
"_id": "string",
"name": "string",
"code": "string",
"short_name": "string",
"decimal_count": 0,
"system_code": "string"
},
"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": "string"
},
"type": "string",
"amount": 0,
"marks": [
"string"
],
"warehouse_amount": 0,
"total_cost": 0,
"total_expense": 0,
"extra_costs": [
{}
],
"cost_percentage": 0,
"used_warehouse": {
"_id": "string",
"name": "string"
},
"produced_warehouse": {
"_id": "string",
"name": "string"
},
"organization": {
"_id": "string",
"name": "string"
},
"currency": {
"_id": "string",
"name": "string"
},
"currency_id": "string",
"items": [
{}
],
"state": "string",
"is_overused": false,
"code": "string",
"total_produced": 0,
"total_used": 0,
"number": "string",
"produced_date": "2025-05-01T12:00:00Z",
"total_used:": 0,
"used_date": "2025-05-01T12:00:00Z",
"additional_costs": [
{
"_id": "string",
"cost_id": "string",
"amount": 0,
"customer_id": "string",
"employee_id": "string",
"supplier_id": "string",
"person_id": "string"
}
],
"created_at": "2025-05-01T12:00:00Z",
"created_by": {
"_id": "string",
"full_name": "string"
},
"route_sheet": {
"_id": "string",
"name": "string",
"code": "string"
},
"responsible": {
"_id": "string",
"full_name": "string",
"phone_number": "string"
},
"note": "string"
},
"time": "2025-05-01T12:00:00Z"
}PUT /production-operation/update
This method allows updating production-operation in the account.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | Yes | |
items | object[] | Yes | list of materials of product. required if is_compound is true |
items[].product_id | string | Yes | |
items[].amount | number | No | |
items[].type | string | Yes | One of: used, produced |
items[].cost_percentage | number | Yes | |
items[].extra_costs | object[] | Yes | |
items[].extra_costs[].cost_id | string | Yes | |
items[].extra_costs[].amount | number | Yes | |
code | string | No | |
note | string | No | |
organization_id | string | No | |
responsible_id | string | No | |
used_warehouse_id | string | No | |
used_date | string (date-time) | No | |
produced_warehouse_id | string | No | |
produced_date | string (date-time) | No | |
currency_id | string | No | |
route_sheet_id | string | No | |
amount | number | No | Default: 0 |
create_reminder | boolean | No | Default: false |
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 |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"items": [
{
"product_id": "64b7f4d9e2b3b6a0b7c5d80a",
"amount": 10,
"type": "produced",
"cost_percentage": 10,
"extra_costs": []
}
],
"code": "string",
"note": "string",
"organization_id": "string",
"responsible_id": "string",
"used_warehouse_id": "string",
"used_date": "2024-07-20T10:30:00Z",
"produced_warehouse_id": "string",
"produced_date": "2024-07-20T10:30:00Z",
"currency_id": "string",
"route_sheet_id": "string",
"amount": 0,
"create_reminder": false,
"additional_costs": [
{
"cost_id": "string",
"amount": 0,
"customer_id": "string",
"supplier_id": "string",
"employee_id": "string",
"person_id": "string"
}
]
}Response
Same response shape as POST /production-operation/create.
POST /production-operation/get-paging
Get production-operation by paging
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Default: 1 |
limit | number | Yes | Default: 20 |
search | string | No | search string to filter by code or name |
state | string | No | state of the production operation. One of: canceled, new, done, in_progress |
organization_id | string | No | organization id to filter by organization |
responsible_id | string | No | responsible id to filter by responsible |
route_sheet_id | string | No | route sheet id to filter by route sheet |
{
"page": 1,
"limit": 20,
"search": "string",
"state": "canceled",
"organization_id": "string",
"responsible_id": "string",
"route_sheet_id": "string"
}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 | |
used_warehouse | object | |
used_warehouse._id | string | |
used_warehouse.name | string | |
produced_warehouse | object | |
produced_warehouse._id | string | |
produced_warehouse.name | string | |
organization | object | |
organization._id | string | |
organization.name | string | |
currency | object | |
currency._id | string | |
currency.name | string | |
currency_id | string | |
items | object[] | |
state | string | |
is_overused | boolean | |
code | string | |
total_produced | number | |
total_used | number | |
total_cost | number | |
number | string | |
produced_date | string (date-time) | |
amount | number | |
total_used: | number | |
used_date | string (date-time) | |
additional_costs | object[] | |
additional_costs[]._id | string | |
additional_costs[].cost_id | string | |
additional_costs[].amount | number | |
additional_costs[].customer_id | string | |
additional_costs[].employee_id | string | |
additional_costs[].supplier_id | string | |
additional_costs[].person_id | string | |
total_expense | number | |
created_at | string (date-time) | |
created_by | object | |
created_by._id | string | |
created_by.full_name | string | |
route_sheet | object | |
route_sheet._id | string | |
route_sheet.name | string | |
route_sheet.code | string | |
responsible | object | |
responsible._id | string | |
responsible.full_name | string | |
responsible.phone_number | string | |
note | string |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"data": [
{
"_id": "string",
"used_warehouse": {
"_id": "string",
"name": "string"
},
"produced_warehouse": {
"_id": "string",
"name": "string"
},
"organization": {
"_id": "string",
"name": "string"
},
"currency": {
"_id": "string",
"name": "string"
},
"currency_id": "string",
"items": [
{}
],
"state": "string",
"is_overused": false,
"code": "string",
"total_produced": 0,
"total_used": 0,
"total_cost": 0,
"number": "string",
"produced_date": "2025-05-01T12:00:00Z",
"amount": 0,
"total_used:": 0,
"used_date": "2025-05-01T12:00:00Z",
"additional_costs": [
{
"_id": "string",
"cost_id": "string",
"amount": 0,
"customer_id": "string",
"employee_id": "string",
"supplier_id": "string",
"person_id": "string"
}
],
"total_expense": 0,
"created_at": "2025-05-01T12:00:00Z",
"created_by": {
"_id": "string",
"full_name": "string"
},
"route_sheet": {
"_id": "string",
"name": "string",
"code": "string"
},
"responsible": {
"_id": "string",
"full_name": "string",
"phone_number": "string"
},
"note": "string"
}
]
},
"time": "2025-05-01T12:00:00Z"
}GET /production-operation/get-by-id/{id}
Get production-operation using its _id
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes |
Request body
No request body.
Response
Same response shape as POST /production-operation/create.
PUT /production-operation/set-state
setState production-operation
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | Yes | |
state | string | Yes | One of: canceled, new, done, in_progress |
{
"_id": "64b7f4d9e2b3b6a0b7c5d80a",
"state": "new"
}Response
Same response shape as POST /production-operation/create.
This page is generated from the OpenAPI spec.