Status: specification for Public API v1. Not live yet.
A webhook is an HTTPS request Fininvo sends to your server when something happens, so you do not have to poll.
Registering an endpoint
- Settings → Developers → Webhooks → Add endpoint.
- Enter the URL. It must be
https://on port 443 and reachable from the public internet. Private, loopback and internal addresses are refused. - Select the events you want. Subscribe only to what you use.
- Copy the signing secret (
whsec_...). It is shown once. - Choose Send test. The endpoint becomes active only after your server answers the test
with a
2xxstatus.
The number of endpoints depends on your plan (1 on Growth, 5 on Business, 20 on Enterprise as standard). See Settings → Subscription for your limit.
Event types
ERP
| Type | Sent when |
|---|---|
erp.invoice.created | An invoice is created |
erp.invoice.updated | An invoice changes |
erp.invoice.paid | An invoice is fully paid |
erp.invoice.cancelled | An invoice is cancelled |
erp.payment.received | A customer payment is recorded |
erp.customer.created, erp.customer.updated | A customer is created or changed |
erp.item.created, erp.item.updated | An item is created or changed |
HRMS
| Type | Sent when |
|---|---|
hr.employee.created | An employee is added |
hr.employee.updated | Directory fields of an employee change |
hr.employee.terminated | An employee is marked as exited |
hr.leave.requested, hr.leave.approved, hr.leave.rejected | A leave request changes state |
Payroll
| Type | Sent when |
|---|---|
payroll.run.finalized | A payroll run is finalized |
payroll.payslip.published | A payslip is published to an employee |
New event types are added over time. Ignore types you do not recognise.
Payload
{
"id": "evt_01JD8Z3K9Q...",
"type": "erp.invoice.paid",
"apiVersion": "v1",
"createdAt": "2026-11-26T10:15:42Z",
"data": {
"object": {
"id": "6f1c...",
"number": "INV-2026-00412",
"status": "PAID",
"customerId": "9a77...",
"currency": "INR",
"total": "13000.00",
"amountDue": "0.00",
"updatedAt": "2026-11-26T10:15:41Z"
}
}
}data.object has the same shape as the matching API resource.
Two deliberate limits:
- Sensitive employee fields are never sent in webhooks, whatever scopes your keys have.
- Payroll events are thin: they carry ids and status only. Fetch the details with the API,
where your key scopes apply.
payroll.run.finalized:{ "id", "status" }(statusisFROZENfor a newly finalized run)payroll.payslip.published:{ "id", "runId", "employeeId", "status": "PUBLISHED" }. Publishing payslips again for the same run does not send the event a second time.
An endpoint can be limited to one company when you create it. Events of that company and account-wide events (items, HRMS, payroll) are sent to it; events of other companies are not.
Test event
Send test posts a signed event of type ping, with
data.object = { "endpointId", "message" } and a Fininvo-Delivery-Id that starts with test_.
It is not stored and is not listed by GET /events. Verify its signature like any other event.
Headers
| Header | Value |
|---|---|
Fininvo-Signature | t=<unix seconds>,v1=<hex signature> |
Fininvo-Event-Id | Same as id in the body. Use it to deduplicate. |
Fininvo-Event-Type | Same as type in the body |
Fininvo-Delivery-Id | Unique per delivery |
Fininvo-Delivery-Attempt | 1 for the first try, then 2, 3 and so on |
Fininvo-Replay | true when the delivery was replayed by a person |
User-Agent | Fininvo-Webhooks/1.0 |
Verifying the signature
Always verify before you trust a payload. Anyone can send a request to your URL; only Fininvo can produce a valid signature.
The signature is HMAC-SHA256(secret, t + "." + rawBody) in lowercase hex.
- Read the raw request body, before any JSON parsing or reformatting.
- Split the header on commas. Take
tand everyv1value (there are two during a secret rotation). - Compute the expected signature.
- Compare with a constant-time function against each
v1. - Reject if
tis more than 5 minutes from your clock. This stops replayed requests.
Node.js
const crypto = require('crypto');
function verifyFininvoSignature(rawBody, header, secret, toleranceSeconds = 300) {
let timestamp = null;
const signatures = [];
for (const part of String(header || '').split(',')) {
const [key, value] = part.trim().split('=');
if (key === 't') timestamp = value;
if (key === 'v1') signatures.push(value);
}
if (!timestamp || signatures.length === 0) return false;
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > toleranceSeconds) return false;
const expected = crypto
.createHmac('sha256', secret)
.update(`${timestamp}.${rawBody}`)
.digest('hex');
const expectedBuf = Buffer.from(expected, 'hex');
return signatures.some((sig) => {
const sigBuf = Buffer.from(sig, 'hex');
return sigBuf.length === expectedBuf.length && crypto.timingSafeEqual(sigBuf, expectedBuf);
});
}
// Express: keep the raw body
app.post('/webhooks/fininvo', express.raw({ type: 'application/json' }), (req, res) => {
const ok = verifyFininvoSignature(
req.body.toString('utf8'),
req.get('Fininvo-Signature'),
process.env.FININVO_WEBHOOK_SECRET,
);
if (!ok) return res.status(400).send('invalid signature');
const event = JSON.parse(req.body.toString('utf8'));
queue.add(event); // do the work later
res.status(200).send('ok'); // answer fast
});Python
import hashlib, hmac, time
def verify_fininvo_signature(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
timestamp, signatures = None, []
for part in (header or "").split(","):
key, _, value = part.strip().partition("=")
if key == "t":
timestamp = value
elif key == "v1":
signatures.append(value)
if not timestamp or not signatures:
return False
if abs(time.time() - int(timestamp)) > tolerance:
return False
expected = hmac.new(
secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256
).hexdigest()
return any(hmac.compare_digest(expected, s) for s in signatures)Responding
- Return any
2xxwithin 10 seconds. Do the real work after you respond, from a queue. - Anything else, a timeout or a redirect counts as a failure. Redirects are never followed.
- The response body is ignored. Only the first 1 KB is kept in the delivery log.
Delivery flow
sequenceDiagram
participant FV as Fininvo
participant EP as Your endpoint
FV->>EP: POST signed event
alt 2xx within 10 seconds
EP-->>FV: 200
else error, timeout or redirect
EP-->>FV: failure
Note over FV: Retry on the schedule below
endEndpoint setup, verification and state diagrams: Integration flows.
Retries
A failed delivery is retried up to 8 times in total:
| Attempt | Delay after the previous failure |
|---|---|
| 2 | 1 minute |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |
| 6 | 6 hours |
| 7 | 12 hours |
| 8 | 24 hours |
After the last attempt the delivery is marked exhausted. You can replay it from the delivery log.
If an endpoint fails continuously for 3 days it is disabled automatically and the account owners are emailed. Fix the endpoint, then choose Resume.
Build for these guarantees
- At least once. The same event can arrive more than once. Deduplicate on
Fininvo-Event-Id. - No ordering. A retry can arrive after a newer event. Compare
updatedAton the object, or fetch the current state from the API. - Rarely, an event can be missed. Run a periodic reconciliation with
GET /events?since=...or withupdatedSinceon the list endpoints. Events are kept for 30 days.GET /eventsneeds theevents:readscope, returns the same envelope as a webhook body, oldest first, and lists only the event types of your key's product whose read scope the key holds (for exampleerp.invoices:readforerp.invoice.*). Filters:type,since,page,limit(at most 100). - Events are recorded from the moment API or webhook access is switched on for your account.
Rotating the signing secret
Choose Rotate secret on the endpoint. For 24 hours every delivery carries two v1
signatures, one per secret, so you can deploy the new secret without dropping events. The
verification code above already accepts either.
Delivery log
Each endpoint shows its deliveries for the last 30 days with status, response code, duration and attempt count. From there you can replay a delivery or send a test event.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Endpoint stays in "pending verification" | Test ping did not get a 2xx. Check your server logs and firewall. |
| URL refused when saving | Not https, a non-standard port, or it resolves to a private address |
| Signature never matches | You are hashing parsed JSON instead of the raw body, or using the wrong secret |
| Signature fails only sometimes | Server clock drift. Sync with NTP. |
| Duplicates | Expected. Deduplicate on the event id. |
