Apply Opening Stock
POST/api/shopify/:integrationInstance/inventory/opening-stock/apply
Queue the apply of a preview: each warehouse's opening (initial) count is created on the inventory start date, or edited in place when one exists, with the previewed quantities and costs. Units already shipped without stock are repaid from the new opening layers. Rows that are unchanged, negative or without a Shopify level are not written, so applying again never doubles stock. Refused while the opening stock is locked (books live), and once a warehouse's stock has moved it needs a user who may override approval policies. Requires the inventory:write scope and the inventory.count permission.
integrations:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Body: preview_id (required, integer) — the preview to apply; include_missing_cost (optional, boolean, default false) — also load rows with no cost at a unit cost of 0.
Authentication: Requires Bearer token.
Request
Responses
- 200
- 401
- 403
- 404
- 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
Response Headers
Not Found
Response Headers
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.