# INVENTORY

inventory endpoints.

**Base URL:** `https://api.trustpager.com/functions/v1/api/v1`

## Endpoints

### GET /inventory/locations

List inventory locations (warehouses / stockrooms) in the workspace.

**Scopes:** `products:read` — [full detail](./inventory/get-inventory-locations.md)

### POST /inventory/locations

Create an inventory location (warehouse / stockroom). Requires name.

**Scopes:** `products:write` — [full detail](./inventory/post-inventory-locations.md)

### GET /inventory/locations/:location_id

Fetch a single inventory location by UUID.

**Scopes:** `products:read` — [full detail](./inventory/get-inventory-locations-location-id.md)

### PATCH /inventory/locations/:location_id

Update an inventory location. Pass only the fields you want to change.

**Scopes:** `products:write` — [full detail](./inventory/patch-inventory-locations-location-id.md)

### DELETE /inventory/locations/:location_id

Delete an inventory location by UUID. Destructive.

**Scopes:** `products:delete` — [full detail](./inventory/delete-inventory-locations-location-id.md)

### GET /inventory/batches

List inventory batches/lots. Filter by product_id or search by batch_number.

**Scopes:** `products:read` — [full detail](./inventory/get-inventory-batches.md)

### POST /inventory/batches

Create an inventory batch/lot for a product. Stock is added separately by recording a receive movement.

**Scopes:** `products:write` — [full detail](./inventory/post-inventory-batches.md)

### GET /inventory/batches/:batch_id

Fetch a single inventory batch by UUID.

**Scopes:** `products:read` — [full detail](./inventory/get-inventory-batches-batch-id.md)

### PATCH /inventory/batches/:batch_id

Update an inventory batch. The product it belongs to cannot be changed.

**Scopes:** `products:write` — [full detail](./inventory/patch-inventory-batches-batch-id.md)

### DELETE /inventory/batches/:batch_id

Delete an inventory batch by UUID. Destructive.

**Scopes:** `products:delete` — [full detail](./inventory/delete-inventory-batches-batch-id.md)

### GET /inventory/movements

List inventory stock movements (the ledger). Filter by product_id, batch_id, or reference.

**Scopes:** `products:read` — [full detail](./inventory/get-inventory-movements.md)

### POST /inventory/movements

Record a stock movement (receive, ship, transfer, adjust_in, adjust_out, dispose). Stock on hand updates automatically. receive/adjust_in need to_location_id; ship/adjust_out/dispose need from_location_id; transfer needs both. The ledger is append-only — correct mistakes with an offsetting movement.

**Scopes:** `products:write` — [full detail](./inventory/post-inventory-movements.md)

### GET /inventory/stock

List current stock on hand (per batch, per location). Filter by batch_id or location_id. Maintained automatically from the movements ledger.

**Scopes:** `products:read` — [full detail](./inventory/get-inventory-stock.md)

### GET /inventory/stock/summary

Per-product stock summary (total on hand, batch count, earliest expiry) for inventory-tracked products. Filter by product_id.

**Scopes:** `products:read` — [full detail](./inventory/get-inventory-stock-summary.md)
