Adjust Stock
adjust_stockRecord a stock count, add stock, or remove stock at a managed warehouse — the Inventory page's Adjust, Add and Remove actions. Each line is one item at one location: mode=count sets that location's on-hand to the counted quantity; mode=add adds units at a unit cost (defaults to the item's cost); mode=remove takes units out (damage, shrinkage, samples) and posts the inventory-decrease accounting entry. Added stock releases backordered sales-order lines. Tracked items need their lot, expiry or serials. The preview shows each location's on-hand and available before and after. Two-step: preview=true, then commit with the previewReceipt. For opening-stock seeding use set_inventory_levels; to receive a purchase order use receive_purchase_order. Max 100 lines per call.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"lines": "<lines>"
},
"name": "adjust_stock"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | Stock lines (max 100). All lines commit together or not at all. | |
| preview | No | Step 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing is written until the commit call. | |
| clientId | No | Optional client id (GUID) for operator (unpinned) credentials on 3PL tenants: confines SKU/UPC matching to that client's items. Client-pinned credentials omit this. | |
| warehouseId | No | Internal warehouse id (GUID) from list_warehouses. May be omitted when the tenant has exactly one Internal warehouse. | |
| idempotencyKey | No | Caller-generated idempotency key; required with previewReceipt to commit. | |
| previewReceipt | No | Step 2: the receipt returned by the preview call. Supply with a fresh idempotencyKey to commit. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| lines | No | ||
| applied | No | ||
| preview | No | ||
| warnings | No | ||
| expiresAt | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| correlationId | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| idempotentReplay | No |