· Written · Integration
The Billing API Said Success and Ignored the Filter
A billing API ignored my date filter and returned success. The month's cancellations would have read at 3.8 times the true count. A total I already trusted caught it. My code now filters dates. Incomplete results fail visibly. The data pull passed 43 of 43 tests. Its totals were checked against an independent source.

The old system
Before anyone reads my monthly report, it has to reconcile, meaning its numbers must agree. For Beard Goalz, a DTC brand, one that sells directly to its customers, the report pulls from the store, the subscription billing, the email platform and the analytics. Someone used to pull it by hand. The billing platform is someone else's system. I work with its API, the interface my software uses to request data, as it is. Most of the job is finding out what it actually does.
What broke
I asked it for the subscriptions cancelled inside the month. It ignored the date filter and returned every cancellation on record. It returned a success status, no error, and nothing in the response to say the filter had been dropped. The API said OK. The log said success. My first build trusted the filter, so it would have written the whole history into a single month and moved on. Nothing in the system thought anything was wrong. That is the failure I build against whenever new software meets a system someone else owns. It is a silent failure, a plausible wrong answer that gets read, believed and acted on without a visible crash.
The number
3.8 times the true count. That is what the month's cancellations would have read in the report. Churn tracks cancellations. A number that size sends a business looking for a crisis it doesn't have. The ratio is all I'll publish. The raw counts belong to the brand.
The fix
It got caught by a check against a total I already trusted. The month's figure was the account's whole history. So I stopped trusting the billing system's filter. The extractor, the part that pulls the data, now takes every cancelled subscription and counts only the ones whose cancellation date falls inside the month. That is a filter I can read and test. The paginator, which collects long lists page by page, now fails loudly when it is cut short, instead of quietly handing back part of a list. Each metric is isolated, kept separate from the others. Partial or empty results are marked degraded (incomplete) or failed, never passed off as a quiet success. Another quiet error was in my own math. I built attribution totals, counts that assign credit for orders, by adding rounded pieces. They drifted from the true order count. The API check could never have seen it, because the API was right. An independent review caught that one. Totals are now counted from the raw rows, the original records, never summed from rounded parts. The extraction layer, the code that pulls data, passed 43 of 43 tests. Its totals matched a third-party attribution source.
What I'd tell the ops lead
A wrong number won't announce itself. It will arrive on time, formatted like every other report, with nothing on it to tell you that the system behind it skipped a step you thought it took. So before your team acts on a number that new software pulled from your systems, AI or not, ask what total it was checked against. If the answer is nothing, you're holding a guess. The check is cheap. A month of decisions made on a bad number is not.
The reporting build this came from is written up as a case study, Beard Goalz: The Month Closes Itself.