Skip to main content
Lava checkout supports three modes, each for a different stage of the customer lifecycle.

The Three Modes

ModePurposeCreates Connection?Requires Connection?
subscriptionSubscribe to a recurring planYesNo
topupAdd credits to existing walletNoYes
onboardingOne-time wallet creation (legacy)YesNo

Subscription Mode

Use when: A new customer is signing up for a monthly plan.
const session = await lava.checkoutSessions.create({
  checkout_mode: 'subscription',
  origin_url: 'https://yourapp.com',
  subscription_config_id: 'subconf_your_plan_id',
  reference_id: 'user_123'
});
What happens:
  1. Customer verifies phone number
  2. Customer adds payment method
  3. Customer is charged the plan amount (e.g., $25)
  4. Subscription is created with automatic monthly renewal
  5. You receive a connection_id to use for billing
Billing cycle:
  • Balance resets monthly to the plan amount
  • Overages auto-charge to the customer’s card
  • Customer can cancel anytime
This is the recommended mode for most use cases.

Topup Mode

Use when: An existing customer wants to add more credits to their wallet.
const session = await lava.checkoutSessions.create({
  checkout_mode: 'topup',
  origin_url: 'https://yourapp.com',
  connection_id: 'conn_existing_customer_id' // Required
});
What happens:
  1. Customer sees their current balance
  2. Customer chooses an amount to add
  3. Customer is charged immediately
  4. Balance increases by that amount
Common use cases:
  • “Add Credits” button in your app
  • Low balance warning with recharge CTA
  • Letting power users pre-fund larger amounts
Topup requires an existing connection_id. The customer must have already completed checkout via subscription or onboarding mode first.

Onboarding Mode (Legacy)

Use when: You want one-time wallet creation without recurring billing.
const session = await lava.checkoutSessions.create({
  checkout_mode: 'onboarding',
  origin_url: 'https://yourapp.com',
  reference_id: 'user_123'
});
What happens:
  1. Customer verifies phone number
  2. Customer adds payment method
  3. Customer adds an initial balance (one-time charge)
  4. You receive a connection_id
Key difference from subscription:
  • No automatic renewal
  • Customer must manually top up when balance runs low
  • No plan attached
Legacy mode. For most use cases, subscription mode is preferred. It provides a better customer experience with automatic renewal and predictable billing. Use onboarding only if you specifically need one-time payments without recurring billing.

Which Mode Should I Use?

Is this a new customer?
├── Yes → Do you want recurring monthly billing?
│   ├── Yes → subscription
│   └── No → onboarding (legacy)
└── No → topup
Most common pattern:
  1. New customers → subscription mode
  2. Existing customers adding credits → topup mode

Checkout Flow Summary

Regardless of mode, the checkout flow handles:
  • Phone verification via SMS OTP
  • Payment method collection via Stripe
  • Wallet creation (for new customers)
  • Balance funding
The embedded checkout component handles all of this automatically. See the Checkout Integration Guide for implementation details.

Next Steps