createBomDraft
Requires permission biddesk:assembly:manage.
Opens an assembly's next draft bill of materials, copying the lines of fromVersionId or else of its released version. Refused with BOM_DRAFT_EXISTS (and draftId) when the assembly already has a draft. Requires Bid Desk with engineered products and permission to manage assemblies.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation CreateBomDraft($assemblyProductId: ID!) {
createBomDraft(assemblyProductId: $assemblyProductId) {
id
status
createdAt
assemblyProductId
note
obsoletedAt
lines {
id
findNumber
alternateProductIds
bomVersionId
componentProductId
drawingRef
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CreateBomDraft($assemblyProductId: ID!) {\n createBomDraft(assemblyProductId: $assemblyProductId) {\n id\n status\n createdAt\n assemblyProductId\n note\n obsoletedAt\n lines {\n id\n findNumber\n alternateProductIds\n bomVersionId\n componentProductId\n drawingRef\n }\n }\n}",
"variables": {
"assemblyProductId": "id"
}
}
EOF
Variables:
{
"assemblyProductId": "id"
}
Response:
{
"data": {
"createBomDraft": {
"id": "id",
"status": "DRAFT",
"createdAt": "2025-01-15T00:00:00Z",
"assemblyProductId": "id",
"note": "string",
"obsoletedAt": "2025-01-15T00:00:00Z",
"lines": [
{
"id": "id",
"findNumber": "string",
"alternateProductIds": [
"id"
],
"bomVersionId": "id",
"componentProductId": "id",
"drawingRef": "string"
}
]
}
}
}
createBomDraft(
assemblyProductId: ID!
fromVersionId: ID
): BomVersionWithLines!
Arguments
createBomDraft.assemblyProductId ● ID! non-null scalar
The assembly product.
createBomDraft.fromVersionId ● ID scalar
A version of the same assembly to copy; default its released version.
Type
BomVersionWithLines object
A bill-of-materials version with its live lines.