Execute Import
POST/api/supplier-inventories/:id/import
Queues a supplier inventory import — creates or updates inventory records for a specific supplier in the background.
suppliers:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
This endpoint is asynchronous. The HTTP response returns immediately (202 Accepted) with a tracked_job_log_id that the client polls via the tracked job log endpoints 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
- 202
- 401
- 403
- 404
- 422
- 429
Accepted
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.