Billing Disputes
Billing Disputes: Percentage of invoices disputed by customers.
Formula
Dispute Rate = Invoices disputed / Total invoices × 100 Computable definition
The canonical formula in the GASP formula grammar. The MCP server compiles it to SQL over the datasets listed below.
count_distinct(field.invoice_id where in_period(field.invoice_date) and field.invoice_disputed = true) / count_distinct(field.invoice_id where in_period(field.invoice_date)) Unit: percent (the formula yields an unscaled ratio)
Breakdowns
by_payment_status: one row perpayment_statusvalue
Notes: by_payment_status returns one row per payment status as of period end, since a dispute rate concentrated in unpaid invoices points at collections.
Data requirements
Grain: Per event · Frequency: Per transaction · Aggregation: event · Staged: no · Main source: Billing.
| Field | Dataset | Type |
|---|---|---|
invoice_date | invoice | date |
invoice_disputed | invoice | boolean |
invoice_id | invoice | string |
snapshot_date | invoice | date |
Example SQL (Postgres)
SELECT (CAST((SELECT COUNT(DISTINCT invoice_id) FROM invoice WHERE snapshot_date = :period_end AND ((invoice_date >= :period_start AND invoice_date <= :period_end) AND invoice_disputed = TRUE)) AS DOUBLE PRECISION) / NULLIF((SELECT COUNT(DISTINCT invoice_id) FROM invoice WHERE snapshot_date = :period_end AND (invoice_date >= :period_start AND invoice_date <= :period_end)), 0)) AS billing_disputes From an agent: with the GASP MCP server, call
lookup_metric({ "name": "Billing Disputes" }) or generate_query({ "metric": "Billing Disputes", "adapter": "<your adapter JSON>" }).
What It Tells You
Invoice accuracy and customer alignment.