Skip to content

API reference

Register a webhook

Other routes API

POST/v1/webhooks

Registers a URL that hears the steps of this company’s invoices: each event added to an invoice’s history (GET /v1/invoices/{id}/events) is posted to it as JSON. Send events to hear only some codes; leave it out to hear every step.

The body is {"type": "<event code>", "invoiceId": "<id>", "event": {<the event, as the history route returns it>}}. Use event.id to recognise a step you already have: a step may arrive more than once, and steps may arrive out of order.

Each post is signed as Standard Webhooks specifies (standardwebhooks.com), so its reference library checks it in any language. It carries webhook-id (the same on every attempt of one delivery), webhook-timestamp (unix seconds) and webhook-signature: v1,<base64>, the HMAC-SHA256 of <webhook-id>.<webhook-timestamp>.<body> keyed with the bytes of the secret after whsec_, read as base64. Check it, and refuse a timestamp that is old.

A 2xx answer is delivered. Any other answer, or none within 10 seconds, is tried again 1, 4, 16, 64 and 256 minutes later; after the sixth failed attempt the step is not posted again. The step stays in the history.

The secret is in this response and nowhere else. A caller that loses it stops the webhook and registers it again.

The URL is https to a public host. A local or private address is refused, and so is a name that resolves to one when a step is posted. A company has at most 10 live webhooks.

Request body

application/json, required

  • urlstring (uri)Required

    An https URL on a public host, for example https://erp.example.com/certinvo.

  • eventsarray of string

    The history codes to hear, for example ["kosit:clean", "kosit:rejected"]. Leave it out for every step.

Response

A 201 answer carries these fields.

  • idstring (uuid)Required
  • urlstring (uri)Required
  • createdAtstring (date-time)Required
  • eventsarray of string or nullRequired

    The history codes this webhook hears, or null for every step.

  • secretstringRequired

    The signing secret, whsec_…. Shown once.

Status codes

Status Meaning
201 The webhook, with its signing secret. The secret is not returned again by any route.
400 The URL is not https to a public host (invalid_webhook_url), events names a code that is not in the history’s list, is empty or names one twice (invalid_webhook_events), or this company already has 10 live webhooks (too_many_webhooks).
401 No usable credential was sent (invalid_credentials).
POST/v1/webhooks
Example
curl -X POST https://api.certinvo.com/v1/webhooks \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
import { readFile } from 'node:fs/promises'

const response = await fetch(`https://api.certinvo.com/v1/webhooks`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: await readFile('body.json'),
})
console.log(response.status, await response.json())
import os

import requests

response = requests.post(
    "https://api.certinvo.com/v1/webhooks",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
    data=open("body.json", "rb"),
)
print(response.status_code, response.text)
201
application/json
{
  "id": "3f0c2a5e-8d1b-4c7a-9e2f-6b5d4a3c2b1a",
  "url": "string",
  "createdAt": "2026-09-17T09:30:00Z",
  "events": [
    "string"
  ],
  "secret": "string"
}
Success response
POST
/v1/webhooks
Register a webhook
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Headers2
›Bodyapplication/json
›Code Snippet
curl -X POST "https://api.certinvo.com/v1/webhooks" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "string",
  "events": [
    "string"
  ]
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close