All projects
e commerce

Keto Kartel — Subscription Commerce Without the Double Charges and Data Chaos

Subscription Commerce · Laravel · Idempotent Billing · Clean Schema

Client
Keto Kartel
Industry
Health Food & Subscription
Location
Gulf Region
Year
2023
Preview the live site
Project media

See the work in context.

Move through the published screens and walkthroughs. Images open at full size; videos play with their own controls.

Desktop interface

0

Double-charge incidents

post-launch

−100%

Billing complaints (monthly)

vs pre-rewrite

6

Subscription tiers handled

cleanly, no edge case

eliminated

Inventory phantom reservations

event-driven deduction

Project brief
Client
Keto Kartel
Industry
Health Food & Subscription
Location
Gulf Region
Work included
Web Development

Subscription businesses are complex: customers upgrade, pause, skip weeks, swap products, and cancel mid-cycle. Keto Kartel's original system couldn't handle these state changes cleanly — double charges and inventory errors were a regular occurrence. We rebuilt the subscription engine with an idempotent billing core and it's been zero incidents since.

01 / Project Overview

The situation

Keto Kartel sells healthy meal kits and supplements on weekly and monthly subscription cycles. The subscription model creates a layer of operational complexity that a standard e-commerce build isn't designed to handle: every customer's subscription can be in a different state at any moment — active, paused, mid-cycle-downgrade, product-swapped — and billing runs on a schedule regardless of what state changes happened in the preceding period. The original flat subscription schema treated all of this as simple on/off flags. When a customer upgraded mid-cycle, the system didn't know how to prorate correctly. When billing ran, it read current state rather than the state at billing time — meaning a customer who paused after the billing cutoff still got charged. Inventory deductions happened at order creation rather than at actual billing, creating phantom reservations that led to stockouts on popular products. We redesigned the subscription system from the schema up. Subscription state is now tracked as explicit transitions with timestamps — the billing engine always reads what the state *was* at the billing moment, not what it is now. Billing uses idempotency keys: each billing cycle has a unique key that prevents any charge from being executed twice regardless of network failures or retries. Inventory deduction is a separate queue job that only fires on successful billing confirmation.

02 / The Challenge

What had to change

Double charges from billing retry races. Incorrect prorations when customers changed plans mid-cycle. Inventory phantom reservations from failed-then-retried billing attempts. Customer service was handling dozens of billing complaints monthly — a direct cost in refunds and staff time that was eating into margins.

03 / Our Solution

What we changed

Schema redesign with explicit state transitions and timestamps. Idempotency keys on every billing operation — the same key submitted twice produces one charge, always. Inventory deduction as a confirmed-billing-event subscriber, never at order creation. Proration logic based on time-weighted state history, not current state at billing time. Zero double charges since deployment.

04 / Deliverables & outcomes

What the client gained

  • 01 Idempotent billing — physically impossible to double-charge
  • 02 State-transition schema — accurate proration always
  • 03 Inventory only decrements on confirmed billing event
  • 04 6 subscription tiers with full plan-change flexibility
Bring the next constraint

Have a project that needs a clearer way forward?

Discuss the project

1 / 2