Payments Overview
Subscription billing with Creem and legacy one-time credit compatibility.
Overview
InvoiceToTable uses Creem for payment processing.
Public billing now focuses on recurring subscriptions:
- Pro —
$19.9/month,500credits each month - Ultra —
$29.9/month,800credits each month
Legacy one-time credit packs remain compatible for historical webhooks, ledger entries, and older payment records, but they are no longer a public checkout option.
Subscription Plans
Configured in constants/billing.ts:
| Plan | Price | Credits |
|---|---|---|
| Pro Monthly | $19.9/mo | 500/month |
| Ultra Monthly | $29.9/mo | 800/month |
Payment Flow
- User clicks buy → Frontend calls
/api/payments/creem/checkout - Checkout session created → Creem API returns a payment URL
- User completes payment → Creem sends webhook to
/api/payments/creem/webhook - Webhook processing:
- Signature verification (HMAC-SHA256)
- Idempotency check (prevents duplicate processing)
- Payment record inserted
- Subscription record created/updated
- Credits granted to user
- Confirmation email sent
Legacy One-Time Credit Packs
Legacy one_time_pack records still work in the backend:
- Existing payment and ledger history stays readable
- Older webhooks can still resolve the legacy pack key
- New public pricing pages no longer create one-time checkout sessions
Credit Scheduling
The current public catalog only uses monthly subscription grants.
If you later add annual plans, the built-in scheduling utilities in lib/billing/subscription.ts and /api/cron/subscription-grants are still available.
Testing
Set CREEM_SIMULATE="true" in .env to bypass real payment processing during development.