All use cases

Stripe Checkout Flow

End-to-end payment with webhooks.

IntegrationsAgent: claudeModel: claude-sonnet-4-20250514
Integrated Services
Stripe
Required Configuration

This use case works best with the following environment variables, which are injected into your sandbox at runtime:

STRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
Prompt
Build a complete Stripe checkout integration with Next.js: 1. Product listing page with pricing cards 2. Stripe Checkout session creation (one-time + subscription) 3. Webhook handler for `checkout.session.completed` and `invoice.paid` 4. Success/cancel redirect pages with order confirmation 5. Customer portal link for managing subscriptions 6. Idempotent webhook processing with event deduplication Use the Stripe Node.js SDK and follow Stripe best practices for webhook signature verification.
Use this

Why this exists

Payments are the one part of an app you can't bluff. Stripe's docs are excellent, but wiring them into a real Next.js app means juggling Checkout sessions, redirect states, signature verification, and the detail nearly everyone skips until it bites: idempotency. Stripe retries webhooks, and if your handler isn't deduplicating events it will happily fulfill the same order twice. This blueprint wires the full path correctly the first time, as code in your own repository.

What the agent builds

A complete Stripe checkout integration on Next.js. A product listing page with pricing cards, server-side creation of Checkout sessions for both one-time payments and subscriptions, and success and cancel pages that confirm the outcome. The webhook handler verifies Stripe's signature, processes checkout.session.completed and invoice.paid, and deduplicates by event ID so a retried webhook never runs twice. A customer portal link lets buyers manage their own subscriptions without emailing you.

You watch it happen in the task workspace: the agent scaffolds the app, builds the pricing page and session routes, wires the signed webhook handler, and runs a test event through it to confirm processing is idempotent. The code lands on a branch in your repository with a pull request ready.

Make it yours

The first version is a working baseline you steer with plain follow-up messages:

  • "Send a receipt email when checkout.session.completed fires."
  • "Add a fourteen-day free trial to the subscription plan."
  • "Save completed orders to Postgres instead of only logging them."
  • "Add an annual price alongside the monthly tier."

Each follow-up wakes the same repository and the agent continues on its own code.

FAQ

Do I need a Stripe account? Yes, it runs on your own Stripe keys. Test-mode keys work end to end, so you can drive a full checkout before going live.

How are webhook retries handled? Every event is checked against its ID before processing, so Stripe's automatic retries are safe and never double-fulfill an order.

One-time or subscription? Both. Session creation covers each, and the customer portal link handles ongoing subscription management.

Stripe Checkout Flow | OutcomeDev Use Cases