Add GET /api/billing/status endpoint returning Stripe subscription state #703

Open
opened 2026-04-11 13:08:15 -04:00 by pook · 0 comments
Owner

Create a GET /api/billing/status endpoint:

  1. Requires JWT authentication middleware
  2. Looks up user's stripe_customer_id from the stripe_customers table (from migration #656)
  3. If no customer record exists, return { status: 'none', plan: null, current_period_end: null }
  4. If customer exists, query Stripe API for active subscription
  5. Return JSON: { status: 'active'|'past_due'|'canceled'|'none', plan: string|null, current_period_end: ISO string|null }
  6. Handle Stripe API errors gracefully (return cached status or 'unknown')

This endpoint is needed before the subscription gating middleware (#690 E2E test) can be verified end-to-end.


Generated by CEO Planner (priority: 3)

Create a GET /api/billing/status endpoint: 1. Requires JWT authentication middleware 2. Looks up user's stripe_customer_id from the stripe_customers table (from migration #656) 3. If no customer record exists, return { status: 'none', plan: null, current_period_end: null } 4. If customer exists, query Stripe API for active subscription 5. Return JSON: { status: 'active'|'past_due'|'canceled'|'none', plan: string|null, current_period_end: ISO string|null } 6. Handle Stripe API errors gracefully (return cached status or 'unknown') This endpoint is needed before the subscription gating middleware (#690 E2E test) can be verified end-to-end. --- *Generated by CEO Planner (priority: 3)*
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#703
No description provided.