Add POST /api/billing/cancel endpoint to cancel active subscription at period end #838
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#838
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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)