Invoice Ninja webhooks
Invoice Ninja webhooks are JSON requests that Invoice Ninja sends to a URL you choose when a client, invoice, quote, credit, payment or other record changes.
How Invoice Ninja webhooks work
Webhooks push billing changes to your server, so you don't have to poll the Invoice Ninja API. Each subscription ties one event, such as create_invoice, to one target URL. When the event happens, Invoice Ninja queues a job that sends the record as JSON, using the subscription's method, POST or PUT, and any headers you added.
The event names on these pages are what you subscribe to, and they never arrive in the delivery. The body is the record itself, with no wrapper, event field or delivery ID, plus related records such as client on an invoice. To tell deliveries apart, give each subscription its own path or ?event= value. There's no payload version: the User-Agent names the server version instead. Invoice Ninja's API reference covers only the subscription fields, so these details come from its open-source v5 server.
Key facts
None on the wire: give each subscription its own URL Setting up Invoice Ninja webhooks
- Open Settings > Account Management > API Webhooks, or call
POST /api/v1/webhooksas an admin withtarget_url,event_id,rest_methodand your secret inheaders. On the hosted service, webhooks only fire for paid accounts. - To test locally, run the Hookdeck CLI:
hookdeck listen 3000 invoice-ninja --path /webhooks/invoice-ninja, then use its URL as the target. Invoice Ninja rejects target URLs on private addresses, solocalhostwon't work. - Resend one record with
POST /api/v1/webhooks/{id}/retry, passingentityandentity_id. The call is in the v5 server's routes but not in the API reference, and it sends the record as it is now. - To receive through Event Gateway, create a source with the Invoice Ninja type, enter your header's name and exact value, and use the source URL as the target. If a subscription uses
PUT, allowPUTon the source before you save the subscription.
Delivery behaviour
30 seconds The v5 server allows 10 seconds to connect and 30 seconds for the whole request. Retries Up to 5 tries Only connection errors, timeouts and 429 are retried, about 10 to 15 seconds, 30 to 40 seconds, 1 minute and 3 minutes apart. After a failure Logged, not resent A 5xx or other 4xx ends the delivery at once, and a 404, 405 or 410 also archives the subscription. Duplicates No delivery ID A request that times out after your handler finished is sent again, with nothing to mark it as a repeat. Known failure modes
From Hookdeck's Invoice Ninja guide →-
A subscription stops firing
Invoice Ninja archives a subscription when your endpoint answers
Keep subscriptions active →404,405or410, and archived subscriptions send nothing. Fix the route, then restore the subscription from the archived webhooks. -
A 500 loses the event
Invoice Ninja doesn't retry a
Plan for dropped events →5xx, or any4xxexcept429. Acknowledge before you do work that can fail, and reconcile against the API after an incident. -
You can't tell which event fired
Neither the body nor the headers name the event, because it belongs to the subscription. Give each subscription its own path or
Route by URL →?event=value. -
A payment arrives after a later change
Invoice Ninja queues payment events for 20 to 25 seconds and most others not at all, so arrival order can differ from event order. Compare
Handle events out of order →updated_atbefore you apply a body.
Invoice Ninja webhook best practices
- Check the secret header on every request.
It's the only credential Invoice Ninja sends, so compare the whole value in constant time and reject anything else with a
401. - Never answer 404, 405 or 410. Any of them archives the subscription and stops its deliveries. Accept the subscription's method on the route, and check proxies too.
- Acknowledge before you do the work.
A
500is never retried, so store the record and return a200first, then process it in a background job. - Give each subscription its own URL.
The event isn't in the request, so a path or
?event=value is the reliable way to know which one fired. - Upsert on the record's id.
There's no delivery ID. Compare
updated_atwith what you've stored, so repeats and older bodies change nothing. - Re-read records that move money.
A static header doesn't protect the body, so fetch a payment from the API by
idbefore you act on it.
Common Invoice Ninja webhook events
Invoices
create_invoice | New invoice is created |
sent_invoice | Invoice is emailed or marked as sent |
late_invoice | Daily check finds an unpaid invoice past its due date |
Payments
create_payment | Payment is recorded |
update_payment | Payment record is saved with changes |
delete_payment | Payment is marked as deleted |
Clients and quotes
create_client | New client is added |
update_client | Client record is saved with changes |
approve_quote | Client approves a quote |
Events by resource
| Resource | Events | Payloads |
|---|---|---|
quote | 9 | 0 |
invoice | 8 | 0 |
purchase_order | 7 | 0 |
credit | 6 | 0 |
client | 5 | 0 |
expense | 5 | 0 |
payment | 5 | 0 |
product | 5 | 0 |
project | 5 | 0 |
task | 5 | 0 |
1 more resource. All 65 events →
In this hub
| Webhook events → | Every covered Invoice Ninja event, with payloads where the registry has them. |
| MCP events → | How an agent subscribes to Invoice Ninja events as MCP events. |
| Verify signatures → | Signature facts, verification code and common failures. |
| Production guide → | Production problems, such as timeouts and retries, and how to handle them. |
| Agent skill → | Install the webhook skill in your coding agent. npx skills add hookdeck/webhook-skills --skill invoice-ninja-webhooks |
Keep a failing deploy from losing Invoice Ninja events.
Event Gateway checks your secret header, accepts each Invoice Ninja delivery as it arrives and queues it, so a 500 from your service becomes a retry instead of a dropped event.