REST API

Items API

Manage inventory items, stock levels, and valuation.

Generated from the Celerp 2.4.0 OpenAPI schema, 16 September 2026.

GET /items

List Items

List items with optional filters. status: exact status to show (e.g. "sold", "archived", "available"). Pass "all" to skip status filtering entirely. Default (None): exclude sold + archived from results. category: exact category to filter on. filter: semantic filter. "low_stock" keeps only items at or below their reorder point (see celerp.services.reorder.is_below_reorder). on_memo_to: customer contact_id. Scope to items currently out on memo to that customer, valued (holding_value) at the price they were quoted. consigned_from: supplier contact_id. Scope to items currently held on consignment from that supplier, valued (holding_value) at cost. When a contact scope is active the response also carries value_total, the sum of holding_value over the whole scoped set (pre-pagination).

Parameters

NameInRequiredTypeDescription
limitquery--integer--
offsetquery--integer--
qquery--string, optional--
skuquery--string, optional--
skusquery--string, optional--
barcodequery--string, optional--
gtinquery--string, optional--
rfid_epcquery--string, optional--
statusquery--string, optional--
categoryquery--string, optional--
inventory_typequery--string, optional--
location_idquery--string, optional--
sourcequery--string, optional--
filterquery--string, optional--
on_memo_toquery--string, optional--
consigned_fromquery--string, optional--
sortquery--string, optional--
dirquery--string--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/items \
  -H "Authorization: Bearer $TOKEN"

POST /items

Post Item

Request body

FieldTypeRequiredDescription
skustring, optional--Sku
namestringyesName
sell_bystringyesSell By
quantitynumber--Quantity
categorystring, optional--Category
location_idstring, optional--Location Id
cost_pricenumber, optional--Cost Price
cost_totalnumber, optional--Cost Total
wholesale_pricenumber, optional--Wholesale Price
retail_pricenumber, optional--Retail Price
descriptionstring, optional--Description
unitstring, optional--Unit
barcodestring, optional--Barcode
auto_barcodeboolean--Auto Barcode
gtinstring, optional--Gtin
rfid_epcstring, optional--Rfid Epc
hs_codestring, optional--Hs Code
tax_codesarray of string--Tax Codes
purchase_skustring, optional--Purchase Sku
purchase_namestring, optional--Purchase Name
purchase_unitstring, optional--Purchase Unit
purchase_conversion_factornumber, optional--Purchase Conversion Factor
allow_splittingboolean--Allow Splitting
attributesobject--Attributes
idempotency_keystring, optional--Idempotency Key
inventory_typestring--Inventory Type
landed_cost_kindstring, optional--Landed Cost Kind
recoverableboolean, optional--Recoverable

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/bulk/delete

Bulk Delete

Request body

FieldTypeRequiredDescription
entity_idsarray of stringyesEntity Ids

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/bulk/delete \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/bulk/expire

Bulk Expire

Request body

FieldTypeRequiredDescription
entity_idsarray of stringyesEntity Ids

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/bulk/expire \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/bulk/make-available

Bulk Make Available

Commit one or more drafts into stock. Same authority as authoring the draft (edit_inventory) - no extra permission.

Request body

FieldTypeRequiredDescription
entity_idsarray of stringyesEntity Ids

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/bulk/make-available \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/bulk/revert-to-draft

Bulk Revert To Draft

assert_status_change_allowed does the real gating (revert_items_to_draft + clean history).

Request body

FieldTypeRequiredDescription
entity_idsarray of stringyesEntity Ids
reasonstring, optional--Reason

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/bulk/revert-to-draft \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/bulk/shopify-sync

Bulk Shopify Sync

Opt the selected items into (or out of) outbound Shopify sync by emitting shop.sync.enabled/disabled, which sets is_sync_to_shopify on each item's projection.

Request body

FieldTypeRequiredDescription
entity_idsarray of stringyesEntity Ids
enableboolean--Enable

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/bulk/shopify-sync \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/bulk/status

Bulk Set Status

Request body

FieldTypeRequiredDescription
entity_idsarray of stringyesEntity Ids
statusstringyesStatus

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/bulk/status \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/bulk/transfer

Bulk Transfer

Request body

FieldTypeRequiredDescription
entity_idsarray of stringyesEntity Ids
to_location_idstringyesTo Location Id

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/bulk/transfer \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /items/categories

