Arrows to move, Enter to openSee all results →

Standards / billing@1

PublishedVersion 1.1.02026-11-30MITDeveloper reference

billing@1 customers, subscriptions over time, invoices and their lines, payments, refunds and MRR

Customers subscribe to prices. What each subscription bills is kept as state over time: subscription_items has one row per stretch of days during which one item kept the same price, quantity and recurring discount, and subscription_pauses holds the stretches when collection was paused. MRR and its movements are computed from that state, never from invoices alone (an invoice tells you what was billed for a period, including prorations and one-off charges; it is not the recurring value). Invoices, payments, refunds and credit notes are the money that actually moved, for payments, dunning and refund views.

Tables195 requiredFields223no viewsVocabularies12shared word listsDashboards3read it
JSON Schema/spec/billing/1.1.0/billing@1.schema.jsonSQL tables (SQLite)/spec/billing/1.1.0/schema.sqlREADME/spec/billing/1.1.0/README.mdChangelog/spec/billing/CHANGELOG.md

Check a database or a board against it: dashremix spec check. Start a new board on it: dashremix new <id> --schema billing@1. Hash 4e8f89f2704d695b…

Dashboards that read it

Tables and fields

Required tables must exist in every database that says it follows billing@1; required fields must be filled. Columns a board adds start with x_.

metarequired table

Key/value facts about this database. Required: schema, schema_version, as_of, data_hash, source_built_at, base_currency.

FieldTypeRequiredMeaning
keyTEXTno
valueTEXTno

customersrequired table

One customer (a person or a company that pays). Never the email address: only a hash of it.

FieldTypeRequiredMeaning
customer_idTEXTyesstripe:<account>:cus_... or the source's own id, namespaced
nameTEXTnodisplay name as the source has it (company or description); optional, boards blur it under privacy
created_atTEXTinstantnoISO 8601 UTC instant the customer was created at the source
countryTEXTcountrynoISO 3166-1 alpha-2 billing country, when known
currencyTEXTcurrencynoISO 4217 currency the customer is billed in (e.g. EUR)
segmentTEXTnofree label the person sets (SMB, mid-market ...); never inferred
email_hashTEXTnofirst 16 hex of sha256(lower(trim(email))); never the email itself
payment_terms_daysINTEGERno(1.1) the customer's usual payment terms in days (30 = net 30), when the source has them
sourceTEXTnoconnector id that wrote the row: stripe | stripe-csv | billing-csv | manual
source_refTEXTnowhere in the source: file:line (customers.csv:12) or the API object id
imported_atTEXTinstantnoISO 8601 UTC instant of the import (left out of meta.data_hash)

plansrequired table

A price customers subscribe to (Stripe price, older Stripe plan). unit_amount is per interval_count intervals.

FieldTypeRequiredMeaning
price_idTEXTyesstripe:<account>:price_...
productTEXTnoproduct id the price belongs to
product_nameTEXTnoproduct display name (Growth)
nicknameTEXTnoprice nickname (Growth yearly)
intervalTEXTintervalsyesmonth | year | week | day (vocab intervals)
interval_countINTEGERyesbills every interval_count intervals (3 + month = quarterly)
unit_amountREALnomajor units per unit per billing period; NULL for tiered or metered prices
currencyTEXTcurrencyyesISO 4217
usage_typeTEXTusage_typesnolicensed (quantity known upfront: counts in MRR) | metered (billed on usage: not in MRR)
activeINTEGERno1 = can still be sold
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id
imported_atTEXTinstantnoISO 8601 UTC instant

coupons

A coupon. Only discounts that recur (duration repeating or forever) are carried onto subscription_items and so reduce MRR; a once-only coupon is a one-off on one invoice and never moves MRR.

FieldTypeRequiredMeaning
coupon_idTEXTyesstripe:<account>:<coupon id>
nameTEXTnodisplay name
percent_offREALnoshare off, as a decimal (0.2 = 20%); NULL when amount_off is set
amount_offREALnomajor units off each invoice; NULL when percent_off is set
currencyTEXTcurrencynoISO 4217 of amount_off
durationTEXTcoupon_durationsyesonce | repeating | forever (vocab coupon_durations)
duration_in_monthsINTEGERnorepeating: how many months it applies from when it is applied
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id
imported_atTEXTinstantnoISO 8601 UTC instant

subscriptionsrequired table

