Fenicia calculates your inventory's cost using cost layers (lots) under the FIFO methodology (first in, first out). Every time stock comes in — through a purchase order receipt, a received transfer, or a return — a lot is internally created with its unit cost and quantity. When stock is consumed (for example, an order's sale), Fenicia depletes the oldest lots first.
Read-only surface
There is no public endpoint to create or cancel a lot manually. Lots are generated internally from purchase order receipts, transfers, and returns — not from this API. All endpoints on this page require the inventory:read permission.
Most /inventory/* listings (stock, transfers, adjustments, counts) paginate 1-indexed (page=1 by default). GET /inventory/lots is the exception within the inventory domain itself: it paginates 0-indexed (page=0 by default), just like /locations/*. Its response shape is also flat — { data, total, page, limit, totalPages, hasMore } — different from the { items, pagination: {...} } used by stock, transfers, adjustments, and counts. If you share a pagination helper across inventory resources, this silently breaks the page count.
This aggregation only considers lots with status: 'active'. It is the correct valuation source for this domain — unlike the GET /inventory/reports?reportType=valuation report, which is currently broken (see Inventory Reports).
This COGS is calculated from the InventoryLotMovement records with referenceType: 'order' and type: 'sale' associated with the order — not from a separate summary table.
Lot consumption strictly follows ascending receivedAt order (the oldest lot is depleted first) within {tenantId, sku, locationId}, and only considers lots with status: 'active'. If the requested quantity exceeds the sum of currentQuantity across the available active lots, the consumption is rejected — this is the real guard against overselling in the costing subsystem, independent of the base stock field's negative-stock guard (see Error Catalog).
Not exposed as an endpoint
FIFO consumption is triggered internally (an order's sale, a transfer's receipt) — there is no public POST to invoke it directly. Do not document it as an operation you can execute yourself via the API.