List Item Categories

Return distinct non-empty category values: union of category_schemas keys and item projections.

Responses

StatusDescriptionBody
200Successful Responsearray of string

Example

curl -X GET http://localhost:8000/items/categories \
  -H "Authorization: Bearer $TOKEN"

GET /items/export/csv

Export Items Csv

Parameters

NameInRequiredTypeDescription
qquery--string, optional--
categoryquery--string, optional--
statusquery--string, optional--

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/items/export/csv \
  -H "Authorization: Bearer $TOKEN"

GET /items/field-values

Get Field Values

Return sorted distinct non-empty values for a categorical item field. Allowed fields: - Fields in _SUGGESTION_FIELDS (core categorical fields) - Any attribute field (any field stored under item.attributes) - these are module-defined and can include gemstone fields, restaurant fields, etc. Blocked fields: FK references, free-text blobs, internal identifiers. Returns {"values": [...]} so the caller can safely extend without breakage.

Parameters

NameInRequiredTypeDescription
fieldqueryyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/items/field-values \
  -H "Authorization: Bearer $TOKEN"

POST /items/import/batch

Batch Import Items

Batch-import CIF item records. Idempotent on idempotency_key. Max 500 per call. The raw-event-batch transport: records arrive already shaped by the caller. The committer lives in services.commit_import_batch, shared with /import/rows and the agent /import/commit.

Request body

FieldTypeRequiredDescription
recordsarray of ImportRecordyesRecords
filenamestring, optional--Filename
upsertboolean--Upsert

Responses

StatusDescriptionBody
200Successful Responsecelerp_inventory__services__BatchImportResult
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/import/batch \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /items/import/batches

List Import Batches

List all import batches for this company, newest first.

Responses

StatusDescriptionBody
200Successful Responseobject

Example

curl -X GET http://localhost:8000/items/import/batches \
  -H "Authorization: Bearer $TOKEN"

POST /items/import/batches/{batch_id}/undo

Undo Import Batch

Undo an import batch only when none of its created items changed later.

Parameters

NameInRequiredTypeDescription
batch_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/import/batches/:batch_id/undo \
  -H "Authorization: Bearer $TOKEN"

POST /items/import/commit

Import Commit

Commit an item import previewed via /import/preview. Recomputes the preview from the stored bytes; a hash mismatch means the file or its mapping changed since the preview, refused with 409 rather than imported under stale assumptions. Any row validation error is refused with 422 and the error list; otherwise the rows go through the shared committer.

Request body

FieldTypeRequiredDescription
file_idstringyesFile Id
sheetstring, optional--Sheet
upsertboolean--Upsert
mappingobject, optional--Mapping
preview_hashstringyesPreview Hash

Responses

StatusDescriptionBody
200Successful Responsecelerp_inventory__services__BatchImportResult
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/import/commit \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /items/import/preview

Import Preview

Preview an uploaded item import for the browser UI.

Parameters

NameInRequiredTypeDescription
file_idqueryyesstring--
sheetquery--string, optional--
upsertquery--boolean--

Responses

StatusDescriptionBody
200Successful ResponseInventoryImportPreview
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/items/import/preview \
  -H "Authorization: Bearer $TOKEN"

POST /items/import/preview

Import Preview Agent

Preview an uploaded catalog with an optional caller-corrected mapping.

Request body

FieldTypeRequiredDescription
file_idstringyesFile Id
sheetstring, optional--Sheet
upsertboolean--Upsert
mappingobject, optional--Mapping

Responses

StatusDescriptionBody
200Successful ResponseInventoryImportPreview
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/import/preview \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/import/rows

Import Rows

