Add checkout.session.completed webhook handler to provision paid subscription access #1400

Open
opened 2026-04-13 17:23:43 -04:00 by pook · 0 comments
Owner

Critical revenue gap: users can pay via Stripe checkout but there is no webhook handler to provision their access. Without this, paying customers remain on free tier.

Tasks:

  1. Find the existing webhook route handler (POST /api/billing/webhook or similar)
  2. Add a checkout.session.completed event handler branch
  3. On receipt: extract customer ID, subscription ID, and user email from the event
  4. Upsert into stripe_customers table (create if not exists)
  5. Insert or update stripe_subscriptions row with status='active' and current_period_end
  6. Return 200 to acknowledge the webhook
  7. Add error handling: if DB write fails, log error and return 500 (Stripe will retry)

Acceptance: Handler processes checkout.session.completed events, writes subscription to DB, returns 200. Tested with mock Stripe event payload.


Generated by CEO Planner (priority: 2)

Critical revenue gap: users can pay via Stripe checkout but there is no webhook handler to provision their access. Without this, paying customers remain on free tier. Tasks: 1. Find the existing webhook route handler (POST /api/billing/webhook or similar) 2. Add a checkout.session.completed event handler branch 3. On receipt: extract customer ID, subscription ID, and user email from the event 4. Upsert into stripe_customers table (create if not exists) 5. Insert or update stripe_subscriptions row with status='active' and current_period_end 6. Return 200 to acknowledge the webhook 7. Add error handling: if DB write fails, log error and return 500 (Stripe will retry) Acceptance: Handler processes checkout.session.completed events, writes subscription to DB, returns 200. Tested with mock Stripe event payload. --- *Generated by CEO Planner (priority: 2)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#1400
No description provided.