Skip to content

Bill of Materials (BOM)

GET    /api/bill-of-materials
GET    /api/bill-of-materials/{id}
POST   /api/bill-of-materials
PUT    /api/bill-of-materials/{id}
DELETE /api/bill-of-materials/{id}

Required privilege: Bill of Materials / View (read) ยท Bill of Materials / Edit (write)

A Bill of Materials defines the components required to produce a finished item. BOMs are used by manufacturing orders and the inventory planning engine to calculate component demand.


BOM Object

{
  "id": 901,
  "BOM Number": "BOM-A-001",
  "Item Id": 55,
  "Item Number": "ITEM-A",
  "Item Description": "Widget Assembly - Type A",
  "BOM Status": "Active",
  "details": [
    {
      "id": 951,
      "Component Item Id": 60,
      "Component Item Number": "COMP-X",
      "Component Description": "Component X",
      "Component Quantity": 2,
      "Component Unit": "EA"
    },
    {
      "id": 952,
      "Component Item Id": 61,
      "Component Item Number": "COMP-Y",
      "Component Description": "Component Y",
      "Component Quantity": 1,
      "Component Unit": "KG"
    }
  ]
}
Field Type Description
id integer Internal BOM identifier
BOM Number string Unique BOM reference
Item Number string The finished item this BOM produces
BOM Status string Active or Inactive
details array Component lines
details[].Component Item Number string Component item reference
details[].Component Quantity number Quantity of component per unit of output
details[].Component Unit string Unit of measure for the component

GET - List BOMs

curl -b cookies.txt "https://acme.knosc.com/api/bill-of-materials"

GET - Get BOM

curl -b cookies.txt "https://acme.knosc.com/api/bill-of-materials/901"

POST - Create BOM

POST /api/bill-of-materials HTTP/1.1
Content-Type: application/json
X-XSRF-TOKEN: <csrf>

{
  "BOM Number": "BOM-NEW",
  "Item Number": "ITEM-A",
  "BOM Status": "Active",
  "details": [
    {
      "Component Item Number": "COMP-X",
      "Component Quantity": 2
    }
  ]
}

Validation: Item Number and all Component Item Number values must exist in Item Master.


PUT - Update BOM

PUT /api/bill-of-materials/{id} HTTP/1.1
Content-Type: application/json
X-XSRF-TOKEN: <csrf>

Same schema as POST. Include all component lines to retain (with their id).


DELETE - Delete BOM

DELETE /api/bill-of-materials/{id} HTTP/1.1
X-XSRF-TOKEN: <csrf>

Error: Returns BillOfMaterials.StillInUse if the BOM is referenced by manufacturing orders.


Errors

Status Code Description
400 BillOfMaterials.NotFound No BOM with this ID
400 BillOfMaterials.StillInUse BOM referenced by manufacturing orders
400 ItemMaster.NotFound Item or component item not found
403 User.NotPrivileged Insufficient privilege