Prototype sales invoice for a creation form
POST/api/v2/sales-invoices/new
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.
Request
Responses
- 200
- 400
- 401
- 403
- 500
Sales invoice prototype with defaults
Hint references an unknown entity (warehouse, counterparty) or the user has no default branch
Missing or invalid JWT (Bearer token).
Authenticated user is missing the CREAR_FACTURASEMITIDAS permission or the requested warehouse is outside the user's scope
Unexpected server error. Includes legacy WAR failures that are not classified as 502 / 503 / 504.