Items

Adds or removes stock for an item at one location.

Requires ManageInventory and an Idempotency-Key header. A positive delta creates that many stock units at the location exactly like "Add inventory" on the Items page (template properties, cost, barcodes copied); a negative delta writes off the oldest available units the way "Delete" on the Inventory page does (soft delete - restorable in the app, recorded in each unit's change history with reason). Stock never goes negative here: removing more than is on hand answers 409 and changes nothing. Units in transit on a transfer are never touched. Omit locationId for the organization's "No Location" bucket. Misc items, parent groups and sub-unit items hold no stock (409); job sites are refused (422). Example: { "locationId": 3, "delta": -2, "reason": "Damaged in van" }.

post/api/v1/items/{id}/stock/adjust

Request

  • Base URL: https://app.flexonthejob.com
  • URL: https://app.flexonthejob.com/api/v1/items/{id}/stock/adjust
  • Auth: HTTP bearer

Path parameters

idinteger required

Numeric item id.

Request body

locationIdinteger nullable

Stock location the units are added to / removed from (see GET /api/v1/locations). Omit or null for the organization's "No Location" bucket. Job sites are refused (422).

deltainteger

Whole units to add (positive) or remove (negative); never zero. Removal takes the oldest available units first and is refused with 409 when fewer are on hand than requested. Example: 5 receives five units, -1 writes one off. At most 1000 units per call (each unit is a physical stock row); split larger changes into several calls.

reasonstring nullable

Optional reason recorded in each unit's change history (e.g. "Cycle count"). Max 500 characters.

Response

Stock changed; body carries the confirmation and the item's updated per-location stock.

itemIdinteger

The item (template) whose stock changed.

messagestring

Human-readable confirmation, e.g. Moved 3 x 'Widget' from 'Main' to 'Van 2'.

unitsinteger

Whole units added, removed or moved (always positive).

locationIdinteger

For an adjustment: the location adjusted. For a move: the source location.

locationNamestring

Name of LocationId.

destinationLocationIdinteger nullable

For a move: the destination location; null for an adjustment.

destinationLocationNamestring nullable

Name of DestinationLocationId; null for an adjustment.

Changes

No recorded changes to this operation across all 1 revision of this API.