Skip to main content
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 REST API Directly

Response:
Redirect your customer to checkoutUrl to complete payment.

Redirect Best Practices

Do not use window.open() to open the checkout page. Safari and many mobile browsers block popup windows opened from asynchronous callbacks (e.g., after an API call). This causes checkout to silently fail for your customers.
Recommended approaches:
After payment, the customer is redirected back to your 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:
Use case: User is already logged into your app, so you know their email.

Track with Metadata

Link checkout sessions to your internal systems:
Metadata is stored on the checkout session and can be retrieved via the 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:
If you need to handle checkout on the client side (e.g., SPA):

Parameters Reference


Next Steps

Handle Webhooks

Get notified when payments complete

Verify Payments

Securely verify webhook signatures