/nextjs-api-stripe-custom-checkout

An api route to create a custom checkout session with the customer email and price_id creating a subscribtion with 7 days trial

Primary LanguageTypeScript

NextJS Api Route to create Stripe Custom Checkout Sessions

Get started

First, run the development server:

npm run dev
# or
yarn dev

From any environment you can now make a post request to /api/checkout_sessions with customer_email and price_id to create a checkout session for a subscribtion product with 7 day trial.