Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

My invoice numbers have gaps or the same number twice

Short answer

Invoice numbers are assigned by a system, and gaps or repeats come from deleted drafts, failed saves, two requests at once, or a change of numbering scheme. Stripe states that a full invoice number is always unique in your account and that changing the scheme only affects future invoices. Do not renumber old invoices.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • My accountant found two invoices with the same number.
  • There are numbers missing from the sequence.
  • The numbering restarted or jumped after a migration or update.
  • Different customers have separate sequences and I expected one.
  • Invoices created at the same moment got the same number.

Why does this happen?

  1. Draft invoices and failed saves use up numbers

    If a number is reserved and the invoice is then deleted or the save fails, the number is gone and leaves a gap. Systems that count rows instead of reserving a number can also repeat one.

  2. Two requests at the same time

    If two invoices are created within the same second and the system picks "last number plus one" for both, both get the same number. A correct system reserves a number inside one locked step.

  3. The scheme is per customer, not per account

    Stripe supports sequential numbering for each customer or across your account, and says the EU member countries and the United Kingdom typically require account-level sequencing. Per-customer numbering looks like many repeated sequences.

  4. A scheme or prefix change

    Stripe says that when you switch schemes or change prefixes only future invoices use the new settings and existing invoices are not changed. Mixed formats in a list are therefore normal after a change.

  5. A migration did not carry the counter over

    Stripe lets you set the next invoice number, for example to continue where an old system stopped, and only to a number greater than any already used. If this is not done, numbers restart.

What can I do about it today?

  1. Export the invoice listInclude number, date, customer, amount and status, including drafts and voided ones.
  2. Mark gaps and duplicatesHighlight them and note the dates, because dates point to the cause.
  3. Check voided, deleted and draft itemsMany gaps are drafts that were deleted before sending.
  4. Do not renumber sent invoicesCustomers and your accountant already hold those numbers. Fixes are made forward.
  5. Ask your accountant what they requireRules differ by country and I cannot give accounting or tax advice.
  6. Pause manual number editsTyping numbers by hand while the system also assigns them creates duplicates.

When should I bring someone in?

  • Duplicates keep appearing.
  • Invoices are produced by your own code or a plugin and not a ready invoicing service.
  • You are moving from one system to another and numbers must continue.

How do I handle it?

  1. Find the patternI compare gaps and duplicates with timestamps, users and actions to see what produces them.
  2. Make numbering a single locked stepNumbers are reserved inside one transaction so two requests cannot get the same one.
  3. Record every cancelled numberInstead of reusing numbers, a voided number stays visible with its status.
  4. Carry the counter across migrationsI set the next number deliberately and test it with sample invoices.
  5. Add a monthly checkA small report flags gaps and duplicates so they are found early.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Can I fill a gap with a new invoice?

Ask your accountant first. Rules on sequences differ by country, and reusing numbers can cause trouble of its own.

Do prefixes have limits?

Stripe says prefixes must be between 1 and 12 uppercase letters or numbers and cannot match another prefix, including ones no longer in use.

Can the next number go backwards?

Stripe says you can only set the next invoice number to a number greater than any number already used.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.