Bill Of Materials Item
Bill of Materials Items, are the individual items from on a Bill Of Materials
.
Schema​
BillOfMaterialsItem
​
Name | Type | Description | Example |
---|---|---|---|
id | ID | Unique BOM item identifier | "ckmnpybisiy5x08abky4g2d1f" |
createdAt | DateTime | When this BOM item was created | "2021-03-24 17:26:46.983Z" |
updatedAt | DateTime | When this BOM item was updated | "2021-03-24 17:26:46.983Z" |
catalogId | ID? | ID of catalog item this BOM item represents | "ckmnpybisiy5x08abky4g2dog" |
description | string | Description of item | "Safety Goggles" |
estimatedQuantity | number | Estimated quantity of the item | 5 |
mpn | string? | Manufacturer part number | BR115 |
unitOfMeasure | string? | Unit of measure | "EA" |
unitPrice | decimal? | Estimated unit price for this BOM item | 12.34 |
upc | string? | Universal product code | 012312312340 |
workBreakdownStructureValues | JSON | Other 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.
Name | Type | Description | Example |
---|---|---|---|
billOfMaterialsId | ID | Unique 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​
Name | Type | Description | Example |
---|---|---|---|
billOfMaterialsId | ID | Unique BOM identifier | "ckmnpybisiy5x08abky4g2d1f" |
billOfMaterialsItems | BillOfMaterialsItemInput[] | BOM item data | see schema below |
BillOfMaterialsItemInput​
Name | Type | Description | Example |
---|---|---|---|
catalogId | ID? | ID of Kojo catalog item | "ckmnpybisiy5x08abky4g2dog" |
description | string | Description of item | "Safety Goggles" |
estimatedQuantity | number | estimated quantity of the item | 5 |
mpn | string ? | Manufacturer part number | "BR115" |
unitOfMeasure? | string ? | Unit of measure (defaults to EA if not provided) | "EA" |
unitPrice | decimal ? | estimated unit price for this BOM item | 12.34 |
upc | string ? | universal product code | "012312312340" |
workBreakdownStructureValues | JSON | see 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​
Name | Type | Description | Example |
---|---|---|---|
billOfMaterialsItemId | ID | Unique BOM identifier | "ckmnpybisiy5x08abky4g2d1f" |
input | BillOfMaterialsItemInput | BOM item data | see schema below |
BillOfMaterialsItemInput​
Name | Type | Description | Example |
---|---|---|---|
catalogId | ID? | ID of Kojo catalog item | "ckmnpybisiy5x08abky4g2dog" |
description | string | Description of item | "Safety Goggles" |
estimatedQuantity | number | estimated quantity of the item | 5 |
mpn | string ? | Manufacturer part number | "BR115" |
unitOfMeasure? | string ? | Unit of measure | "EA" |
unitPrice | decimal ? | estimated unit price for this BOM item | 12.34 |
upc | string ? | universal product code | "012312312340" |
workBreakdownStructureValues | JSON | Any 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​
Name | Type | Description | Example |
---|---|---|---|
inputs | BillOfMaterialsItemInputs[] | BOM items data list, Max length: 1000 | see schema below |
BillOfMaterialsItemInputs​
Name | Type | Description | Example |
---|---|---|---|
billOfMaterialsItemId | ID | Unique BOM identifier | "ckmnpybisiy5x08abky4g2d1f" |
input | BillOfMaterialsItemInput | BOM item data | see schema below |
BillOfMaterialsItemInput​
Name | Type | Description | Example |
---|---|---|---|
catalogId | ID? | ID of Kojo catalog item | "ckmnpybisiy5x08abky4g2dog" |
description | string | Description of item | "Safety Goggles" |
estimatedQuantity | number | estimated quantity of the item | 5 |
mpn | string ? | Manufacturer part number | "BR115" |
unitOfMeasure? | string ? | Unit of measure | "EA" |
unitPrice | decimal ? | estimated unit price for this BOM item | 12.34 |
upc | string ? | universal product code | "012312312340" |
workBreakdownStructureValues | JSON | Any 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​
Name | Type | Description | Example |
---|---|---|---|
billOfMaterialsItemId | ID | Unique 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
]
}