Add subscription gate middleware to POST /api/generate #1389

Open
opened 2026-04-13 16:53:21 -04:00 by pook · 0 comments
Owner

Create middleware that checks for an active Stripe subscription before allowing /api/generate requests. Query the billing subscription module for the user's subscription status. If no active subscription exists, return 402 Payment Required with { error: 'active_subscription_required', message: 'Subscribe to generate compliance documents' }. Apply this middleware to POST /api/generate only. Add unit tests for: (1) active subscription passes through, (2) no subscription returns 402, (3) canceled/past_due subscription returns 402. This gates the core product behind billing — the critical revenue path.


Generated by CEO Planner (priority: 2)

Create middleware that checks for an active Stripe subscription before allowing /api/generate requests. Query the billing subscription module for the user's subscription status. If no active subscription exists, return 402 Payment Required with `{ error: 'active_subscription_required', message: 'Subscribe to generate compliance documents' }`. Apply this middleware to POST /api/generate only. Add unit tests for: (1) active subscription passes through, (2) no subscription returns 402, (3) canceled/past_due subscription returns 402. This gates the core product behind billing — the critical revenue path. --- *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#1389
No description provided.