billing
Billing at a glance
TL;DR
Where your bill comes from and where to find it — staff in /app/billing, owners in /portal. One flow from property and stall to invoice and payment.
- billing
- overview
- invoice
- payment
For: Staff (owner/admin/manager/staff/trainer) and horse owners in the portal (/portal or /owner).
Brand: Barnflow tradename; StableSync LLC d/b/a Barnflow in legal pages.
End-to-end flow
- Set up properties & stall rates (per property/unit type).
- Onboard client → create
clients→ link horses viaclient_horseswith % → optionally setclients.user_idto enable portal. - Assign horse to stall (
horses.unit_id) and createreservationsstay. - Charges accrue (board + care + add-ons) → split per
client_horses. - Invoice generated per client (draft → sent → paid/partial/overdue/void).
- Owner views/pays in portal; staff records payments; everything is audit-logged.
- Export CSV for QuickBooks Online (QBO full sync is Growth/future — CSV first).
▶Show details for AI/advancedexhaustive reference & AI context
Billing Overview — Barnflow
For: Staff (owner/admin/manager/staff/trainer) and horse owners in the portal (/portal or /owner).
Brand: Barnflow tradename; StableSync LLC d/b/a Barnflow in legal pages.
What billing covers
Barnflow billing is organized by Organization → Properties → Units (stalls) → Horses → Clients (horse owners).
- Organization is the tenant (your barn business).
- Properties are physical locations; rates can differ per property.
- Units are stalls/spaces under a property (
horses.unit_id). - Clients are horse owners/billing contacts.
clients.user_idlinks a client to a portal login (auth.users). - Horses are billed through ownership links in
client_horses(percentage split). - Reservations (stays) drive board charges:
client_id+property+ optionalunit+ dates. - Every mutation is logged in
audit_events(offline usesclient_mutation_idfor last-write-wins idempotency).
Where to find billing
- Staff:
/app/billing(org ledger),/app/clients,/app/horses,/app/properties - Horse owner portal:
/portal/invoicesor/owner/invoices,/portal/horses,/portal/statements
> Terminology: Always horse owner / owner. Never "guest" in UI or docs.
End-to-end flow
- Set up properties & stall rates (per property/unit type).
- Onboard client → create
clients→ link horses viaclient_horseswith % → optionally setclients.user_idto enable portal. - Assign horse to stall (
horses.unit_id) and createreservationsstay. - Charges accrue (board + care + add-ons) → split per
client_horses. - Invoice generated per client (draft → sent → paid/partial/overdue/void).
- Owner views/pays in portal; staff records payments; everything is audit-logged.
- Export CSV for QuickBooks Online (QBO full sync is Growth/future — CSV first).
Key principles for AI helpers
- Scope every answer by organization + property; never mix tenants (RLS).
- Portal users only see data linked via
clients.user_id/client_horses. - Always include property, horse, date range, and split % when explaining a charge.
- Invoices have an immutable sent state — corrections use adjustments, not silent edits.
AI retrieval keywords: billing, invoice, payment, board, stall, care, split billing, reservation, stay, property, unit, client_horses, portal, Barnflow, StableSync
Barn staff: Open a support ticket
Horse owners: Message your barn