Stripe Integration
Latest Stripe API version: 2026-03-25.dahlia. Always use the latest API version and SDK.
Integration Routing
| Building... | Recommended API | Details |
|---|---|---|
| One-time payments | Checkout Sessions | Payments |
| Custom payment form with embedded UI | Checkout Sessions + Payment Element | Payments |
| Saving a payment method for later | Setup Intents | Payments |
| Connect platform or marketplace | Accounts v2 (/v2/core/accounts) |
Connect |
| Subscriptions or recurring billing | Billing APIs + Checkout Sessions | Billing |
| Embedded financial accounts / banking | v2 Financial Accounts | Treasury |
Quick Reference
API Hierarchy (most to least recommended)
- Checkout Sessions — Hosted payment page, minimal PCI burden
- PaymentIntents — Custom payment UI with Payment Element
- SetupIntents — Save payment methods for future use
Environment Variables
STRIPE_SECRET_KEY— Server-side API key (sk_live_... or sk_test_...)STRIPE_WEBHOOK_SECRET— Webhook signature verification (whsec_...)NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY— Client-side (pk_live_... or pk_test_...)
References
- Payments — Checkout Sessions, PaymentIntents, SetupIntents, migration
- Billing — Subscriptions, Customer Portal
- Connect — Platforms, marketplaces, Accounts v2
- Treasury — Financial Accounts v2
- Installation — Stripe CLI setup
- Projects CLI — Stripe Projects commands