Webhooks
Get a signed HTTPS call when an invoice, payment or received document changes, and how Alya Books retries and pauses deliveries.
A webhook sends a signed JSON POST to your HTTPS endpoint when something happens in Alya Books, so your ERP or shop can react without polling.
Set up a webhook
- Go to API access (Setup group in the sidebar) → Webhooks tab → New webhook.
- Enter the Target URL (a public
httpshost), and optionally a name, a description and custom headers, one per line asName: value. - Tick the Events you want, or All events.
- Click Create webhook and copy the signing secret. It is shown only once; Rotate secret in the row menu issues a new one.
The row menu also has Deliveries, Send test (a webhook.test event, tried once) and Pause / Resume.
Events
There are 34 events:
| Group | Events |
|---|---|
| Invoices | invoice.created, invoice.sent, invoice.submitted, invoice.delivered, invoice.reported, invoice.rejected, invoice.paid, invoice.overdue, invoice.deleted, validation.completed |
| Incoming invoices | incoming.created, incoming.validated, incoming.accepted, incoming.rejected, incoming.paid |
| Documents | quote.created, quote.sent, order_confirmation.created, proforma.sent, reminder.created, reminder.sent, document.sent |
| Catalogue | customer.created, product.created, project.created |
| Recurring invoices | recurring_invoice.generated, recurring_invoice.failed |
| Payments | payment_link.paid, bank.transaction_matched |
| Account | organization.ownership_transferred |
| VAT | vat_return.filed, vat_return.reopened, lock_date.changed |
| Integrations | connector.synced |
| Reports | report.delivered (a scheduled report ran and was delivered; see Scheduled reports) |
The body has id (the event id), event, createdAt, organizationId and data.
Headers and signature
Every delivery carries X-Webhook-Event, X-Webhook-Event-Id, X-Webhook-Delivery, X-Webhook-Attempt and X-Webhook-Signature, with user agent Webhook-Delivery/1.0. The signature reads t=<unix time>,v1=<hex>, where the hex is the HMAC-SHA256 of <t>.<body> with your signing secret.
A deployment that still accepts the identifiers of the product's previous name also sends each of these headers a second time under that name's older prefix, with the same values. Verify with the X-Webhook- headers. Custom headers may not start with either prefix.
Retries and pausing
- A delivery succeeds on any 2xx answer within 10 seconds; redirects are not followed.
- A failed delivery is tried up to 6 times in all, after at least 1 min, 5 min, 30 min, 2 h and 12 h. A job sends due retries every 5 minutes. Retry in the deliveries dialog sends one again by hand.
- After 25 deliveries in a row have used up all their attempts, the webhook pauses itself. Resume turns it back on and resets the count.
Good to know
- Owners and admins manage webhooks; other members need the "Manage webhooks" permission under Settings → Team → Permissions. API keys need the
webhooks:managescope.