{{define "content"}}{{with .Data}}

Metrics

{{if .Stripe}}
{{end}}

MRR and its movements, NRR, CAC and CLV, computed from your Stripe data: every customer, invoice, credit note and refund. MRR comes from the invoice lines (what each customer was billed, for which period), so past months are exact. Supermarket only reads Stripe.

Stripe

{{if not .Stripe}}

Save a restricted Stripe key under Settings → Website & sales. For the metrics it needs read access to Customers, Invoices, Credit notes, Charges and Refunds, and Events, on top of Checkout Sessions.

{{else}} {{with .Last}}

Synced {{ago .At}}{{if .Full}} (everything read){{else}} ({{.Events}} changes since the last sync){{end}}{{with .Error}}: {{.}}{{end}}.{{with .Currency}} Currencies: {{range $i, $c := .}}{{if $i}}, {{end}}{{$c}}{{end}}.{{end}}

{{else}}

Not synced yet: the first sync reads all your Stripe history, which can take a few minutes.

{{end}}
Customers{{num (or (index .Counts "customer") 0)}}
Invoices{{num (or (index .Counts "invoice") 0)}}
Credit notes{{num (or (index .Counts "credit_note") 0)}}
Refunds{{num (or (index .Counts "refund") 0)}}
{{with .Last}}{{range .Notes}}

{{.}}

{{end}}{{end}} {{end}}
{{if .Products}}{{$m := .Margins}}

Gross margin by product

What you keep of each dollar a product brings in, after what it costs you to deliver (hosting, licences, support). CLV weighs each customer's revenue by the margin of what they buy. An empty box uses the default.

{{range .Products}}{{end}}
ProductBilled, last 12 monthsInvoicesMargin
{{.Name}}{{if and .ID (ne .Name .ID)}} {{.ID}}{{end}} {{money .Revenue}}{{num .Invoices}} {{if .ID}} %{{else}}default{{end}}
{{end}} {{end}}{{end}}