✨ Install with AI
✨ Install with AI
Copy this prompt to your AI code editor (Cursor, Copilot, etc.) to create checkout integration:
What You’ll Build
A checkout session is a dynamically generated payment page. Instead of sharing a static product link, you can:- Pre-fill customer email
- Track orders with custom metadata
- Set custom success URLs
- Enable trial periods for subscriptions
Prerequisites
- Waffo Pancake account
- API key (Dashboard → API & Development)
- At least one product created
Basic Checkout Session
The simplest checkout session needs a product ID and currency.Using the TypeScript SDK (Recommended)
Using REST API Directly
checkoutUrl to complete payment.
Redirect Best Practices
Recommended approaches:successUrl. Use the {SESSION_ID} placeholder to verify the payment on your success page.
Pre-fill Customer Email
Skip the email input step by pre-filling it:Track with Metadata
Link checkout sessions to your internal systems:checkoutSession GraphQL query. Webhook passthrough for metadata is coming soon.
Subscription with Trial
Enable a trial period for subscription products:Discount codes and per-seat quantities are not yet supported via the API. Manage discounts through the Dashboard.
Subscription with Billing Detail
Pre-fill the consumer’s billing information for tax calculation:Dynamic Success URL
Pass data to your success page:{SESSION_ID} will be replaced with the actual session ID, so you can verify the payment on your success page.
Complete Example: SaaS Upgrade Flow
Here’s a real-world example for upgrading a user’s subscription using the SDK:Parameters Reference
Next Steps
Handle Webhooks
Get notified when payments complete
Verify Payments
Securely verify webhook signatures