Skip to content

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

FieldTypeRequiredDescription
itemsobject[]Yeslist of materials of product. required if is_compound is true
items[].product_idstringYes
items[].amountnumberNo
items[].typestringYesOne of: used, produced
items[].cost_percentagenumberYes
items[].extra_costsobject[]Yes
items[].extra_costs[].cost_idstringYes
items[].extra_costs[].amountnumberYes
codestringNo
notestringNo
statestringNoOne of: canceled, new, done, in_progress
organization_idstringYes
responsible_idstringNo
used_warehouse_idstringYes
used_datestring (date-time)Yes
produced_warehouse_idstringYes
produced_datestring (date-time)Yes
currency_idstringYes
route_sheet_idstringNo
amountnumberNoDefault: 0
create_reminderbooleanNoDefault: false
additional_costsobject[]No
additional_costs[].cost_idstringYes
additional_costs[].amountnumberYes
additional_costs[].customer_idstringNo
additional_costs[].supplier_idstringNo
additional_costs[].employee_idstringNo
additional_costs[].person_idstringNo
json
{
  "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

FieldTypeDescription
_idstring
productobject
product._idstring
product.namestring
product.box_itemnumber
product.barcodestring
product.barcodesobject[]
product.barcodes[]._idstring
product.barcodes[].is_activeboolean
product.barcodes[].barcodestring
product.measureobject
product.measure._idstring
product.measure.namestring
product.measure.codestring
product.measure.short_namestring
product.measure.decimal_countinteger
product.measure.system_codestring
product.dimensionobject
product.dimension.shapestringOne of: circular, rectangular, other
product.dimension.netto_weightnumber
product.dimension.gross_weightnumber
product.dimension.heightnumber
product.dimension.volumenumber
product.dimension.diameternumber
product.dimension.widthnumber
product.dimension.lengthnumber
product.is_materialboolean
product.is_productboolean
product.is_semi_productboolean
product.is_variantboolean
product.skustring
typestring
amountnumber
marksstring[]
warehouse_amountnumber
total_costnumber
total_expensenumber
extra_costsobject[]
cost_percentagenumber
used_warehouseobject
used_warehouse._idstring
used_warehouse.namestring
produced_warehouseobject
produced_warehouse._idstring
produced_warehouse.namestring
organizationobject
organization._idstring
organization.namestring
currencyobject
currency._idstring
currency.namestring
currency_idstring
itemsobject[]
statestring
is_overusedboolean
codestring
total_producednumber
total_usednumber
numberstring
produced_datestring (date-time)
total_used:number
used_datestring (date-time)
additional_costsobject[]
additional_costs[]._idstring
additional_costs[].cost_idstring
additional_costs[].amountnumber
additional_costs[].customer_idstring
additional_costs[].employee_idstring
additional_costs[].supplier_idstring
additional_costs[].person_idstring
created_atstring (date-time)
created_byobject
created_by._idstring
created_by.full_namestring
route_sheetobject
route_sheet._idstring
route_sheet.namestring
route_sheet.codestring
responsibleobject
responsible._idstring
responsible.full_namestring
responsible.phone_numberstring
notestring
json
{
  "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

FieldTypeRequiredDescription
_idstringYes
itemsobject[]Yeslist of materials of product. required if is_compound is true
items[].product_idstringYes
items[].amountnumberNo
items[].typestringYesOne of: used, produced
items[].cost_percentagenumberYes
items[].extra_costsobject[]Yes
items[].extra_costs[].cost_idstringYes
items[].extra_costs[].amountnumberYes
codestringNo
notestringNo
organization_idstringNo
responsible_idstringNo
used_warehouse_idstringNo
used_datestring (date-time)No
produced_warehouse_idstringNo
produced_datestring (date-time)No
currency_idstringNo
route_sheet_idstringNo
amountnumberNoDefault: 0
create_reminderbooleanNoDefault: false
additional_costsobject[]No
additional_costs[].cost_idstringYes
additional_costs[].amountnumberYes
additional_costs[].customer_idstringNo
additional_costs[].supplier_idstringNo
additional_costs[].employee_idstringNo
additional_costs[].person_idstringNo
json
{
  "_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

FieldTypeRequiredDescription
pagenumberYesDefault: 1
limitnumberYesDefault: 20
searchstringNosearch string to filter by code or name
statestringNostate of the production operation. One of: canceled, new, done, in_progress
organization_idstringNoorganization id to filter by organization
responsible_idstringNoresponsible id to filter by responsible
route_sheet_idstringNoroute sheet id to filter by route sheet
json
{
  "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.

FieldTypeDescription
_idstring
used_warehouseobject
used_warehouse._idstring
used_warehouse.namestring
produced_warehouseobject
produced_warehouse._idstring
produced_warehouse.namestring
organizationobject
organization._idstring
organization.namestring
currencyobject
currency._idstring
currency.namestring
currency_idstring
itemsobject[]
statestring
is_overusedboolean
codestring
total_producednumber
total_usednumber
total_costnumber
numberstring
produced_datestring (date-time)
amountnumber
total_used:number
used_datestring (date-time)
additional_costsobject[]
additional_costs[]._idstring
additional_costs[].cost_idstring
additional_costs[].amountnumber
additional_costs[].customer_idstring
additional_costs[].employee_idstring
additional_costs[].supplier_idstring
additional_costs[].person_idstring
total_expensenumber
created_atstring (date-time)
created_byobject
created_by._idstring
created_by.full_namestring
route_sheetobject
route_sheet._idstring
route_sheet.namestring
route_sheet.codestring
responsibleobject
responsible._idstring
responsible.full_namestring
responsible.phone_numberstring
notestring
json
{
  "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

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

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

PUT /production-operation/set-state ​

setState production-operation

Request body

FieldTypeRequiredDescription
_idstringYes
statestringYesOne of: canceled, new, done, in_progress
json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d80a",
  "state": "new"
}

Response

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


This page is generated from the OpenAPI spec.

Bito 2.0 Integration API