Duplicate invoice numbers
How Alya Books keeps invoice numbers unique, what happens when a number is already used, and how to avoid gaps.
Every invoice number must be unique within your organization. Alya Books allocates numbers from a series when you save, so duplicates only arise when a number is imported or typed by hand (possible only when Allow manual document numbers is on).
How numbers are allocated
- The editor pre-fills the number from the series for the document kind (invoice, credit note, debit note) using the template in Settings → Outgoing invoices → Document Numbering (tokens
{YYYY},{YY},{MM},{DD},{n}). - The number is fixed when you save. If the next number in the series already exists, the series skips ahead automatically.
- By default the number field is read-only, so every invoice takes the next number in order. If Allow manual document numbers is switched on (Settings → Outgoing invoices → Numbers, terms and editing) and you type a number yourself, the counter moves to that number so later invoices continue after it.
When a number is already used
- Saving an invoice with a number that exists fails with a "Failed to create invoice" error naming the duplicate. Change the number or clear it so the series assigns the next one (only possible with manual numbers on; otherwise the next free number is taken automatically).
- CSV imports skip rows whose number already exists and list them in the import result.
- Through the API, a reused
invoiceNumberreturns a validation error;GET /invoices/verify-numberchecks a number before you use it. - Incoming invoices with the same supplier TRN and number as an existing one are rejected as duplicates.
Good to know:
- A rejected invoice keeps its number. After you fix and resubmit it, the new attempt uses the same number; the previous attempt stays visible on the E-invoicing Submissions card.
- Duplicate in the invoice menu copies the content into a new draft with a new number; it never reuses the original number.
- Credit notes, debit notes and proformas have their own series and prefixes, so
CN-0001andINV-0001do not conflict. - Do not renumber issued invoices. They are locked, and the FTA has already received the number.
- If you need a gap-free sequence, keep Allow manual document numbers off and avoid deleting drafts that already received a number (or switch off Reserve invoice numbers for drafts).
Related: