The REST API lets your own software, or a service you connect, read and change your clients, invoices, payments, products and expenses. Webhooks work the other way round: we tell your software the moment something happens, such as an invoice being sent or paid.
Both are part of the Pro and Business plans (see Plans and pricing). Owners and admins set them up under Settings → Integrations.
API keys
Go to Settings → API keys and choose Create API key.
- Name the key after what will use it, for example Bookkeeping sync. Use a separate key for each app or service, so you can revoke one without affecting the others.
- Choose What it can do:
- Full access: read and change clients, invoices, payments, products and expenses.
- Choose what it can do: pick No access, Read or Read and change for each of them. A reporting tool, for example, only needs to read invoices and payments.
- Choose when it Expires: in 30 days, 90 days, a year, or never.
- Choose Create key, then Copy the key. This is the only time it is shown. If you lose it, revoke it and create another.
A key acts as the person who created it. It can never do more than their role allows: a key created by an accountant can only read, whatever access it was given. If that person leaves the company, their keys stop working.
The list shows each key's access, when it was last used and when it expires. Revoke stops a key working straight away.
Using the API
| Address | https://api.invoicehosting.co.uk/v1 |
| Sign in | Send the key in the Authorization header: Authorization: Bearer <your key> |
| Format | JSON. Amounts are text with a decimal point ("1080.00"), dates are YYYY-MM-DD, times are in UTC |
| Reference | The OpenAPI description, which tools such as Postman can import |
Try your key:
curl https://api.invoicehosting.co.uk/v1/me -H "Authorization: Bearer <your key>"
The answer names your company and what the key may do.
What you can do
| Address | What it does |
|---|---|
GET /v1/clients, POST /v1/clients |
List clients, add a client |
GET, PUT, PATCH, DELETE /v1/clients/{id} |
Read, change or delete a client |
GET /v1/invoices, POST /v1/invoices |
List invoices, create a draft |
GET, PUT, PATCH, DELETE /v1/invoices/{id} |
Read, change or delete a draft invoice |
POST /v1/invoices/{id}/send |
Mark a draft as sent (it gets its number) |
POST /v1/invoices/{id}/void |
Void a sent invoice with nothing paid |
GET /v1/invoices/{id}/pdf |
Download the PDF |
GET /v1/payments, POST /v1/payments |
List payments, record a payment against an invoice or on account |
GET, PUT, PATCH, DELETE /v1/payments/{id} |
Read, correct or delete a payment |
GET /v1/products, POST /v1/products and /v1/products/{id} |
The same for products |
GET /v1/expenses, POST /v1/expenses and /v1/expenses/{id} |
The same for expenses |
GET /v1/tax-rates, /v1/payment-methods, /v1/expense-categories |
The lists other records refer to |
The same rules apply as in the app: only drafts can be deleted, invoices locked by your settings can't be changed, a payment more than the invoice needs is kept as credit, and so on. When something isn't allowed you get a message saying why.
PATCHchanges only the fields you send.PUTreplaces the record: fields you leave out are cleared. On an invoice, sendingitemsreplaces all its lines; include a line'sidto keep that line.- Lists come a page at a time (
page, andper_pageup to 100). Every list acceptsupdated_since, for example?updated_since=2026-10-01T09:00:00Z, so you can fetch only what changed since your last sync. Lists also take the same filters as the app, such as?status=overdueon invoices or?q=acmeon clients. - Errors come back as
{"message": "..."}. A422also lists the problem with each field undererrors.401means the key is missing, wrong, expired or revoked;402that your plan's limit is used up (for example active clients), or that the account is read-only until an overdue bill is paid;403that the key or its person may not do that, or your plan doesn't include the API;404that there is no such record in your company. - Custom fields you have set up (see Custom fields) come back as
custom_fields, keyed by the field's number. Sendcustom_fieldsthe same way to set them; leave it out to keep them as they are. - Rate limit: each key can make a number of requests a minute (shown on the API keys page). The
X-RateLimit-Remainingheader says how many are left; if you go over, you get a429and aRetry-Afterheader.
Staff who only see some clients (see Your team) see the same clients through their keys.
Another client's records (the client itself, its invoices, their PDFs and its payments) answer 404, exactly as a
record that does not exist, and another client's client_id on an invoice is refused as an invalid client.
Invoices follow the same rules as in the app: one that would come to less than zero is refused with a 422 (raise
a credit note instead).
Webhooks
Go to Settings → Webhooks and choose Add endpoint.
- Enter the Endpoint address: a public
https://address on your server or service. - Add a Description if it helps.
- Choose Events to send: Every event, or tick the ones you want, such as Invoice paid in full or Payment, refund or credit recorded.
Open an endpoint to see its Signing secret, the events it receives and its Deliveries.
- Send test event sends a
pingstraight away and tells you whether your server accepted it. - Edit changes the address or events. Pause events stops sending for now; Switch back on starts again.
- Change secret creates a new signing secret. Events are signed with it straight away, so update your receiver at the same time.
Events
| Event | When |
|---|---|
client.created, client.updated, client.deleted |
A client is added, changed or deleted |
invoice.created, invoice.updated |
An invoice is created or changed (lines, dates, totals) |
invoice.sent |
An invoice is sent or marked as sent |
invoice.viewed |
Your client opens the invoice link |
invoice.paid |
An invoice is paid in full |
invoice.voided |
An invoice is voided |
invoice.deleted |
A draft invoice is deleted |
payment.created, payment.updated, payment.deleted |
A payment, refund or credit is recorded, corrected or deleted |
product.created, product.updated, product.deleted |
A product is added, changed or deleted |
expense.created, expense.updated, expense.deleted |
An expense is added, changed or deleted |
Each event is a POST with a JSON body:
{
"id": "01JBX6Q2N8V3Y5K7M9P1R3T5W7",
"type": "invoice.paid",
"api_version": "v1",
"created_at": "2026-10-25T14:46:00+00:00",
"company": { "id": "01JB...", "slug": "brightwater" },
"data": { "object": { "id": 142, "object": "invoice", "number": "INV-0142", "status": "paid", ... } }
}
data.object is the record exactly as the API returns it. For a deletion it is just the id and object.
Answering and retries
Answer with any 2xx status within 10 seconds. Anything else, or no answer, is tried again after 1 minute,
5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours. A retried event keeps its id, so use it to ignore events you
have already handled. We don't follow redirects: give the final address.
If deliveries keep failing (15 events in a row), we switch the endpoint off and show why on its page. Fix your server, send a test event, then choose Switch back on.
The Deliveries list keeps each event for 30 days, with what we sent and what your server answered. Choose Send again on a delivery to repeat it.
Checking an event came from us
Every event has an InvoiceHosting-Signature header like this:
InvoiceHosting-Signature: t=1730000000,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
To check it:
- Take
t(the time it was sent, in seconds) and the raw request body, exactly as received. - Work out the HMAC-SHA256 of
t, a full stop, then the body (1730000000.{"id":...}), using your endpoint's signing secret as the key. - Compare the result with
v1. If they match andtis within the last five minutes, the event is genuine.
In PHP:
$expected = hash_hmac('sha256', $t.'.'.$body, $secret);
$genuine = hash_equals($expected, $v1) && abs(time() - $t) < 300;
In Node.js:
const expected = crypto.createHmac('sha256', secret).update(`${t}.${body}`).digest('hex');
const genuine = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1)) && Math.abs(Date.now() / 1000 - t) < 300;
The headers InvoiceHosting-Event (the event type) and InvoiceHosting-Delivery (the event id) are sent too.