Skip to main content

Sales Invoices

Create, read, update and delete customer sales invoices (facturas emitidas)

📄️ Prototype sales invoice for a creation form

Returns a NON-PERSISTED sales invoice pre-populated with the backend defaults the legacy form applies on 'new invoice': currencies and daily exchange rate of the branch's company, default accounting ledger, automatic document/accounting dates per company configuration, loyalty point value, Verifactu draft state (lifecycle BOR + series BORRADOR) when the company has Verifactu active, a PROVISIONAL series/number pair (re-derived at persist time) and the authenticated user's employee as agent or optometrist. The response carries no `id`, `version` or audit fields. The optional JSON body supplies initialisation hints: `warehouseId` (defaults to the user's current branch) and `counterpartyId`. Caller must follow up with `POST /api/v2/sales-invoices` to actually persist the invoice.

📄️ Get sales invoice editability matrix

Returns the server-resolved editability matrix for the invoice: which field groups (header, counterparty, amounts, unit prices, manual discounts, products, quantities, accounting, payments, insurer amounts, cost centers) and actions (edit, delete) are allowed for the current document state and the authenticated user's permissions, with a stable `code` and human-readable `reason` for every denied entry. Mirrors the legacy JSF lock/permission rules (TipoBloqueo, Verifactu lifecycle, OLA mode, Venezuelan fiscal printer, credit-note types). Purely informative: the server re-validates every write regardless.