Creates several items in one call. All or nothing.

POST /inventory/items/bulk

Group: Inventory › Items · Operation ID: bulkCreateItems

Creates several items in one call, all or nothing. If any row is rejected, nothing is created and the error names the offending row's index. Rows are checked against each other as well as against stored items, so two rows claiming the same item code collide just as a row colliding with a stored one does.

For per-row independence, call POST inventory/items once per row.

Open in the interactive reference

Parameters

Name In Type Required Description
Api-Version header "v1" yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.
Idempotency-Key header string no An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored.

Request body

Required, application/json: bulkCreateItemsInput.

Field Type Required Description
items array of object yes The items to create. All or nothing: if any row is invalid, the whole call fails and nothing is created.
items[].itemCode string yes The item code, for example 'WIDGET-01'. Must be unique within the tenant, including against retired items whose codes are never released. It cannot be changed after the item is created.
items[].itemName string no The display name of the item.
items[].itemTypeId string yes The unique identifier of the item's type. It cannot be changed after the item is created. See id on GET inventory/item-types/:id.
items[].categoryId string yes The unique identifier of the item's category. See id on GET inventory/item-categories/:id.
items[].inventoryUnitId string yes The unique identifier of the unit stock is counted in. Every quantity on an inventory level or transaction will be in this unit. It must be one of the units in unitGroupId. See id on GET inventory/unit-of-measures/:id.
items[].unitGroupId string yes The unique identifier of the unit of measure group that has the conversions between the item's units. inventoryUnitId, salesUnitId and purchaseUnitId must all be units in this group, and a unit outside it fails with UNIT_NOT_IN_UNIT_GROUP. See id on GET inventory/unit-of-measure-groups/:id.
items[].salesUnitId string no The unique identifier of the unit used on sales documents. Omit when it is the same as the inventory unit. It must be one of the units in unitGroupId. See id on GET inventory/unit-of-measures/:id.
items[].purchaseUnitId string no The unique identifier of the unit used on purchase documents. Omit when it is the same as the inventory unit. It must be one of the units in unitGroupId. See id on GET inventory/unit-of-measures/:id.
items[].valuationMethod string no How the item's stock is valued. Accepted values: 'movingAverage', 'batch', 'serials', 'none'. Use 'none' for an item that is not stocked. Defaults to 'movingAverage'. 'batch' requires isBatch, 'serials' requires isSerial, and 'none' requires isInventory false, and each contradiction fails with TRACKING_MISMATCH. 'fifo' is under development and fails with VALUATION_METHOD_UNAVAILABLE.
items[].isBatch boolean no Whether the item is tracked by batch. Defaults to false.
items[].isSerial boolean no Whether the item is tracked by serial number. Defaults to false.
items[].isInventory boolean no Whether stock levels are kept for the item. Defaults to true. Set false for a service or charge item.
items[].isSalesItem boolean no Whether the item can appear on sales documents. Defaults to true.
items[].isPurchaseItem boolean no Whether the item can appear on purchase documents. Defaults to true.
items[].active boolean no Whether the item can be selected on new documents. Defaults to true. Setting it false retires the item without deleting it.
items[].notes string no Free text on the item.
items[].externalItemId string no Your own identifier for this item in an external system.
items[].brandName string no The display name of the brand.
items[].imageAvatar string no The URL of the item's avatar image.
items[].eccnNumber string no The Export Control Classification Number.
items[].htsCode string no The Harmonized Tariff Schedule code.
items[].countryOfOrigin string no The country the item originates from.
items[].minStockLevel string (decimal) no The stock level below which the item should be reordered, in the inventory unit.
items[].minimumTransactionQuantity string (decimal) no The smallest quantity any document can move. Omit for no restriction. Omitting it is not the same as sending 1.
items[].leadTime string (decimal) no The number of days between ordering the item and receiving it.
items[].standardCost string (decimal) no The standard cost carried for planning. State its currency in currency.
items[].itemPurchasePrice string (decimal) no The expected purchase price. State its currency in currency.
items[].currency string no The currency of standardCost and itemPurchasePrice. Required when either is given. Format ISO 4217, for example 'USD'.
items[].weight string (decimal) no The weight of one item, in weightUnit. Set it if the item may be received under a landed cost that uses Weight allocation, because that mode fails rather than falling back when an item has no weight.
items[].weightUnit string no The unit weight is expressed in. Accepted values: 'G', 'Kg', 'Lbs'.
items[].grossWeight string (decimal) no The weight including packaging, in weightUnit.
items[].netWeight string (decimal) no The weight excluding packaging, in weightUnit.
items[].length string (decimal) no The length of one item. A landed cost Volume allocation needs length, width and height together, and fails when the set is incomplete.
items[].width string (decimal) no The width of one item.
items[].height string (decimal) no The height of one item.
items[].volumePerUnit string (decimal) no The volume of one item, in volumeUnit.
items[].volumeUnit string no The unit volumePerUnit is expressed in. Accepted values: 'L'.
items[].defaultAllocationMode string no The allocation mode a landed cost charge billed as this item falls back to when it names none. Accepted values: 'Equal', 'Quantity', 'LineTotal', 'Weight', 'Volume'.
items[].isPerishable boolean no Whether the item expires.
items[].shelfLifeDays number no The number of days the item keeps from production.
items[].minShelfLifeDaysOnReceipt number no The least remaining shelf life a receipt of this item will accept.
items[].minShelfLifeDaysOnDispatch number no The least remaining shelf life a dispatch of this item will accept.
items[].bestBeforeOffsetDays number no The number of days between the expiry date and the best-before date printed on it.
items[].storageTempMin string (decimal) no The lowest storage temperature, in degrees Celsius.
items[].storageTempMax string (decimal) no The highest storage temperature, in degrees Celsius.

Example:

{
  "items": [
    {
      "itemCode": "WIDGET-01",
      "itemName": "Standard widget",
      "itemTypeId": "66aea173-07b8-4c4e-bc4a-5c35dedfdc16",
      "categoryId": "6709e2bf-d6cf-4800-9ffa-d5a496ec4d0b",
      "inventoryUnitId": "77bd4c16-e1f0-426d-a98f-07b063df2d9c",
      "unitGroupId": "38b5454a-c3fe-452b-9754-61f9ead49e87"
    }
  ]
}

Response

200 Success

Under data (bulkCreateItemsOutput):

Field Type Required Description
created array of object yes The created items, in the same order as the input.
created[].id string yes The unique identifier for the created item.
created[].itemCode string no The item code of the created item.

Response headers

Errors

Code Status
REFERENCE_NOT_FOUND 400
DUPLICATE_CODE 400
UNKNOWN_VALUE 400
TRACKING_MISMATCH 400
ITEM_TYPE_NOT_STOCKABLE 400
VALUATION_METHOD_UNAVAILABLE 400
UNIT_NOT_IN_UNIT_GROUP 400
IDEMPOTENCY_KEY_CONFLICT 409
IDEMPOTENCY_PAYLOAD_MISMATCH 422

Statuses