An engineering guide to building around Israel's invoice allocation-number requirement: where it sits in your issuance flow, the failure modes it introduces, and how to design so a tax authority outage does not stop you invoicing. Not tax advice - confirm the current rules with your accountant.
Key takeaways
- This article covers architecture only. Whether the requirement applies to you, from what threshold and by when, is a question for your accountant and the Tax Authority - the rules have been rolling out in phases and changing.
- The structural change is that issuing an invoice now involves a synchronous call to an external authority. Your issuance flow gains a network dependency it never had.
- Design for the authority being unavailable. A queue with retries and a visible pending state beats a checkout that fails because a government endpoint timed out.
- If you use a cloud invoicing provider, they handle this and you should let them. Building the integration yourself only makes sense if you are issuing documents from your own system.
Scope note before anything else. This is a guide to system design, not to tax compliance. Israel's invoice allocation-number requirement has been introduced in phases with thresholds that have changed over time, and whether it applies to your business, at what threshold, and from when is a question for your accountant and for the Tax Authority's current published guidance. Do not take compliance conclusions from this page - including any figure you might find elsewhere on the internet, which may well be out of date.
What I can usefully cover is the part developers have to solve: what changes architecturally when issuing an invoice requires a call to an external authority, and how to build so that dependency does not become your weakest link.
The Structural Change
Before, issuing an invoice was a local operation. Your system, or your invoicing provider, generated a document with a number from your own sequence and that was that. The only parties involved were you and the customer.
Under an allocation-number regime, issuing certain invoices involves obtaining an identifier from the tax authority's system as part of the process. That is a synchronous dependency on an external service you do not control, inserted into a flow that previously could not fail for network reasons.
Everything difficult about this follows from that one sentence.
Where It Sits in the Flow
The naive implementation puts the authority call inline: customer checks out, your code requests an allocation number, waits, then produces the document. This works in testing and fails in production, because now a slow or unavailable government endpoint is a failed checkout.
The better shape separates the commercial event from the document issuance:
- Record the sale. The order is captured and confirmed to the customer immediately. This step has no external dependency and must never fail because of one.
- Queue the issuance. A job is created referencing the order, with the order reference as its idempotency key.
- A worker obtains what it needs and issues. With retries and backoff, and with the result recorded against the order.
- Surface the state. Pending, issued, or failed - visible to whoever needs to know, not buried in a log.
This is the same architecture that any external-dependency integration needs, and it is worth building properly here because the consequences of getting it wrong are financial rather than cosmetic.
Failure Modes to Design For
| Failure | Wrong response | Right response |
|---|---|---|
| Authority endpoint timing out | Fail the sale | Queue, retry, mark pending |
| Request succeeded but response lost | Retry blindly | Idempotency key, check before re-requesting |
| Rejected for invalid data | Silent log entry | Error queue with the reason, visible to a person |
| Credentials or certificate expired | Discover during a busy period | Monitor expiry, alert well in advance |
| Sustained outage | Manual chaos | Defined fallback procedure agreed with the accountant in advance |
The lost-response case deserves particular attention. If your request reached the authority and was processed but the reply did not reach you, a blind retry risks a duplicate. Every request must carry an idempotency key derived from your own order reference, and your code must check its own records before issuing a second request.
Certificates and Credentials
Integrations with government systems typically involve credentials or certificates that expire on a fixed schedule. This is a boring operational detail that causes disproportionate damage, because expiry tends to be discovered at the worst moment.
Track expiry dates as monitored data, not as a calendar reminder in someone's inbox. Alert at a generous margin - weeks, not days. Keep the credentials in a secrets store, not in configuration files, and document who is able to renew them, because that person being on holiday is a real scenario.
Should You Build This Yourself?
For most businesses, no. If you issue documents through a cloud invoicing provider, they handle the authority integration as part of their product and keep it current as the rules change. That is precisely what you are paying them for, and reimplementing it yourself takes on maintenance of something that will change again.
Building it yourself is reasonable when you issue documents directly from your own system - a marketplace, a high-volume platform, a product where invoicing is core rather than incidental - and the provider's model does not fit. In that case, treat it as a real integration project with monitoring and an error queue, not as a function call added to existing code.
The middle path, which suits a lot of custom systems, is to keep issuing through a provider's API and let them handle the authority. Your system holds the commercial logic, their system holds the compliance surface.
What to Ask Your Accountant
Before any of the engineering, get written answers to these. They determine the whole design:
- Does the requirement apply to our business, and from what date and threshold?
- Which document types are affected, and which are not?
- What is our procedure if the authority is unavailable when we need to issue?
- Who is responsible for renewing the credentials, and what is the process?
- What records must we retain, and for how long?
These are compliance questions with real answers, and the answers shape the architecture. Getting them before building is far cheaper than retrofitting.
The Short Version
Treat the authority as an unreliable external dependency, because architecturally that is exactly what it is. Never let it block a sale. Make every request idempotent. Monitor credential expiry. And unless invoicing is core to your product, let a provider carry the compliance surface for you.
To design an issuance flow that holds up, book a free call. Related: automating invoices with the Morning API, how to automate invoicing, and the Israeli software stack.
Frequently asked questions
Does the invoice allocation-number requirement apply to my business?
That is a compliance question, not a technical one, and this article deliberately does not answer it. The requirement has been introduced in phases with thresholds that have changed over time, so any specific figure you read online - including in older articles - may be out of date. Confirm applicability, threshold and timing with your accountant and against the Tax Authority's current published guidance before designing anything around it.
What happens if the Tax Authority system is down when I need to issue an invoice?
Technically, your system should queue the issuance and retry rather than failing the sale - the commercial event and the document issuance should be separate steps, with the order confirmed to the customer immediately and the document produced by a worker with retries. What the correct business procedure is during a sustained outage is a compliance question you should agree with your accountant in advance, so there is a defined fallback rather than improvisation on the day.
Do I need to build this integration myself?
For most businesses, no. Cloud invoicing providers handle the authority integration as part of their product and keep it current as rules change, which is a large part of what you pay them for. Building it yourself makes sense mainly when you issue documents directly from your own system and the provider model does not fit - a marketplace or high-volume platform where invoicing is core rather than incidental. A common middle path is to keep issuing through a provider's API so your system holds the commercial logic and theirs holds the compliance surface.
Why does idempotency matter so much here?
Because the dangerous failure is not the request that clearly fails - it is the one that succeeds while the response is lost in transit. A blind retry in that situation risks producing a duplicate document, and a duplicate tax document has to be reversed through a proper process rather than deleted. Every request should carry an idempotency key derived from your own order reference, and your code should check its own records for an existing result before issuing a second request.
What is the most commonly overlooked part of this integration?
Credential and certificate expiry. It is an unglamorous operational detail that causes disproportionate damage, because expiry is almost always discovered at the worst possible moment rather than in advance. Track expiry dates as monitored data with alerting weeks ahead, keep the credentials in a secrets store rather than in configuration files, and document explicitly who is able to renew them - because that person being unavailable is a realistic scenario, not a hypothetical one.
Keep reading
Related service
Business Automation
I build custom automations that remove repetitive work end to end.
About the author
Yehonatan Saadia
Freelance automation, web & MVP engineer
I'm Yehonatan Saadia, a senior engineer who builds business automation, custom websites, and MVPs for small and mid-sized companies across the US, Europe, and Israel. These guides come from real client work, not theory.
Work with meHave a project like this?
Tell me what you're trying to automate or build and I'll tell you the fastest reliable way to ship it.