Commit already-mapped import rows (the browser importer's transport). Rows arrive mapped and fixed by the UI. The shared committer owns location resolution and creation, unit and quantity derivation, monetary conversion, idempotency, and the category-schema follow-up. Unmarked: this is the browser transport, not an agent capability (the agent commits through /import/commit).

Request body

FieldTypeRequiredDescription
rowsarray of objectyesRows
upsertboolean--Upsert
filenamestring, optional--Filename
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responsecelerp_inventory__services__BatchImportResult
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/import/rows \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/merge

Merge Items

Request body

FieldTypeRequiredDescription
source_entity_idsarray of stringyesSource Entity Ids
target_sku_fromstringyesTarget Sku From
resulting_quantitynumber, optional--Resulting Quantity
resulting_cost_totalnumber, optional--Resulting Cost Total
resulting_namestring, optional--Resulting Name
resulting_skustring, optional--Resulting Sku
resolved_attributesobject, optional--Resolved Attributes
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/merge \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/metadata

Items Metadata

Bulk item-metadata read: one entry per requested id, keyed by entity_id. Returns the same visibility-filtered flat dict GET /items/{entity_id} returns per item, minus the sold_price enrichment (list/doc/audit renderers never read it). This is a read gated by the router-level authentication; company_id is derived server-side from the JWT, never from the body, and the query is scoped to that company so it cannot read another company's items. Field/cost visibility is applied per the item's OWN category, exactly as the per-item route does, so restricted fields never leak. Unknown ids are simply absent from the result (no error, no fabricated entry).

Request body

FieldTypeRequiredDescription
entity_idsarray of stringyesEntity Ids

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/metadata \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /items/valuation

Get Valuation

Aggregate inventory valuation from projections. Optional ?category= and ?status= filters scope totals + count_by_status to that slice. on_memo_to: customer contact_id. Scope counts to items currently out on memo to that customer. consigned_from: supplier contact_id. Scope counts to items currently held on consignment. category_counts is always global (all active items) - used by the category tab bar. count_by_status is scoped to the current category/status/holdings filter - used by status cards.

Parameters

NameInRequiredTypeDescription
categoryquery--string, optional--
statusquery--string, optional--
on_memo_toquery--string, optional--
consigned_fromquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/items/valuation \
  -H "Authorization: Bearer $TOKEN"

GET /items/{entity_id}

Get Item

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/items/:entity_id \
  -H "Authorization: Bearer $TOKEN"

PATCH /items/{entity_id}

Patch Item

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
fields_changedobject--Fields Changed
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PATCH http://localhost:8000/items/:entity_id \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/{entity_id}/adjust

Adjust Item

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
new_qtynumberyesNew Qty
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/:entity_id/adjust \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/{entity_id}/expire

Expire Item

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/:entity_id/expire \
  -H "Authorization: Bearer $TOKEN"

POST /items/{entity_id}/price

Set Item Price

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
price_typestringyesPrice Type
new_pricenumberyesNew Price
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/:entity_id/price \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /items/{entity_id}/reorder-suggestion

Get Reorder Suggestion

Suggested reorder_point / reorder_qty from trailing outbound velocity. Read-only assist for the item detail / bulk dialog - the stored fields stay the single source of truth. Returns nulls when there is no outbound history (never a fabricated number). See celerp.services.reorder.suggest_reorder.

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/items/:entity_id/reorder-suggestion \
  -H "Authorization: Bearer $TOKEN"

POST /items/{entity_id}/reserve

Reserve Item

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
quantitynumberyesQuantity
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/:entity_id/reserve \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/{entity_id}/split

Split Item

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
childrenarray of SplitChildyesChildren
mother_qtynumber, optional--Mother Qty
mother_weightnumber, optional--Mother Weight
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/:entity_id/split \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /items/{entity_id}/split-preview

Split Preview

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--
child_skuquery--string, optional--

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/items/:entity_id/split-preview \
  -H "Authorization: Bearer $TOKEN"

POST /items/{entity_id}/status

Set Item Status

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
new_statusstringyesNew Status
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/:entity_id/status \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/{entity_id}/transfer

Transfer Item

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
to_location_idstringyesTo Location Id
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/:entity_id/transfer \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/{entity_id}/transform

Transform Item

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
child_skustringyesChild Sku
child_categorystringyesChild Category
child_sell_bystringyesChild Sell By
child_quantitynumberyesChild Quantity
child_namestring, optional--Child Name
child_weightnumber, optional--Child Weight
child_weight_unitstring, optional--Child Weight Unit
child_piecesinteger, optional--Child Pieces
child_cost_totalnumber, optional--Child Cost Total
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/:entity_id/transform \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

POST /items/{entity_id}/unreserve

Unreserve Item

Parameters

NameInRequiredTypeDescription
entity_idpathyesstring--

Request body

FieldTypeRequiredDescription
quantitynumberyesQuantity
idempotency_keystring, optional--Idempotency Key

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/items/:entity_id/unreserve \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'