Skip to content

Production operation ​

INFO

Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.

POST /production-operation/create ​

This method allows adding production-operation into the account.

Тело запроса

ПолеТипОбязательноОписание
itemsobject[]Даlist of materials of product. required if is_compound is true
items[].product_idstringДа
items[].amountnumberНет
items[].typestringДаДопустимые значения: used, produced
items[].cost_percentagenumberДа
items[].extra_costsobject[]Да
items[].extra_costs[].cost_idstringДа
items[].extra_costs[].amountnumberДа
codestringНет
notestringНет
statestringНетДопустимые значения: canceled, new, done, in_progress
organization_idstringДа
responsible_idstringНет
used_warehouse_idstringДа
used_datestring (date-time)Да
produced_warehouse_idstringДа
produced_datestring (date-time)Да
currency_idstringДа
route_sheet_idstringНет
amountnumberНетПо умолчанию: 0
create_reminderbooleanНетПо умолчанию: false
additional_costsobject[]Нет
additional_costs[].cost_idstringДа
additional_costs[].amountnumberДа
additional_costs[].customer_idstringНет
additional_costs[].supplier_idstringНет
additional_costs[].employee_idstringНет
additional_costs[].person_idstringНет
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"
    }
  ]
}

Ответ

ПолеТипОписание
_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.shapestringДопустимые значения: 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.

Тело запроса

ПолеТипОбязательноОписание
_idstringДа
itemsobject[]Даlist of materials of product. required if is_compound is true
items[].product_idstringДа
items[].amountnumberНет
items[].typestringДаДопустимые значения: used, produced
items[].cost_percentagenumberДа
items[].extra_costsobject[]Да
items[].extra_costs[].cost_idstringДа
items[].extra_costs[].amountnumberДа
codestringНет
notestringНет
organization_idstringНет
responsible_idstringНет
used_warehouse_idstringНет
used_datestring (date-time)Нет
produced_warehouse_idstringНет
produced_datestring (date-time)Нет
currency_idstringНет
route_sheet_idstringНет
amountnumberНетПо умолчанию: 0
create_reminderbooleanНетПо умолчанию: false
additional_costsobject[]Нет
additional_costs[].cost_idstringДа
additional_costs[].amountnumberДа
additional_costs[].customer_idstringНет
additional_costs[].supplier_idstringНет
additional_costs[].employee_idstringНет
additional_costs[].person_idstringНет
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"
    }
  ]
}

Ответ

Структура ответа совпадает с POST /production-operation/create.

POST /production-operation/get-paging ​

Get production-operation by paging

Тело запроса

ПолеТипОбязательноОписание
pagenumberДаПо умолчанию: 1
limitnumberДаПо умолчанию: 20
searchstringНетsearch string to filter by code or name
statestringНетstate of the production operation. Допустимые значения: canceled, new, done, in_progress
organization_idstringНетorganization id to filter by organization
responsible_idstringНетresponsible id to filter by responsible
route_sheet_idstringНетroute 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"
}

Ответ

data.total — общее количество записей, data.data[] — записи текущей страницы. Таблица ниже описывает одну запись.

ПолеТипОписание
_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

Параметры пути

ПараметрТипОбязательноОписание
idstringДа

Тело запроса

Тело запроса не требуется.

Ответ

Структура ответа совпадает с POST /production-operation/create.

PUT /production-operation/set-state ​

setState production-operation

Тело запроса

ПолеТипОбязательноОписание
_idstringДа
statestringДаДопустимые значения: canceled, new, done, in_progress
json
{
  "_id": "64b7f4d9e2b3b6a0b7c5d80a",
  "state": "new"
}

Ответ

Структура ответа совпадает с POST /production-operation/create.


Эта страница сгенерирована из спецификации OpenAPI.

Bito 2.0 Integration API