Reports

Get Inventory Costs

Inventário com custos: the vehicles in stock at the end of the period, each with EVERY cost movement (purchase + expenses, one row per movement with its own invoice reference) and a server-computed subtotal — the JSON twin of the monthly email's "Custos" sheet (inventory_report.flatten_inventory_costs is the shared core).

Single as-of period: the cutoff is end of max(mes) of ano. Do NOT fan this out per year and merge client-side — movements carry only an UPPER date bound, so responses for different years overlap and a merge double-counts every euro. Totals come computed from here; the FE renders them and must not re-sum floats in JS. NOT cached — same reasoning as /detail (see the top of this file), and this response is strictly larger.

get/api/reports/inventory/costs

Query parameters

mesinteger[]

Month(s); uses max month as end-of-period cutoff

Month(s); uses max month as end-of-period cutoff

anointeger required
consignadointeger required
ponto_venda_idinteger[]

Headers

x-api-tokenstring nullable

Response

Successful Response

{"stackTrail":"paths:/api/reports/inventory/costs:get:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}

Changes