Skip to content
BeQuitt

BeQuitt API

Your own software can read customers, invoices, payments and events, add sales invoices and send files for intake. This page lists every call; the OpenAPI document describes the same for programs.

The API is part of the Enterprise plan. An owner or admin of an Enterprise organisation makes keys in Settings, Integrations.

OpenAPI 3.1 document

Keys

An owner or admin makes a key in Settings, Integrations, and chooses what it may do. Send it with every call in the Authorization header, as Bearer followed by the key. The whole key is shown once; BeQuitt keeps only a fingerprint of it. A revoked key stops working 30 seconds later.

How the API answers

  • Amounts are whole numbers of minor units: 1,200.00 EUR is 120000.
  • Dates are written YYYY-MM-DD.
  • Lists come in pages of up to 100 rows, oldest first. Pass nextCursor as cursor to get the next page.
  • Send an Idempotency-Key header with a POST: the same request with the same key within 24 hours is not done twice.
  • Errors are RFC 9457 problem details with a short code.
  • Each key has its own rate limit. An answer 429 says in Retry-After how many seconds to wait.

Webhooks

Instead of asking for events, your program can be told: an owner or admin adds an https address in Settings, Integrations, and chooses the events. BeQuitt then sends each event as a POST with a JSON body.

Events

  • invoice.paidA confirmed payment closed the invoice, or an issued invoice was marked paid. Carries the invoice with its status.
  • invoice.promisedA payment promise was recorded. Carries the invoice with the promised date.
  • invoice.disputedThe invoice was marked disputed. Carries the invoice with its status.
  • document.reviewedA person approved a read document. Carries the document's id, kind, number, date and total.
  • pingThe test button in Settings. Carries nothing else.

The body has id (the event id: the same for every endpoint, use it to ignore a repeat), type, createdAt, organizationId and data. An invoice is the same as GET /invoices/{id} answers, without the customer's name.

Check the signature

  1. Read the BeQuitt-Signature header: t is the time it was signed (seconds), v1 the signature.
  2. Compute HMAC-SHA256 of t, a dot and the raw body, exactly as received, with your signing secret.
  3. Compare it with v1 in constant time.
  4. Refuse a message whose t is more than 5 minutes away from your clock, so a copied message cannot be sent again later.

Answer with a 2xx status within 10 seconds. Anything else, a redirect or no answer is tried again, after 5, 15 and 30 minutes and then longer, for 24 hours. An endpoint that takes nothing for 24 hours is paused; Settings shows why, and resuming sends new events again.

Example (Node.js)

import { createHmac, timingSafeEqual } from "node:crypto";

