Skip to main content

Bill Of Materials Item

Bill of Materials Items, are the individual items from on a Bill Of Materials.

Schema​

BillOfMaterialsItem​

NameTypeDescriptionExample
idIDUnique BOM item identifier"ckmnpybisiy5x08abky4g2d1f"
createdAtDateTimeWhen this BOM item was created"2021-03-24 17:26:46.983Z"
updatedAtDateTimeWhen this BOM item was updated"2021-03-24 17:26:46.983Z"
catalogIdID?ID of catalog item this BOM item represents"ckmnpybisiy5x08abky4g2dog"
descriptionstringDescription of item"Safety Goggles"
estimatedQuantitynumberEstimated quantity of the item5
mpnstring?Manufacturer part numberBR115
unitOfMeasurestring?Unit of measure"EA"
unitPricedecimal?Estimated unit price for this BOM item12.34
upcstring?Universal product code012312312340
workBreakdownStructureValuesJSONOther content associated with this BOM item in key-value pairs. See more info below[{ "structureType": "Phase code", "value": "12" }]

workBreakdownStructureValues​

Work Breakdown Structures are key/value pairs indicating how this item fits into your project's workflow. While the structureType can be any string, we support the following Enriched Structure Type Names:

  • 'Cost Code'
  • 'Floor'
  • 'Phase'
  • 'Phase Code'
  • 'Section'
  • 'System'

Queries​

billOfMaterialsItems​

Read all billOfMaterialsItems from a parent billOfMaterials, with pagination and filtering.

Parameters​

Accepts all standard pagination parameters.

NameTypeDescriptionExample
billOfMaterialsIdIDUnique BOM identifier"ckmnpybisiy5x08abky4g2d1f"

Allowed orderBy fields: createdAt, description, estimatedQuantity, id, unitPrice, updatedAt.

Allowed filter fields: createdAt, description, estimatedQuantity, id, unitPrice, updatedAt.

Response​

A list of BillOfMaterialsItem objects.

Example Query​

query {
billOfMaterialsItems(
billOfMaterialsId: "ckmnpybisiy5x08abky4g2d1f",
limit: 10,
orderBy: estimatedQuantity
) {
id
description
estimatedQuantity
}
}

Example Response​

[
{
"id": "ckmnpybisiy5x08abky4g2d1f",
"description": "EMT Conduit",
"estimatedQuantity": 50
},
{
"id": "ckmnpybi7ag5x08abky4g2d1f",
"description": "Eaton Breaker",
"estimatedQuantity": 100
}
{
"id": "ckmnpybi7ag5x08abky4g2d1f",
"description": "4 Sq Box",
"estimatedQuantity": 200
}
]

Mutations​

addBillOfMaterialsItems​

Creates new Bill Of Materials Items, and any associated BomWorkBreakdownStructureValue against a Bill of Materials.

Parameters​

NameTypeDescriptionExample
billOfMaterialsIdIDUnique BOM identifier"ckmnpybisiy5x08abky4g2d1f"
billOfMaterialsItemsBillOfMaterialsItemInput[]BOM item datasee schema below

BillOfMaterialsItemInput​

NameTypeDescriptionExample
catalogIdID?ID of Kojo catalog item"ckmnpybisiy5x08abky4g2dog"
descriptionstringDescription of item"Safety Goggles"
estimatedQuantitynumberestimated quantity of the item5
mpnstring?Manufacturer part number"BR115"
unitOfMeasure?string?Unit of measure (defaults to EA if not provided)"EA"
unitPricedecimal?estimated unit price for this BOM item12.34
upcstring?universal product code"012312312340"
workBreakdownStructureValuesJSONsee WBS Values (name/value pairs)[{ "structureType": "Phase", "value": "12" }]

Response​

Returns the newly-created BOM items

Example Mutation​

mutation {
addBillOfMaterialsItems(
billOfMaterialsId: "ckyd9f1jn4332914x62igy1oni",
billOfMaterialsItems: [
{
description: "3/4\" EMT",
estimatedQuantity: 5,
workBreakdownStructureValues: [ { structureType: "Phase", value: "12" }, { structureType: "Floor", value: "2nd" } ]
}
]
) {
id
description
mpn
workBreakdownStructureValues {
structureName
value
}
}
}

Example Response​

[{
"id": "ckyd9f1jn4332914x62igycat",
"createdAt": "2022-01-13T17:42:40.019Z",
"updatedAt": "2022-01-13T17:42:40.019Z",
"description": "3/4\" EMT",
"estimatedQuantity": 5,
"workBreakdownStructureValues": [
{ "structureType": "Phase", "value": "12" },
{ "structureType": "Floor", "value": "2nd" },
]
}]

updateBillOfMaterialsItem​

Updates fields to a specific BillOfMaterialsItem, and adds any associated BomWorkBreakdownStructureValues.

Parameters​

NameTypeDescriptionExample
billOfMaterialsItemIdIDUnique BOM identifier"ckmnpybisiy5x08abky4g2d1f"
inputBillOfMaterialsItemInputBOM item datasee schema below

