Why a renewal is a sequence, not a status field
Most billing systems store a subscription status and change it when a charge succeeds. That model breaks down the moment a payment is retried, partially refunded or applied to a credit balance. This note describes the state machine Sobtra uses instead, and why every step produces a record that can be audited later.
The tempting model is a column: `status = active | past_due | cancelled`. It is easy to query and easy to render. It is also the reason most support conversations about billing start with someone reading three different screens and finding they disagree.
Sobtra treats a renewal as a sequence of records: a billing period closes, an invoice is created, a payment attempt is made, and the result is recorded against both the invoice and the subscription. The subscription's own state is derived from those records rather than written directly. That means a retry does not overwrite a failure, and a refund does not erase the original payment.
The trade-off is more tables and more joins. The benefit is that when a merchant asks why a customer was charged twice, the answer is in the data rather than in someone's memory.