Inventory
API reference for inventory items, transactions, counts, and valuation.
Inventory items, receipts, issues, adjustments, physical counts, and valuation. All endpoints require tenant context via entityId.
Authentication
- Session cookie — set when signed in via the web app
- API key — pass via the
x-api-keyheader
All endpoints require authentication and entity access.
Endpoints
List data
| Method | Endpoint | Description |
|---|---|---|
GET | /api/inventory?entityId=&view= | List items, transactions, counts, count-lines, valuation, or lots |
GET /api/inventory
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
entityId | string | Yes | Entity ID for tenant context |
view | string | Yes | items, transactions, counts, count-lines, valuation, or lots |
itemId | string | No | Filter by item (for transactions, valuation) |
asOfDate | string | No | Date for valuation (YYYY-MM-DD) |
Response shape depends on view:
- items — Array of inventory items with SKU, name, quantity, costing method
- transactions — Receipts, issues, adjustments with dates and quantities
- counts — Physical count sessions with status
- count-lines — Per-item count lines for a count session
- valuation — Inventory valuation by item (quantity × cost)
- lots — Lot-level detail for lot-tracked items
Create and update
| Method | Endpoint | Description |
|---|---|---|
POST | /api/inventory | Actions: create-item, receive, issue, adjust, write-down, create-count, record-count-line, finalize-count |
PUT | /api/inventory | Update item |
DELETE | /api/inventory?id=&entityId= | Soft-delete item |
POST /api/inventory
Request body varies by action:
{
"entityId": "string",
"action": "create-item" | "receive" | "issue" | "adjust" | "write-down" | "create-count" | "record-count-line" | "finalize-count",
"itemId": "string",
"sku": "string",
"name": "string",
"costingMethod": "fifo" | "lifo" | "weighted-average" | "specific-id",
"inventoryAccountId": "string",
"cogsAccountId": "string",
"quantity": 0,
"unitCost": 0,
"reference": "string",
"countId": "string",
"countedQuantity": 0,
"reason": "string"
}| Action | Description |
|---|---|
create-item | Create inventory item with SKU, accounts, costing method |
receive | Record inventory receipt (increase quantity) |
issue | Record inventory issue/sale (decrease quantity) |
adjust | Quantity adjustment (increase or decrease) |
write-down | LCM write-down to market value |
create-count | Create physical count session |
record-count-line | Record counted quantity for an item in a count |
finalize-count | Finalize count and post variance to ledger |
PUT /api/inventory
Request body:
{
"entityId": "string",
"itemId": "string",
"name": "string",
"inventoryAccountId": "string",
"cogsAccountId": "string",
"costingMethod": "string"
}DELETE /api/inventory
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Item ID to soft-delete |
entityId | string | Yes | Entity ID for tenant context |
Soft-delete marks the item inactive; historical transactions remain.