Building with an AI agent? See the Agents billing guide for how to set up customer billing programmatically.
Prerequisites: Complete the Track Usage Quickstart first.
Create a Plan
Go to Monetize > Plans and click New Plan. Configure:
- Name: e.g. “Pro Plan” (customers see this)
- Monthly Amount: e.g.
$25.00 - Rollover: Whether unused balance carries over
sc_xxxxx) — you’ll need it for checkout.Embed Checkout (Frontend)
Use the
useLavaCheckout hook to open the checkout modal. It handles phone verification, payment setup, and subscription creation in one flow.Make Billed Requests
After checkout, use the customer ID to make requests that bill the customer:Balance checks and usage billing will apply to your customer automatically.
- SDK
- Forward Token
Check the Dashboard
Go to Monetize > Customers to see your customer’s billing details, balance, and usage. Go to Analytics > Requests to see individual requests with cost breakdowns.
What’s Next?
Meters
Configure usage-based pricing rules for your meters
Checkout Guide
Advanced checkout: credit bundles, completion handling, and more
Webhooks
Receive notifications for customer and balance events
Forward Proxy
Token generation, multi-provider routing, and error handling
Troubleshooting
Checkout component not displaying
Checkout component not displaying
Verify
@lavapayments/checkout is installed, the session token hasn’t expired (60-minute limit), and the component is in a client component ('use client').401 on forward token
401 on forward token
Decode the token to inspect contents:
echo "token" | base64 -d. Verify the secret key, customer ID, and meter slug are all valid and active in the dashboard.