One subscription of one customer. Its status is the source's current status; what it billed over time is in subscription_items, pauses in subscription_pauses. A subscription stops counting in MRR at ended_at (the day the service ended, e.g. the end of the paid period after a cancellation), not at canceled_at (the day it was cancelled).

FieldTypeRequiredMeaning
subscription_idTEXTyesstripe:<account>:sub_...
customer_idTEXTyes
statusTEXTsubscription_statusyestrialing | active | past_due | unpaid | paused | canceled | incomplete | incomplete_expired (vocab)
created_atTEXTinstantnoISO 8601 UTC instant it was created
started_atTEXTinstantyesISO 8601 UTC instant it started (trial included)
trial_startTEXTinstantnoISO 8601 UTC instant a free trial began, if any
trial_endTEXTinstantnoISO 8601 UTC instant the trial ended (or ends); no MRR before it
trial_convertedINTEGERnoafter a trial: 1 = its first invoice was paid (MRR from trial_end), 0 = invoiced but never paid (never MRR), NULL = no invoice seen (counts)
cancel_at_period_endINTEGERno1 = cancelled, ends at the end of the paid period
canceled_atTEXTinstantnoISO 8601 UTC instant the cancellation was made
ended_atTEXTinstantnoISO 8601 UTC instant it stopped (no MRR from this day on)
cancel_reasonTEXTnoas the source gives it (cancellation_requested, payment_failed ...)
collectionTEXTcollection_methodsnoauto (card charged) | invoice (sent to pay)
currencyTEXTcurrencynoISO 4217 the subscription bills in
confidenceTEXTconfidencenosource (as delivered) | detected (inferred, e.g. from invoices) | manual
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id
imported_atTEXTinstantnoISO 8601 UTC instant

subscription_itemsrequired table

What a subscription billed, over time: one row per stretch during which one item kept the same price, quantity and recurring discount. A change (upgrade, seats, a coupon starting or ending) closes one row and opens the next. Dates are days: a row covers "start" <= day < "end" ("end" NULL = still running). Monthly value of a row: (COALESCE(unit_amount, plans.unit_amount) x quantity x (1 - discount_pct) - discount_amount) normalised to a month (year / 12, week x 52 / 12, day x 365 / 12, divided by interval_count), never below zero.

FieldTypeRequiredMeaning
segment_idTEXTyes<subscription_id>:<item>:<start>, stable for the same state
subscription_idTEXTyes
item_idTEXTnothe source's subscription item id (stripe:<account>:si_...), when known
price_idTEXTyes
quantityREALyesseats or units
unit_amountREALnoprice per unit per billing period when it differs from the plan's (custom or legacy price); NULL = plans.unit_amount
discount_pctREALnorecurring share off, decimal (0.2 = 20%)
discount_amountREALnorecurring amount off each billing period, major units of the price currency
coupon_idTEXTnothe coupon behind the discount, when known
startTEXTdateyesYYYY-MM-DD first day of this state
endTEXTdatenoYYYY-MM-DD first day it no longer held (exclusive); NULL = still running
confidenceTEXTconfidencenosource | detected (rebuilt from invoices: check on the board) | manual
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id (si_..., in_... for a row rebuilt from an invoice)
imported_atTEXTinstantnoISO 8601 UTC instant

subscription_pauses

A pause in collection (Stripe pause_collection, a paused subscription). No MRR while paused: boards show it as its own movement (pause / resume), never as churn.

FieldTypeRequiredMeaning
pause_idTEXTyes<subscription_id>:pause:<start>
subscription_idTEXTyes
startTEXTdateyesYYYY-MM-DD first paused day
endTEXTdatenoYYYY-MM-DD first day collected again (exclusive); NULL = still paused
behaviorTEXTnothe source's pause behaviour (void, keep_as_draft, mark_uncollectible)
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id
imported_atTEXTinstantnoISO 8601 UTC instant

subscription_events

The change log behind subscription state (the events MRR movements are made of): when a subscription started, a trial ended, an item changed, it paused, resumed, was cancelled or ended. Optional and descriptive: MRR comes from subscriptions, subscription_items and subscription_pauses; this table lets a board show why.

FieldTypeRequiredMeaning
event_idTEXTyesthe source's event id, or <subscription_id>:<kind>:<at>
subscription_idTEXTyes
customer_idTEXTnothe subscription's customer
atTEXTyesISO 8601 UTC instant (or YYYY-MM-DD) it took effect
kindTEXTevent_kindsyesvocab event_kinds: started, trial_ended, item_changed, discount_changed, paused, resumed, cancel_scheduled, canceled, ended
price_idTEXTnothe price after the change, when it is about one
quantityREALnothe quantity after the change
detailTEXTnoshort words from the source (never personal data)
confidenceTEXTconfidencenosource | detected | manual
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id
imported_atTEXTinstantnoISO 8601 UTC instant

