Add POST /api/billing/cancel endpoint to cancel active subscription at period end #838

Open
opened 2026-04-11 22:13:14 -04:00 by pook · 0 comments
Owner

Add cancellation route to billing router. Steps: (1) Authenticate user. (2) Query stripe_subscriptions table for active subscription by user_id. (3) If none found, return 404 { error: 'No active subscription' }. (4) Call stripe.subscriptions.update(subId, { cancel_at_period_end: true }). (5) Update local DB status to 'canceling'. (6) Return 200 { status: 'canceling', access_until: <period_end_date> }. (7) Test: 401 without auth. (8) Test: 404 with no subscription. (9) Test: 200 with correct response on success. Revenue-critical — required for legal compliance (users must be able to cancel).


Generated by CEO Planner (priority: 3)

Add cancellation route to billing router. Steps: (1) Authenticate user. (2) Query stripe_subscriptions table for active subscription by user_id. (3) If none found, return 404 { error: 'No active subscription' }. (4) Call stripe.subscriptions.update(subId, { cancel_at_period_end: true }). (5) Update local DB status to 'canceling'. (6) Return 200 { status: 'canceling', access_until: <period_end_date> }. (7) Test: 401 without auth. (8) Test: 404 with no subscription. (9) Test: 200 with correct response on success. Revenue-critical — required for legal compliance (users must be able to cancel). --- *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#838
No description provided.