mutation ConvertItemToKitItem($request: ConvertItemToKitItemCommandRequestInput!) {
ConvertItemToKitItem(request: $request) {
itemId
components {
componentItemId
quantity
comment
position
}
}
}{
"request": {
"itemId": "id",
"components": [
{
"componentItemId": "id",
"quantity": "value"
}
]
}
}{
"data": {
"ConvertItemToKitItem": {
"itemId": "id",
"components": [
{
"componentItemId": "id",
"quantity": "value",
"comment": "string",
"position": 1
}
]
}
}
}ConvertItemToKitItem
Converts an existing standard item into a kit, so that selling one unit of it consumes a fixed set of component items from then on. The full component list is mandatory, because a standard item has no component list to fall back on - supplying at least one component is what makes the item a kit. The item keeps its ID, but the conversion resets several settings and converting back does not restore them: the suppliers are removed, because a kit has no suppliers; stock management is switched off first, which clears the per-warehouse minimum and maximum stock levels written through “PATCH /v2/items//warehouse-constraints” and switches “allowNegativeStock” off; and divisible stock is switched off. An item that tracks best-before dates, batches or serial numbers is not converted at all (409). The kit’s stock management is then derived from its components - it is stock-managed as soon as one component is - so read the item after the conversion to see the resulting settings. There is no direct reverse operation: removing the last component with “DELETE /v2/items//kit-items/components/” or “DeleteKitItemComponent” dissolves the kit and turns the item back into a standard item. Because an item that is itself a kit is never an eligible component, kits cannot be nested. Use “POST /v2/items//kit-items/components” or “AddKitItemComponent” to add a further component to a kit that already exists.
If a request with this mutation’s Idempotency-Key was already completed, the response’s extensions contains an idempotency.{responseName} entry with wasReplayed: true.
ConvertItemToKitItem(request: ConvertItemToKitItemCommandRequestInput!): ConvertItemToKitItemCommandResponse!Arguments
Unique ID of the converted item. Unchanged - a kit keeps the ID it had as a standard item.
The components as they were stored, in their effective order. Worth reading for the effective position of each component, which differs from the requested one when a requested position was out of bounds and got clamped.
mutation ConvertItemToKitItem($request: ConvertItemToKitItemCommandRequestInput!) {
ConvertItemToKitItem(request: $request) {
itemId
components {
componentItemId
quantity
comment
position
}
}
}{
"request": {
"itemId": "id",
"components": [
{
"componentItemId": "id",
"quantity": "value"
}
]
}
}{
"data": {
"ConvertItemToKitItem": {
"itemId": "id",
"components": [
{
"componentItemId": "id",
"quantity": "value",
"comment": "string",
"position": 1
}
]
}
}
}Was this page helpful?