invoices

An invoice. total is what was billed after discounts and tax; amount_paid what was collected.

FieldTypeRequiredMeaning
invoice_idTEXTyesstripe:<account>:in_...
numberTEXTnothe invoice number shown to the customer
customer_idTEXTno
subscription_idTEXTnothe subscription it bills, NULL for a one-off invoice
created_atTEXTinstantyesISO 8601 UTC instant
period_startTEXTinstantnoISO 8601 UTC instant the billed period starts
period_endTEXTinstantnoISO 8601 UTC instant the billed period ends
billing_reasonTEXTnosubscription_create | subscription_cycle | subscription_update | manual ...
subtotalREALnobefore discounts and tax
discountREALnodiscounts on this invoice (positive)
taxREALnotax on this invoice
totalREALyesbilled: subtotal - discount + tax
amount_dueREALnoleft to collect when it was finalised
amount_paidREALnocollected
amount_remainingREALnostill open
currencyTEXTcurrencyyesISO 4217
statusTEXTinvoice_statusyesdraft | open | paid | uncollectible | void (vocab invoice_status)
attempt_countINTEGERnopayment attempts so far (more than 1 = dunning)
paid_atTEXTinstantnoISO 8601 UTC instant it was paid
due_dateTEXTinstantnoISO 8601 UTC instant it is due (invoice collection)
issue_dateTEXTdateno(1.1) YYYY-MM-DD date printed on the invoice, in the seller's calendar (tz)
due_onTEXTdateno(1.1) YYYY-MM-DD local due date (a date-only source keeps its date; an instant is converted in tz, never via UTC)
sent_onTEXTdateno(1.1) YYYY-MM-DD local day it was first sent; NULL = not sent or not known
paid_onTEXTdateno(1.1) YYYY-MM-DD local day it was paid in full; NULL = not paid in full or the source has no paid date
closed_onTEXTdateno(1.1) YYYY-MM-DD local day it was voided or written off
written_offREALno(1.1) amount written off as uncollectible (positive), so total = amount_paid + amount_remaining + written_off
source_statusTEXTno(1.1) the tool's own status word (sent, viewed, partial, overdue, written off ...); status keeps the five standard values
referenceTEXTno(1.1) purchase order or project reference printed on the invoice
tzTEXTno(1.1) IANA time zone the local dates are in (Europe/London)
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id
imported_atTEXTinstantnoISO 8601 UTC instant

invoice_lines

(1.1) the lines of an invoice (services, time, products, expenses, discounts). amount is the line total before tax (quantity x unit_amount less any line discount; negative for a discount line); the invoice's subtotal is their sum.

FieldTypeRequiredMeaning
line_idTEXTyes<invoice_id>:<position>, or the source's line id
invoice_idTEXTyes
positionINTEGERno1-based order on the invoice
descriptionTEXTnothe line text (private: boards blank it in shared copies)
kindTEXTline_kindsnoservice | time | product | expense | discount | other (vocab line_kinds)
quantityREALnohours, days or units
unit_amountREALnoprice per unit, major units
amountREALyesline total before tax, major units
tax_rateREALnodecimal (0.2 = 20%)
tax_amountREALnotax on this line
currencyTEXTcurrencyyesISO 4217, the invoice's currency
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id
imported_atTEXTinstantnoISO 8601 UTC instant

payments

A payment attempt (Stripe charge): succeeded, failed or pending. A failed attempt is a row too (dunning).

