FOR ACCOUNTING FIRMS AND DEVELOPERS
Connect accounting software to SimplyFact
For accounting firms and developers: connect final sales invoices and credit notes and retrieve received purchase invoices. A webhook reports an event; your software fetches the available data through the API and processes it for the bookkeeping. JSON, UBL and PDF are available for sales and purchases. For purchases, UBL and PDF are the original files as they were received or uploaded.
Access per company
As owner or company administrator, the customer opens Settings › API and webhooks, creates an API key and chooses only the read permissions needed:
documents:readfor final sales documents, PDF and UBL;incoming:readfor purchase invoices: list, detail and original UBL/PDF;- optionally
company:readfor company details,payments:readfor payments andsuppliers:readfor suppliers.
The customer can set an expiry date. The key starts with sfk_ and is shown only once. Pass it on securely, for example through a password manager. Revoking it stops access immediately. Each key belongs to one company: a separate key is needed for each customer. There is currently no firm-wide key and no OAuth. OAuth is a different way of granting access; it is not a different kind of connection.
Using the API
The base address is https://app.simplyfact.eu/api/v1. Call the API from your server and send the key along:
Authorization: Bearer sfk_…The default limit is 120 requests per minute per key, counted per application process. On 429, Retry-After tells you how many seconds to wait. X-RateLimit-Remaining and X-RateLimit-Reset show the remaining allowance and the time until the reset. Errors use application/problem+json, with among others status, title and detail.
This read flow needs no Idempotency-Key. Use it on POST and PUT requests to safely repeat the same write action. Lists are paginated: follow nextCursor with the parameter cursor until it is null. Amounts are decimal text; process them with decimal arithmetic.
Setting up and verifying webhooks
Under Settings › API and webhooks the customer adds a webhook with a public HTTPS endpoint and selects the events wanted. The secret whsec_… appears only once: pass it on securely to the developer. Send a test message and check the recent deliveries.
| Event | Meaning |
|---|---|
document.finalized | A document was finalised. This includes other document types as well; filter on data.kind. |
payment.registered | A payment on a sales document was registered. Payments on purchase invoices do not trigger a webhook yet. |
incoming.received | A new purchase invoice was received; an invoice received twice does not send a second message. |
incoming.reviewed | Someone deliberately marked a purchase invoice as reviewed or approved an expense (opening does not count). One message per transition; data.readyForBooking says whether you may book. |
ping | Manual test message. |
SimplyFact sends JSON with the headers SimplyFact-Event, SimplyFact-Delivery and SimplyFact-Signature. Verify the signature on the raw body with the full webhook secret. For example in Node.js:
import { createHmac, timingSafeEqual } from 'node:crypto';
function verify(secret, header, rawBody) {
const parts = Object.fromEntries(header.split(',').map(part => part.split('=')));
if (!parts.t || !/^\d+$/.test(parts.t) || !/^[0-9a-f]{64}$/.test(parts.v1 ?? '')) return false;
if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false;
const expected = createHmac('sha256', secret)
.update(parts.t + '.').update(rawBody).digest();
return timingSafeEqual(Buffer.from(parts.v1, 'hex'), expected);
}Reply with a 2xx response after successful receipt and process the message afterwards. Deduplicate on SimplyFact-Delivery: a delivery can arrive again and the order is not guaranteed. On failure, retries follow after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours. After that the delivery is abandoned. After 20 consecutive failed deliveries the webhook is paused; the administrator can reactivate it.
Sales: booking an invoice or credit note
- Receive and verify
document.finalized. For this flow, only processdata.kindequal toinvoiceorcredit-note. - Take
data.documentIdand fetch the final document as JSON. Also fetch the UBL and the archived PDF. - Check and book the document in your accounting software. Store the company and document identity to prevent double processing.
Use your own key and document ID in the environment variables:
curl -H "Authorization: Bearer $SIMPLYFACT_KEY" \
"https://app.simplyfact.eu/api/v1/documents/$DOCUMENT_ID"
curl -H "Authorization: Bearer $SIMPLYFACT_KEY" \
"https://app.simplyfact.eu/api/v1/documents/$DOCUMENT_ID/ubl" -o document.xml
curl -H "Authorization: Bearer $SIMPLYFACT_KEY" \
"https://app.simplyfact.eu/api/v1/documents/$DOCUMENT_ID/pdf" -o document.pdfUBL can be refused with 409 when required data is missing. Then look at detail in the error response and have the problem fixed.
Purchases: booking a purchase invoice
- Receive and verify
incoming.reviewed. That message only comes after a deliberate approval: the customer or the firm clicks Reviewed – ready for bookkeeping in SimplyFact (in the invoice, or for several invoices at once in the list or the accountant portal), or approves expenses (also in bulk). Merely opening an invoice sends nothing. You get one message per transition: saving again or marking again sends no second message. If someone sets the invoice back to not reviewed and approves it again later, a new message does follow. - Only book if
data.readyForBookingistrue. For expenses that is only after approval (data.status=approved); for other purchases as soon as they are reviewed (data.status=reviewed). - Use
data.incomingIdto fetch the detail: supplier, lines, VAT per rate, totals,reviewedAt,expenseStatus, payment status, source (peppol,ubl,emailormanual) and the listoriginals. - Fetch the original file.
/ublreturns the UBL file unchanged, as it arrived via Peppol or as UBL./pdfreturns the uploaded PDF or otherwise the PDF the supplier embedded in the UBL; SimplyFact never creates a PDF itself here. If there is no original of that type,404follows withtitleGeen origineel.originalUblandoriginalPdfin the detail show in advance what is available. On503the file is temporarily unreadable: try again afterRetry-After. - Store the company and purchase ID to prevent double processing.
An example message:
{
"id": "9f8e7d6c-5b4a-4321-8fed-cba987654321",
"type": "incoming.reviewed",
"createdAt": "2026-11-04T08:12:40.200Z",
"companyId": "e4c1b2a3-0f9e-4d8c-b7a6-123456789abc",
"data": {
"incomingId": "5a9d3c1e-2b4f-4e6a-8d7c-1e0f9a8b7c65",
"number": "INV-88731",
"kind": "invoice",
"supplier": "Example Supplier Ltd",
"issueDate": "2026-11-03",
"currency": "EUR",
"total": "121.00",
"status": "reviewed",
"readyForBooking": true
}
}Use your own key and purchase ID in the environment variables:
curl -H "Authorization: Bearer $SIMPLYFACT_KEY" \
"https://app.simplyfact.eu/api/v1/incoming-invoices/$INCOMING_ID"
curl -H "Authorization: Bearer $SIMPLYFACT_KEY" \
"https://app.simplyfact.eu/api/v1/incoming-invoices/$INCOMING_ID/ubl" -o purchase.xml
curl -H "Authorization: Bearer $SIMPLYFACT_KEY" \
"https://app.simplyfact.eu/api/v1/incoming-invoices/$INCOMING_ID/pdf" -o purchase.pdfIf you also want to know when a purchase arrives, additionally use incoming.received. Receipt does not mean the purchase invoice has already been reviewed or approved. With GET /incoming-invoices (paginated, with from and to on invoice date) you can also retrieve all purchases in one go afterwards, for example to check that you missed nothing.
Payments on purchase invoices do not trigger a webhook yet; you find them via GET /payments (permission payments:read).
Access to the app for the firm
This access is separate from the API key. The customer invites one contact person via Settings › Users › Invite your accountant and chooses View and process or Read and export only. On acceptance, the contact person can create a new firm as administrator or choose an existing firm they manage. The firm administrator can add colleagues. A new firm registration can first be held for review. The customer can revoke the firm's access again.
Frequently asked questions
Do you need a separate key for each customer?
Yes. Each API key applies to one company. A key from one company never gives data or files of another company.
Does a webhook contain the full invoice?
No. A webhook contains references and limited data. Fetch the available documents and files afterwards through the API.
Is a received purchase invoice approved automatically?
No. incoming.received reports receipt. Only incoming.reviewed reports that the invoice has been reviewed or approved; readyForBooking in the message and in the detail says whether you may book.
Can you edit or send documents with these read permissions?
No. Finalising and sending happen in SimplyFact.
Where is the full technical description?
See the API and webhooks guide and the OpenAPI specification.