Skip to main content

Invoice States

The Contazen API manages invoices through several distinct states, each serving a specific purpose in the invoice lifecycle.

State Overview

*Voided invoices can only be deleted if they are the last in their series

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

  1. Never delete active invoices - Always void first to maintain audit trail
  2. Preserve sequential numbering - Only delete the last voided invoice in a series
  3. Keep voided invoices - Consider not deleting voided invoices for complete audit history

For Integration

  1. Check status field - Primary indicator of invoice state
  2. Handle voided invoices - They appear in lists but with voided status
  3. Expect 404 for deleted - Deleted invoices are gone permanently
  4. 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.