FieldTypeRequiredMeaning
payment_idTEXTyesstripe:<account>:ch_... or py_...
invoice_idTEXTnothe invoice it pays
customer_idTEXTnothe customer
created_atTEXTinstantyesISO 8601 UTC instant of the attempt
amountREALyesattempted amount, major units (positive)
amount_refundedREALnorefunded so far (refunds holds each refund)
feeREALnoprocessor fee, when known
netREALnoamount - fee, when known
currencyTEXTcurrencyyesISO 4217
statusTEXTpayment_statusyessucceeded | failed | pending (vocab payment_status)
failure_codeTEXTnocard_declined, insufficient_funds, expired_card ... when failed
refundedINTEGERno1 = fully refunded
paid_onTEXTdateno(1.1) YYYY-MM-DD local day the money arrived (partial payments: one row each)
methodTEXTpayment_methodsno(1.1) bank_transfer | card | cash | check | other (vocab payment_methods)
confidenceTEXTconfidenceno(1.1) source (a payment row in the source) | detected (one payment built from an invoice's paid date and amount paid)
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id
imported_atTEXTinstantnoISO 8601 UTC instant

refunds

A refund of a payment. Refunds and credit notes reduce revenue collected; they never move MRR (MRR is the recurring value of subscriptions, not cash).

FieldTypeRequiredMeaning
refund_idTEXTyesstripe:<account>:re_...
payment_idTEXTnothe payment refunded
customer_idTEXTnothe customer
created_atTEXTinstantyesISO 8601 UTC instant
amountREALyesrefunded, major units (positive)
currencyTEXTcurrencyyesISO 4217
reasonTEXTnoduplicate | fraudulent | requested_by_customer | other
statusTEXTnosucceeded | pending | failed | canceled
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id
imported_atTEXTinstantnoISO 8601 UTC instant

credit_notes

A credit note against an invoice (money owed back or credited to the customer's balance).

FieldTypeRequiredMeaning
credit_note_idTEXTyesstripe:<account>:cn_...
invoice_idTEXTnothe invoice it credits
customer_idTEXTnothe customer
created_atTEXTinstantyesISO 8601 UTC instant
amountREALyescredited, major units (positive)
currencyTEXTcurrencyyesISO 4217
reasonTEXTnoduplicate | fraudulent | order_change | product_unsatisfactory | other
statusTEXTnoissued | void
sourceTEXTnoconnector id
source_refTEXTnofile:line or API object id
imported_atTEXTinstantnoISO 8601 UTC instant

fx_rates

Recorded exchange rates into the reporting currency. Boards use the latest rate on or before a date and stop (never guess) when a currency has no rate. The person records them (inputs) or a connector delivers them.

FieldTypeRequiredMeaning
dateTEXTdateyesYYYY-MM-DD the rate applies from
ccyTEXTcurrencyyesISO 4217 currency converted
base_ccyTEXTcurrencyyesISO 4217 reporting currency
base_per_unitREALyesunits of base_ccy for one unit of ccy (EUR->USD 1.08)
sourceTEXTnowhere the rate comes from (inputs.yaml, ECB reference rate ...)

mrr_monthly

Derived by a board's importer from the tables above (never written by a connector): each customer's MRR at each month's snapshot (the month's last day, or the as-of date for the current month), one row per customer, currency and month from the customer's first MRR month to the as-of month, zeros included (so a month-to-month diff finds churn). Trials, ended subscriptions, metered prices and paused subscriptions count 0 (paused_native keeps what the paused ones would bill).

FieldTypeRequiredMeaning
customer_idTEXTyesthe customer
monthTEXTmonthyesYYYY-MM
currencyTEXTcurrencyyesISO 4217 of mrr_native
snapshotTEXTdateyesYYYY-MM-DD the state was read at
mrr_nativeREALyesMRR in currency, major units, rounded to cents
paused_nativeREALyeswhat paused subscriptions would add, in currency
fx_rateREALyesbase units per unit of currency on the snapshot day (1 for the base currency)
mrrREALyesround(mrr_native x fx_rate, 2), in meta.base_currency
n_subscriptionsINTEGERyessubscriptions counting in MRR at the snapshot
price_idsTEXTnoJSON list of the prices counting at the snapshot (plan mix)

import_issues

Rows the importer or a connector could not read, or left out on purpose (platform table).

FieldTypeRequiredMeaning
issue_idTEXTyesstable id: <file>:<line> or <file>:<kind>
severityTEXTseveritiesyesinfo | warn | error
kindTEXTyesskipped_row | missing_column | fx_missing | metered_price | detected_history ...
fileTEXTnothe source file name (never its contents)
lineINTEGERno1-based line in that file, when the issue is one row
detailTEXTyeswhat happened
handlingTEXTyeswhat was done about it
sourceTEXTnoconnector id

overrides

Corrections the person made to imported values, with the reason (platform table).

FieldTypeRequiredMeaning
override_idTEXTyesstable id
targetTEXTyestable.key.column the override applies to
fieldTEXTnocolumn name
old_valueTEXTnovalue before
new_valueTEXTnovalue after
reasonTEXTyeswhy, in the person's words
evidenceTEXTnowhere it comes from
authorTEXTnoperson or assistant
created_atTEXTnoISO 8601 instant

annotations

Notes on metrics and pages (platform table). Numbers only through {{metric:...}} placeholders.

FieldTypeRequiredMeaning
annotation_idTEXTyesstable id
targetTEXTyesmetric id or page id
kindTEXTyesnote | caveat | flag | decision | open_item
bodyTEXTyesthe note text
authorTEXTnoperson or assistant
source_refTEXTnowhere it came from
created_atTEXTnoISO 8601 instant
data_hashTEXTnohash of the cited metric values when written (stale when they change)
statusTEXTnoactive | stale | retired

metric_registry

The board's metrics, installed from metrics.sql by the importer (platform table).

FieldTypeRequiredMeaning
metric_idTEXTyese.g. kpi.mrr
versionINTEGERnothe metric's own version
unitTEXTnousd | rows | pct | date | count ...
paramsTEXTnocomma list of parameters it honours
descriptionTEXTnothe @desc line
sqlTEXTnoexpanded SQL
testTEXTnothe @test line (check that covers it)

Vocabularies

Shared word lists, so every board and connector means the same thing by the same word.

collection_methods2 values

auto · invoice

confidence3 values

source · detected · manual

coupon_durations3 values

once · repeating · forever

event_kinds9 values

started · trial_ended · item_changed · discount_changed · paused · resumed · cancel_scheduled · canceled · ended

intervals4 values

month · year · week · day

invoice_status5 values

draft · open · paid · uncollectible · void

line_kinds6 values

service · time · product · expense · discount · other

payment_methods5 values

bank_transfer · card · cash · check · other

payment_status3 values

succeeded · failed · pending

severities3 values

info · warn · error

subscription_status8 values

trialing · active · past_due · unpaid · paused · canceled · incomplete · incomplete_expired

usage_types2 values

licensed · metered

Changelog

1.1.0 (2026-11-30)

  • Minor (new optional columns, one new optional table and two vocabularies; every 1.0 database stays valid), for
  • Invoices & Receivables (freelancers and small businesses that send invoices):
  • invoices: local dates in the seller's calendar (issue_date, due_on, sent_on, paid_on, closed_on) with the IANA tz they are in, written_off (so total = amount_paid + amount_remaining + written_off), source_status (the tool's own word: sent, viewed, partial, overdue, written off) and reference (PO or project). status keeps its five values: a sent or partly paid invoice is open, a written-off one uncollectible; "overdue" and "partly paid" are derived from due_on and amount_paid, never stored as a status.
  • invoice_lines (new table): one row per line, amount before tax, tax, kind (vocab line_kinds).
  • payments: paid_on (local day the money arrived; partial payments are one row each), method (vocab payment_methods) and confidence (detected = one payment built from an invoice's paid date and amount paid).
  • customers.payment_terms_days.
  • Conformance checks: invoice_lines_valid and invoice_local_dates_valid at fail (they read only what is new in 1.1, which a 1.0 database holds empty), invoice_due_after_issue, invoice_balance_consistent and payments_within_invoice at warn.
  • Fixtures: one partly paid one-off invoice with two lines (FX-0005). SaaS Metrics re-pinned; it reads none of the new fields and its numbers do not change.

1.0.0 (2026-11-29)

  • First published version (launch plan §4.4): customers, plans, coupons, subscriptions, subscription_items (state over time: one row per stretch with the same price, quantity and recurring discount), subscription_pauses, subscription_events, invoices, payments, refunds, credit_notes, fx_rates, the derived mrr_monthly, and the platform tables (meta, import_issues, overrides, annotations, metric_registry).
  • The MRR and movement rules (README): month-end snapshot, annual plans / 12, trials 0, pauses kept apart from churn, churn at ended_at, recurring discounts only, constant-currency movements with an explicit fx line, refunds and credit notes never move MRR.
  • Conformance checks: references, state rows valid and not overlapping, pauses, dates ordered, money signs, billable plans, positive rates, no email stored, mrr_monthly consistent; provenance and source_built_at at warn.
  • Fixtures: "Fixture SaaS Co" (fictional), one golden case per MRR rule.
  • Before this release the Stripe connector kept its rows in library/pending/stripe.json; the next dashremix sync writes library/billing.db (ids now carry the account: stripe:<account>:<id>). The pending file can be deleted.

Other standards