BillOfMaterialsItemInput​

NameTypeDescriptionExample
catalogIdID?ID of Kojo catalog item"ckmnpybisiy5x08abky4g2dog"
descriptionstringDescription of item"Safety Goggles"
estimatedQuantitynumberestimated quantity of the item5
mpnstring?Manufacturer part number"BR115"
unitOfMeasure?string?Unit of measure"EA"
unitPricedecimal?estimated unit price for this BOM item12.34
upcstring?universal product code"012312312340"
workBreakdownStructureValuesJSONAny wbsValues input will be additive (must explicitly set WBS values to null if wanting to remove them)[{ "structureType": "Phase", "value": "12" }]

Response​

Returns the newly-updated BOM item

Example Mutation​

mutation {
updateBillOfMaterialsItem(
billOfMaterialsId: "ckyd9f1jn4332914x62igy1oni",
input: { description: "Updated EMT", estimatedQuantity: 5, workBreakdownStructureValues: [ { structureType: "Phase", value: "12" } ] }
) {
id
description
estimatedQuantity
workBreakdownStructureValues {
structureName
value
}
}
}

Example Response​

[{
"id": "ckyd9f1jn4332914x62igy1oni",
"createdAt": "2022-01-13T17:42:40.019Z",
"updatedAt": "2022-01-13T17:42:40.019Z",
"description": "Updated EMT",
"estimatedQuantity": 5,
"workBreakdownStructureValues": [
{ "structureType": "Phase", "value": "12" }, // newly added
{ "structureType": "Floor", "value": "2nd" }, // existing
]
}]

updateManyBillOfMaterialsItems​

Updates fields for multiple BillOfMaterialsItems, and adds any associated BomWorkBreakdownStructureValues.

caution

A maximum of a 1000 items can be updated per request.

caution

Duplicated item IDs are not accepted.

Parameters​

NameTypeDescriptionExample
inputsBillOfMaterialsItemInputs[]BOM items data list, Max length: 1000see schema below

BillOfMaterialsItemInputs​

NameTypeDescriptionExample
billOfMaterialsItemIdIDUnique BOM identifier"ckmnpybisiy5x08abky4g2d1f"
inputBillOfMaterialsItemInputBOM item datasee schema below

BillOfMaterialsItemInput​

NameTypeDescriptionExample
catalogIdID?ID of Kojo catalog item"ckmnpybisiy5x08abky4g2dog"
descriptionstringDescription of item"Safety Goggles"
estimatedQuantitynumberestimated quantity of the item5
mpnstring?Manufacturer part number"BR115"
unitOfMeasure?string?Unit of measure"EA"
unitPricedecimal?estimated unit price for this BOM item12.34
upcstring?universal product code"012312312340"
workBreakdownStructureValuesJSONAny wbsValues input will be additive (must explicitly set WBS values to null if wanting to remove them)[{ "structureType": "Phase", "value": "12" }]

Response​

Returns a list of all updated BOM items.

Example Mutation​

mutation {
updateManyBillOfMaterialsItem(
inputs: [{
billOfMaterialsItemId: "ckyd9f1jn4332914x62igy1oni",
input: {
description: "Updated EMT",
estimatedQuantity: 5,
workBreakdownStructureValues: [{ structureType: "Phase", value: "12" }]
}
}]
) {
id
description
estimatedQuantity
workBreakdownStructureValues {
structureName
value
}
}
}

Example Response​

{
"data": {
"updateManyBillOfMaterialsItem": {
[
{
"id": "ckyd9f1jn4332914x62igy1oni",
"createdAt": "2022-01-13T17:42:40.019Z",
"updatedAt": "2022-01-13T17:42:40.019Z",
"description": "Updated EMT",
"estimatedQuantity": 5,
"workBreakdownStructureValues": [
{
"structureType": "Phase",
"value": "12"
}, // newly added
{
"structureType": "Floor",
"value": "2nd"
} // existing
]
}
]
}
}
}

deleteBillOfMaterialsItem​

Deletes a Bill Of Materials Item and ensures that all associated entities WBS values are also deleted

Parameters​

NameTypeDescriptionExample
billOfMaterialsItemIdIDUnique BOM identifier"ckmnpybisiy5x08abky4g2d1f"

Response​

Returns the deleted BOM item

Example Mutation​

mutation {
deleteBillOfMaterialsItem(
billOfMaterialsItemId: "ckyd9f1jn4332914x62igy1oni",
) {
id
description
estimatedQuantity
}
}

Example Response​

{
"id": "ckyd9f1jn4332914x62igy1oni",
"createdAt": "2022-01-13T17:42:40.019Z",
"updatedAt": "2022-01-13T17:42:40.019Z",
"description": "Updated EMT",
"estimatedQuantity": 5,
"workBreakdownStructureValues": [
{ "structureType": "Phase", "value": "12" }, // newly added
{ "structureType": "Floor", "value": "2nd" }, // existing
]
}