temetro is in beta and under active development. Expect things to change.
temetro

Invoices

Patient billing — line items, installments, and PDF export.

MethodPathPermission
GET/api/invoicesinvoice:read
POST/api/invoicesinvoice:write
PUT/api/invoices/{id}invoice:write
POST/api/invoices/{id}/splitinvoice:write
DELETE/api/invoices/{id}invoice:delete

invoice is a clinic resource granted to the full clinicians (owner / admin / doctor / member) and reception (front-desk billing). Pharmacy and lab have no access. See Roles & permissions.

The invoice object

FieldTypeNotes
idstringAssigned by the server
fileNumberstringPatient's file number (may be empty)
namestringRequired. Patient name
initialsstring1–4 chars; derived from the name when omitted
numberstringHuman invoice number (e.g. INV-1001); auto-generated when omitted
issuedAtstringYYYY-MM-DD; defaults to today
dueAtstring | nullYYYY-MM-DD
statusenumdraft (default) | sent | paid | void
lineItemsarray{ description, quantity, unitPrice }[]
installmentsarray{ label, amount, dueAt, paid }[] (set by split)
notesstring | nullFree text
sourceenummanual (default) | ai

The invoice total is computed from the line items (Σ quantity × unitPrice); it is not stored.

Splitting into installments

POST /api/invoices/{id}/split with { "count": N } (1–36) divides the total into N roughly-equal installments staggered one month apart from issuedAt. Amounts are computed in cents so they always sum back to the exact total.

curl -b cookies.txt -X POST http://localhost:4000/api/invoices/<id>/split \
  -H "Content-Type: application/json" -d '{ "count": 3 }'

Example

curl -b cookies.txt -X POST http://localhost:4000/api/invoices \
  -H "Content-Type: application/json" \
  -d '{
    "fileNumber": "1042",
    "name": "Hodan Warsame",
    "status": "sent",
    "lineItems": [
      { "description": "Consultation", "quantity": 1, "unitPrice": 60 },
      { "description": "Lab panel", "quantity": 1, "unitPrice": 40 }
    ]
  }'

Create returns 201 with the invoice (number assigned); PUT updates with the same payload shape (send number and installments to preserve them); DELETE returns 204. Changes appear in the activity log. PDF export is client-side (the app prints a styled invoice to the browser's "Save as PDF").

On this page