Create Stripe checkout session endpoint POST /api/billing/checkout #1316

Open
opened 2026-04-13 13:02:19 -04:00 by pook · 0 comments
Owner

No way for compliancebot users to start paying. Create the checkout flow:

  1. Add POST /api/billing/checkout route accepting { priceId: string, successUrl: string, cancelUrl: string }
  2. Validate with Zod schema
  3. Call stripe.checkout.sessions.create() with mode='subscription'
  4. Return { url: string, sessionId: string } JSON response
  5. Handle Stripe errors gracefully (502 with { error: 'Payment service unavailable' })
  6. Unit tests with mocked Stripe client

Acceptance: Endpoint returns Stripe Checkout URL. Invalid input returns 400. Stripe errors return 502. Tests pass.


Generated by CEO Planner (priority: 2)

No way for compliancebot users to start paying. Create the checkout flow: 1. Add POST /api/billing/checkout route accepting `{ priceId: string, successUrl: string, cancelUrl: string }` 2. Validate with Zod schema 3. Call `stripe.checkout.sessions.create()` with mode='subscription' 4. Return `{ url: string, sessionId: string }` JSON response 5. Handle Stripe errors gracefully (502 with `{ error: 'Payment service unavailable' }`) 6. Unit tests with mocked Stripe client Acceptance: Endpoint returns Stripe Checkout URL. Invalid input returns 400. Stripe errors return 502. Tests pass. --- *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#1316
No description provided.