Money

Raise a charge against a tenancy

Files one notice on the signed-in owner’s account. The number is assigned here, off the numbers already filed, and the row id carries it, so two sessions raising a charge in the same moment cannot mint the same number: the second is refused by storage and retried on the next one. VAT is read from the jurisdiction pack the building stands under, and a charge whose treatment nobody has confirmed is refused rather than written at zero, because a notice that should have carried VAT leaves the owner owing the tax out of what the tenant paid. vatRate is how the owner states it themselves. Every amount is integer cents.

post/api/v1/invoices

Request

  • Base URL: http://localhost:5180
  • URL: http://localhost:5180/api/v1/invoices
  • Auth: API key in cookie better-auth.session_token

Request body

leaseIdstring required

The tenancy the notice is raised against.

kind'rent' | 'charges' | 'charges_settlement' | 'utilities' | 'recharge' | 'late_fee' | 'indemnity' | 'other' required

What the money is for. A credit note is a reduction, not a charge.

amountinteger required

The net, in integer cents. Any VAT is worked out on top of it.

dueDatestring required

When it falls due. A date already past is raised overdue.

descriptionstring required

What it is, in the owner’s words. The tenant reads this.

periodStartstring

A calendar date, YYYY-MM-DD.

periodEndstring

A calendar date, YYYY-MM-DD.

notestring

Why it was raised. Kept on the record, never shown to the tenant.

vatRatenumber

The rate the owner states, as a decimal. Required where the pack cannot settle the treatment, and the only way to raise a charge outside letting a home.

Response

The notice, as filed.

okunknown required

Changes

No recorded changes to this operation across all 1 revision of this API.