Skip to main content

Bulk Upsert

POST 

/api/skus/bulkupsert

Tier: Public — stable, supported for third-party integration.

Bulk upsert SKUs. Matches existing SKUs by the UpsertKey on the request (Id / ExternalRef / SkuNumber / BarcodeNumber). Reference-data dim refs accept Id / ExternalRef-or-Code / Name and are resolved in one batched call. When Organisation.AutoCreateReferenceData = true, missing dim refs with a supplied Name auto-create the dim row. InnerSku + template change + SkuType change are not supported in bulk — callers use the single-SKU endpoint for those.

Processing order: batch key-mode validation (a row missing the selected key fails the whole batch) → batched reference-data dim resolution (a per-row resolver error fails only that row) → per-row template/extended-property validation, intra-batch duplicate-key check, and intra-batch encoding-duplicate check (barcode number / CompanyPrefix+ItemReference / CustomPrefix across rows) → a single set-based merge → append price-history rows for any row whose prices changed. Lifecycle transitions run through the same state machine as SkuController.UpdateSku(...) (non-admin); a rejected transition fails only that row. Price edits on a Discontinued SKU are rejected and reverted for that row. On an unexpected exception mid-batch, every row not already marked Failed is marked Failed for batch consistency.

Request

Responses

Always returned (including for a null or empty request, which yields an empty list). Returns one BulkUpsertResultDto per input row with a Status of Created, Updated, Unchanged, or Failed, plus an ErrorMessage for failed rows (see Reference Data documentation for BulkUpsertResultDto / BulkUpsertStatus).