Inventory Manager API · stocktakes
Complete the stocktake
POST /stocktakes/{stocktakeId}/complete
Complete the stocktake, appending inventory.stocktake-completed: every counted (SKU, location) is set to its count (a hold above it is cut).
An opening stocktake values every stock SKU at the cost entered on it, else the SKU's cost basis — 409 StocktakeIncomplete names the SKUs with neither — and counts every pair nobody counted at what inventory holds, so its fact carries the whole opening balance: accounting opens the general ledger there and every ledger app may then be activated. A read-only organization's opening stocktake is completed by going live, never by a person: 409 OpeningStocktakeAtGoLive. A periodic one's variance posts as a write-down or a gain. Idempotent by state: a stocktake completes once, so a retry on a completed stocktake is acknowledged and appends nothing.
Access
Requires stock:write.
How scopes come from roles: Scopes and roles. Getting a token: Authentication and app tokens.
Retries
Idempotent by state: a stocktake completes once, so a retry on a completed stocktake is acknowledged and appends nothing.
Why every write carries a key: Idempotency and retries.
Facts appended
inventory.stocktake-completed
What a fact is: Facts and the journal.
AI agent tool
Agents call this as inventory_complete_stocktake (Inventory: Complete stocktake), in the stocktakes toolset.
Connecting an agent: AI agents.
Example
curl -X POST 'https://inventory.getmanifold.io/stocktakes/stk_01a16585-57c0-7200-961d-25255f868ed4/complete' \
-H "Authorization: Bearer $MANIFOLD_TOKEN"const response = await fetch("https://inventory.getmanifold.io/stocktakes/stk_01a16585-57c0-7200-961d-25255f868ed4/complete", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.MANIFOLD_TOKEN}` },
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
const answer = await response.json();{
"id": "stk_01a16585-57c0-7200-961d-25255f868ed4",
"number": "ST-00002",
"kind": "periodic",
"status": "completed",
"locationIds": [
"loc_019cadd3-8330-7e12-aa44-2cd5f05da74a"
],
"counts": [
{
"sku": "WIDGET-BLUE",
"locationId": "loc_019cadd3-8330-7e12-aa44-2cd5f05da74a",
"counted": 137
},
{
"sku": "WIDGET-RED",
"locationId": "loc_019cadd3-8330-7e12-aa44-2cd5f05da74a",
"counted": 0
}
],
"costs": [],
"startedAt": "2026-10-22T21:30:00.000Z",
"updatedAt": "2026-10-22T22:10:00.000Z",
"completedAt": "2026-10-22T22:10:00.000Z"
}The panel writes this call in other languages. It does not send it: Manifold's APIs do not take calls from a web
page on another site, so run the call from your own code or terminal. The whole API as OpenAPI: inventory-manager.openapi.json. Base URL https://inventory.getmanifold.io.
Errors
Every refusal is a status and a JSON body whose _tag names it. A refused call changes nothing.
401
| Refusal | What it means | What to do |
|---|---|---|
Unauthorized reason | The token is missing, expired or not one Manifold issued. | Get a fresh token and send the call again. |
TokenAlreadyUsed tokenId | A single-use app token was already spent. | Mint a new token for this call. |
402
| Refusal | What it means | What to do |
|---|---|---|
SubscriptionRequired status | The organization's subscription has lapsed, so writes are refused. | An owner settles billing. Reads still work meanwhile. |
403
| Refusal | What it means | What to do |
|---|---|---|
TenantRequired userId | The token names no organization. | Choose the organization, then get a new token. |
ScopeRequired required | The token's roles do not grant the scope this call needs. | Ask an owner or admin for a role that grants it. |
404
| Refusal | What it means | What to do |
|---|---|---|
StocktakeNotFound stocktakeId | No such record in this organization. | Check the id in the path or the body. |
409
| Refusal | What it means | What to do |
|---|---|---|
StocktakeNotOpen stocktakeId, status | The stocktake is completed or cancelled, so it takes no more counts. | Start a new stocktake. |
StocktakeIncomplete stocktakeId, missing, skus | Some SKUs have no cost on the stocktake and no cost basis. skus names them. | Enter a cost for each, then complete it. |
OpeningStocktakeAtGoLive stocktakeId | An opening stocktake completes when the organization goes live, not before. | Keep counting. Going live completes it. |
MirroredFromSource source | This area is fed by your source system until the organization goes live. | Make the change in the source system, or go live first. |
503
| Refusal | What it means | What to do |
|---|---|---|
RequestLogUnavailable tokenId, reason | The service could not record the request, so it did nothing. | Send the same request again shortly. |
How refusals work everywhere: Errors.
Used in
- Journal an additional cost on an order, step 5: Complete it
- Open the books with a stocktake, step 8: Try to complete it with a SKU unvalued
- Open the books with a stocktake, step 10: Complete the opening stocktake
- Open the books with a stocktake, step 11: Complete it again
- Open the books with a stocktake, step 18: Complete the recount