Execute Import
POST/api/supplier-inventories/5/import
Queues a supplier inventory import — creates or updates inventory records for a specific supplier in the background.
This endpoint is asynchronous. The HTTP response returns immediately (202 Accepted) with a tracked_job_log_id that the client polls via the global job tray for progress and completion status. There is no hard row cap on the payload — the queued job processes items in chunks of 500 in its own transaction per chunk, so payloads of any size complete cleanly without holding a long-running transaction open.
Authentication: Requires Bearer token.
Path params:
- supplier: Supplier ID
Body fields:
- items (required): Array of inventory items (1+). Only the top-level
itemsarray is validated at the HTTP layer; each row is validated inside the queued job and any per-row problems are surfaced as failures in the tracked job results rather than as a 422. (Per-rowexistsvalidation was intentionally removed from the request layer to avoid an N+1 that timed out large payloads.)- items.*.product_id (required): Product ID
- items.*.warehouse_id (optional): Warehouse ID
- items.*.quantity (optional): Stock quantity, integer >= 0
- items.*.eta (optional): Expected availability date
- items.*.in_stock (optional): Boolean stock flag
- items.*.discontinued (optional): Boolean discontinued flag
Errors:
- 422 only when the top-level
itemsarray is missing or empty. - 404 when the supplier does not exist.
- Invalid rows (e.g. unknown product_id) do NOT return 422 — the import is queued and those rows are reported as failures in the tracked job results.
Note: Use the validate endpoint first to preview and catch row-level errors before importing.
Request
Responses
- 200
Successful response