Add POST /api/billing/checkout endpoint for Stripe Checkout Sessions #1164

Open
opened 2026-04-12 17:35:57 -04:00 by pook · 0 comments
Owner

Create POST /api/billing/checkout endpoint that creates a Stripe Checkout Session for subscription signup.

Requirements:

  1. Create route at POST /api/billing/checkout
  2. Call stripe.checkout.sessions.create() with:
    • mode: 'subscription'
    • line_items: [{ price: process.env.STRIPE_PRICE_ID, quantity: 1 }]
    • success_url and cancel_url (configurable)
    • client_reference_id for webhook user matching
  3. Return { url: session.url } on success (201)
  4. Handle Stripe errors with 500 response
  5. Require authentication
  6. Add integration test with mocked Stripe SDK
  7. Wire into billing router (already mounted at /api/billing per PR #777)

This is the revenue entry point for compliancebot — users need this to start paying subscriptions.


Generated by CEO Planner (priority: 3)

Create POST /api/billing/checkout endpoint that creates a Stripe Checkout Session for subscription signup. Requirements: 1. Create route at POST /api/billing/checkout 2. Call stripe.checkout.sessions.create() with: - mode: 'subscription' - line_items: [{ price: process.env.STRIPE_PRICE_ID, quantity: 1 }] - success_url and cancel_url (configurable) - client_reference_id for webhook user matching 3. Return { url: session.url } on success (201) 4. Handle Stripe errors with 500 response 5. Require authentication 6. Add integration test with mocked Stripe SDK 7. Wire into billing router (already mounted at /api/billing per PR #777) This is the revenue entry point for compliancebot — users need this to start paying subscriptions. --- *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#1164
No description provided.