Import Initial Inventory
POST/api/initial-inventory/import
Loads a warehouse's opening stock from a CSV file and reports every row it did not load. Authentication: Requires Bearer token.
inventory:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Upload the CSV first with POST /api/store-file (multipart, destination=models) and pass the returned original_name and stored_name here.
CSV columns:
sku(orbarcode) — identifies the product. A row with neither is skipped.quantity— required, 0 or more.unit_cost— per unit, 0 or more. Leave blank to use the product's best available cost; a row whose product has no cost is skipped instead of being loaded at zero. An explicit0is loaded at zero.nameis accepted and ignored, so a file downloaded from Export Initial Inventory can be uploaded again.
Behaviour:
- Stock is dated on the account's inventory start date.
- Each row sets that product's opening stock in the warehouse; products not in the file keep theirs.
- Rows for an unknown SKU or barcode, a missing, non-numeric or negative quantity, a negative or non-numeric cost, or a repeat of a product already in the file (the first row wins) are skipped and listed in
skipped_rowswith a reason. - Files with more than 50 loadable rows are applied in the background: the response has
queued: true, and the user is emailed when the import finishes. - Only one import per warehouse runs at a time.
Errors:
- 422
nothing_imported— every row was skipped; nothing was written.datacarries the summary. - 422
inventory_start_date_not_set— set the inventory start date first. - 422
warehouse_required—meta.warehouse_idis missing or unknown. - 422
invalid_csv— the file could not be read as CSV. - 409
import_in_progress— another import for this warehouse is running.
Request
Responses
- 200
- 401
- 403
- 409
- 422
- 429
OK
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.
Conflict
Response Headers
Unprocessable Content
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.