// rawBody: the request body exactly as received (a string), header: the BeQuitt-Signature header
export function fromBeQuitt(rawBody, header, secret, toleranceSeconds = 300) {
  const entries = header.split(",").map((part) => part.trim().split("="));
  const t = Number(entries.find(([key]) => key === "t")?.[1]);
  if (!Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
  const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
  return entries
    .filter(([key]) => key === "v1")
    .some(([, value]) => {
      const given = Buffer.from(value ?? "", "hex");
      return given.length === expected.length && timingSafeEqual(given, expected);
    });
}

MCP server for AI assistants

AI assistants that speak the Model Context Protocol (MCP), such as Claude, can read your BeQuitt data through https://bequitt.app/api/mcp. The server only reads: it cannot add, change or send anything.

It uses the same API key, plan and limits as the API. Each tool needs the read scope shown with it, and an assistant only sees the tools its key's scopes allow. Give the assistant a key with read scopes only.

Tools

  • list_customersThe organisation's customers (name, e-mail, tax id), oldest first. Answers { data, nextCursor }; pass nextCursor back as cursor for the next page.Needs customers:read
  • list_invoicesThe organisation's sales invoices with their status (state, paid on, promised for, disputed), oldest first. Amounts are integer minor units (cents); dates are YYYY-MM-DD. With status, only invoices in that state are returned: up to 5 pages are read to find them, so an answer can hold fewer or a few more rows than limit; carry on with nextCursor while it is not null.Needs invoices:read
  • get_invoiceOne invoice by its id (imported:<uuid> or issued:<uuid>, as list_invoices gives it), with what is paid, what is outstanding and its status.Needs invoices:read
  • list_paymentsPayments a person confirmed against a bank line, oldest first, with the invoice each one paid. Amounts are integer minor units.Needs payments:read
  • list_eventsWhat happened to invoices, payments and documents (type and object only), oldest first. nextCursor is never null: fetch again while more is true, later with the last nextCursor to get only what is new.Needs events:read

Connect an assistant

Add the server to the assistant's MCP settings, with your key in the Authorization header. Keep the key out of shared files.

{
  "mcpServers": {
    "bequitt": {
      "type": "http",
      "url": "https://bequitt.app/api/mcp",
      "headers": { "Authorization": "Bearer bqk_..." }
    }
  }
}

From the command line (Claude Code)

claude mcp add --transport http bequitt https://bequitt.app/api/mcp --header "Authorization: Bearer bqk_..."

Calls

The description of each call is in English, like the OpenAPI document.

get/api/v1/customers

List customers

The organisation's customers, oldest first.

Needs customers:read

Parameters

  • limitqueryoptionalHow many rows, 1 to 100 (default 50).
  • cursorqueryoptionalThe nextCursor of the previous page.

Answers

200 A page of customers.

get/api/v1/customers/{id}

Get a customer

One customer by its id.

Needs customers:read

Parameters

  • idpathrequiredThe customer's id.

Answers

200 The customer.

get/api/v1/invoices

List invoices

The organisation's sales invoices with their status, oldest first. Drafts and removed invoices are left out.

Needs invoices:read

Parameters

  • limitqueryoptionalHow many rows, 1 to 100 (default 50).
  • cursorqueryoptionalThe nextCursor of the previous page.

Answers

200 A page of invoices.

post/api/v1/invoices

Create an invoice

Adds a sales invoice from another program, through the same checks as a file import. The same number for the same customer is refused with 409. From then on it is treated like any imported invoice, the organisation's reminder settings included.

Needs invoices:write

Parameters

  • Idempotency-KeyheaderoptionalAny unique string up to 255 characters. The same key with the same request within 24 hours answers what was answered the first time, without doing it again.

Body

  • numberstringrequired
  • customerIdstring (uuid)optional
  • customerNamestringoptional
  • customerEmailstring (email)optional
  • issueDatestring (date)required
  • dueDatestring (date)requiredOn or after issueDate.
  • currencystringrequired
  • amountMinorintegerrequiredThe total, VAT included, in minor units.

Answers

201 The invoice as BeQuitt now has it.

get/api/v1/invoices/{id}

Get an invoice and its status

One invoice by its id, with what is paid, what is outstanding and its status (paid, promised, disputed).

Needs invoices:read

Parameters

  • idpathrequiredimported:<uuid> or issued:<uuid>.

Answers

200 The invoice.

get/api/v1/payments

List payments

Payments a person confirmed against a bank line, oldest first. Recording a payment through the API is not offered: BeQuitt counts only payments a person confirmed.

Needs payments:read

Parameters

  • limitqueryoptionalHow many rows, 1 to 100 (default 50).
  • cursorqueryoptionalThe nextCursor of the previous page.

Answers

200 A page of payments.

post/api/v1/documents

Upload a file for intake

One file (an invoice list as CSV or Excel, an e-invoice XML, a bank statement, a PDF), read exactly like a file e-mailed to the organisation's sales address. The same file twice is answered as already imported. At most 25 MB.

Needs documents:write

Parameters

  • Idempotency-KeyheaderoptionalAny unique string up to 255 characters. The same key with the same request within 24 hours answers what was answered the first time, without doing it again.

Body

The file in the field `file`.

Answers

200 What was done with it.

get/api/v1/events

List events

What happened to invoices, payments and documents, oldest first. Every answer, the last page and an empty one included, carries a nextCursor: fetch again at once while more is true, then poll later with the last nextCursor to get only what is new.

Needs events:read

Parameters

  • limitqueryoptionalHow many rows, 1 to 100 (default 50).
  • cursorqueryoptionalThe nextCursor of the previous page.

Answers

200 A page of events.