DocsPlugins

Invoicing

Billing for anyone who bills people: issuers, a catalogue, subscriptions, invoice runs with payment references, bank transfers matched, payments online, wallets and reminders.

The billing plugin suits anyone who bills people, from a school to a sports club. It comes with Payments, for payments online. To add it:

sluurp plugin add billing
IssuerWho bills: its name, bank account, invoice numbering and payment provider
ItemA catalogue entry with a price and a unit: each, day, month or year
AccountWho a charge is for, such as a pupil, taken from your app’s own data
ChargeOne item billed to one account, posted by hand or made from a subscription
SubscriptionA recurring charge: lunch on Mondays and Thursdays, a monthly fee
InvoiceAn account’s open charges, with a number, a due date and a payment reference
PaymentSettles invoices: by transfer, in cash, or online
WalletA prepaid balance: a booked meal is taken from it, and given back if cancelled in time

All amounts are whole cents.

Set it up

Invoicing has no screen in the admin: your app is where it is used. Set it up from your app, as somebody allowed to manage it (a superuser at first):

setup.ts
import "plugin:billing";

await sluurp.billing.setSettings({
  manage: "@request.auth.staff = true", // who manages billing; unset, superusers only
  currency: "EUR",
  accounts: { collection: "users", filter: "" }, // who is billed
  payers: { collection: "custodies", account: "child", payer: "custodian" }, // who pays for them
  reminders: { after_days: 7, every_days: 7, max: 3 },
});

const issuer = await sluurp.billing.saveIssuer(null, {
  name: "Springfield Elementary",
  iban: "BE97 0011 5414 0049",
  company_no: "0123.456.789",
  due_days: 14,
});

An issuer takes payments online once it has a Payments provider and its keys. Its country, which decides its payment references and its e-invoices, is its IBAN’s unless you set one.

Bill a period

billing.ts
await sluurp.billing.charge({ accounts: [pupil.id], item: trip.id }); // a charge, for one account or many
await sluurp.billing.run({ issuer: issuer.id, from: "2026-09-01", to: "2026-09-30", dry: true }); // what a run would make
await sluurp.billing.run({ issuer: issuer.id, from: "2026-09-01", to: "2026-09-30" }); // bill subscriptions, invoice open charges

remind(id) mails the payers a reminder for an unpaid invoice, and cancel(id) cancels one nothing has been paid on. Reminders also go out on their own, as the settings say.

Collect payments

  • Online: pay({ invoice, back }) gives a checkout url on the issuer’s provider. The payer comes back to back with ?paid=<id>, and check(id) says how it went.
  • By bank transfer: pass your bank statement’s lines to match(lines). Each is matched to its invoice by its payment reference; pass dry to see the matches first.
  • In cash: record({ invoice, amount_cents, method: "cash" }).
  • A wallet top-up: pay({ account, issuer, amount_cents, back }).

With the peppol plugin, an invoice also downloads as an e-invoice in countries that use Peppol.

View as Markdown