mutation CreateStockItem($request: CreateStockItemCommandRequestInput!) {
CreateStockItem(request: $request) {
itemId
}
}{
"request": {
"categories": {
"categories": [
{
"categoryId": "id"
}
]
},
"identifiers": {},
"descriptions": {
"defaultDescriptions": [
{
"languageIso": "string",
"descriptionData": {}
}
]
},
"stockManagement": {
"hasShelfLifeExpirationDate": true,
"hasBatch": true,
"serialNumberTrackingType": "NONE",
"divisibilityType": "NONE"
}
}
}{
"data": {
"CreateStockItem": {
"itemId": "id"
}
}
}CreateStockItem
Creates a new item that is a stock item from the start, so that its stock is managed in warehouses. Takes the same properties as POST /v2/items, except for three: the optional storageConstraints block is replaced by a mandatory stockManagement block, images are not part of this request - assign them with PATCH /v2/items/ once the item exists - and salesChannels is not either, activate channels with POST /v2/items//sales-channels//activate. Use POST /v2/items//stock-items/convert to turn an item that already exists into a stock item.
If a request with this mutation’s Idempotency-Key was already completed, the response’s extensions contains an idempotency.{responseName} entry with wasReplayed: true.
CreateStockItem(request: CreateStockItemCommandRequestInput!): CreateStockItemCommandResponse!Arguments
Returns
Unique ID of the newly created stock item - this key is used for all further operations with the item.
mutation CreateStockItem($request: CreateStockItemCommandRequestInput!) {
CreateStockItem(request: $request) {
itemId
}
}{
"request": {
"categories": {
"categories": [
{
"categoryId": "id"
}
]
},
"identifiers": {},
"descriptions": {
"defaultDescriptions": [
{
"languageIso": "string",
"descriptionData": {}
}
]
},
"stockManagement": {
"hasShelfLifeExpirationDate": true,
"hasBatch": true,
"serialNumberTrackingType": "NONE",
"divisibilityType": "NONE"
}
}
}{
"data": {
"CreateStockItem": {
"itemId": "id"
}
}
}Was this page helpful?