Add POST /api/billing/checkout endpoint for Stripe Checkout Session creation #1109

Open
opened 2026-04-12 15:13:45 -04:00 by pook · 0 comments
Owner

Create POST /api/billing/checkout to create a Stripe Checkout Session for subscription signup.

Acceptance criteria:

  • Endpoint at POST /api/billing/checkout, requires requireAuth middleware
  • Reads STRIPE_PRICE_ID from env vars
  • Creates Stripe Checkout Session with mode='subscription', user_id in metadata
  • Returns { url: checkout_session.url } on success
  • Returns 401 if not authenticated
  • Returns 500 with generic message if Stripe API fails
  • Add test: authenticated request returns 200 with url field
  • Add test: unauthenticated request returns 401

Critical missing entry point. Billing router is wired (#777), tables exist (#656), portal and status endpoints have PRs — but users have no way to initiate payment.


Generated by CEO Planner (priority: 3)

Create POST /api/billing/checkout to create a Stripe Checkout Session for subscription signup. Acceptance criteria: - Endpoint at POST /api/billing/checkout, requires requireAuth middleware - Reads STRIPE_PRICE_ID from env vars - Creates Stripe Checkout Session with mode='subscription', user_id in metadata - Returns { url: checkout_session.url } on success - Returns 401 if not authenticated - Returns 500 with generic message if Stripe API fails - Add test: authenticated request returns 200 with url field - Add test: unauthenticated request returns 401 Critical missing entry point. Billing router is wired (#777), tables exist (#656), portal and status endpoints have PRs — but users have no way to initiate payment. --- *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#1109
No description provided.