Invoice States
The Contazen API manages invoices through several distinct states, each serving a specific purpose in the invoice lifecycle.State Overview
Status | Description | Can Edit | Can Void | Can Delete | API Visible |
---|---|---|---|---|---|
draft | Invoice not finalized | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes |
issued | Active unpaid invoice | ❌ No | ✅ Yes | ❌ No | ✅ Yes |
paid | Fully paid invoice | ❌ No | ✅ Yes | ❌ No | ✅ Yes |
overdue | Past due date | ❌ No | ✅ Yes | ❌ No | ✅ Yes |
voided | Cancelled invoice | ❌ No | ❌ No | ✅ Conditional* | ✅ Yes |
(deleted) | Removed from DB | N/A | N/A | N/A | ❌ No (404) |
State Transitions
Key Concepts
Draft Invoices
- Created but not finalized
- Can be edited freely
- No invoice number assigned
- Can be deleted without voiding
Active Invoices
- Have been issued with an invoice number
- Cannot be edited (immutable for compliance)
- Can transition to paid, overdue, or voided states
- Must be voided before deletion
Voided Invoices
- Marked as cancelled but retained for audit trail
- Remain visible in API with
status: "voided"
- Cannot be edited or reactivated
- Can only be deleted if last in series (sequential numbering requirement)
Deleted Invoices
- Completely removed from database
- Return 404 errors on all API calls
- Cannot be recovered
- Only drafts and voided invoices can be deleted
API Response Fields
When retrieving invoices, these fields indicate the current state:Best Practices
For Compliance
- Never delete active invoices - Always void first to maintain audit trail
- Preserve sequential numbering - Only delete the last voided invoice in a series
- Keep voided invoices - Consider not deleting voided invoices for complete audit history
For Integration
- Check status field - Primary indicator of invoice state
- Handle voided invoices - They appear in lists but with voided status
- Expect 404 for deleted - Deleted invoices are gone permanently
- Use appropriate filters - Filter by status to get specific invoice states
Common Workflows
Cancel an Invoice
List Active Invoices Only
List All Including Voided
Romanian Fiscal Requirements
The API enforces Romanian fiscal regulations:- Sequential Numbering: Invoice numbers must be sequential without gaps
- Immutable Records: Issued invoices cannot be modified
- Audit Trail: Voided invoices are retained for compliance
- E-Factura Integration: Submitted invoices have additional restrictions
The distinction between voided and deleted is crucial for compliance. Voided invoices maintain the audit trail while deleted invoices are permanently removed.