This doc lists the manual steps you need to do to go live with ₹199 one-time pricing and paid-tier limits (5 subreddits, 5 posts, no temporary selection).
Apply the new entitlement columns to your users table:
npm run db:migrate
# or: npx supabase migration upThis adds entitlement, dodo_payment_id, and paid_at to users.
- Sign up at app.dodopayments.com.
- In the dashboard, create a one-time product:
- Pricing type: Single Payment
- Price: ₹199
- Currency: INR (so India domestic rate 4% + ₹4 applies)
- Product name / description: e.g. "Reddit Multi Poster – Full access"
- Copy the Product ID (e.g.
pdt_xxxxx).
- In Dodo Dashboard go to Settings (or API / Developers) and create or copy:
- API Key (for creating checkout sessions)
- Webhook Secret (for verifying webhooks)
- For test mode use test keys; for live use live keys.
Add these to your .env (or hosting env) and never commit them:
# Dodo Payments (server-side)
DODO_PAYMENTS_API_KEY=your_api_key_here
DODO_PAYMENTS_WEBHOOK_SECRET=your_webhook_secret_here
DODO_PAYMENTS_PRODUCT_ID=pdt_xxxxx
DODO_PAYMENTS_ENVIRONMENT=test_mode
DODO_PAYMENTS_RETURN_URL=https://yourdomain.com/checkout/success
# Dodo Payments (client-side for inline checkout SDK)
NEXT_PUBLIC_DODO_PAYMENTS_ENVIRONMENT=test_mode- DODO_PAYMENTS_ENVIRONMENT:
test_modefor testing,live_modefor production (server-side API calls). - NEXT_PUBLIC_DODO_PAYMENTS_ENVIRONMENT: Same value as above, but exposed to client for the inline checkout SDK.
- DODO_PAYMENTS_RETURN_URL: Full URL of your success page (e.g.
https://yourdomain.com/checkout/success).
- In Dodo Dashboard go to Settings → Webhooks (or Developers → Webhooks).
- Add webhook / Add endpoint.
- Endpoint URL:
https://yourdomain.com/api/webhooks/dodo - Events: Subscribe to payment events (at least payment.succeeded).
- Copy the Webhook signing secret and set it as
DODO_PAYMENTS_WEBHOOK_SECRET(step 4). - Save. For local testing you’ll need a tunnel (e.g. ngrok) and use that URL as the endpoint.
- Set both
DODO_PAYMENTS_ENVIRONMENT=test_modeandNEXT_PUBLIC_DODO_PAYMENTS_ENVIRONMENT=test_mode. - Use test API key and webhook secret.
- Log in, click Get lifetime access or Get Pro; you'll be navigated to
/checkout. - The inline checkout page shows the Dodo payment form embedded alongside your order summary.
- Complete a test payment (use test card:
4242 4242 4242 4242, any future date, any CVC). - On success, you'll be redirected to
/checkout/success. - Confirm in your app (refresh or re-open) that you are treated as paid (unlimited limits, no upgrade CTA).
- In Dodo Dashboard Webhooks tab, confirm the
payment.succeededevent was delivered and returned 200.
- Create the same product in live mode (₹199 INR) if needed.
- Switch env to
live_modeand set live API key and webhook secret. - Update DODO_PAYMENTS_RETURN_URL to your production URL.
- Register the production webhook URL (
https://yourdomain.com/api/webhooks/dodo) in the live Dodo project and subscribe to payment.succeeded.
If you issue refunds, consider handling the refund webhook and setting the user’s entitlement back to free (and clearing dodo_payment_id / paid_at if you use them). This is not implemented in the current code; add it in pages/api/webhooks/dodo.ts if you need it.
- Run migration
005_add_entitlements.sql - Create Dodo account and ₹199 INR one-time product; copy Product ID
- Set
DODO_PAYMENTS_API_KEY,DODO_PAYMENTS_WEBHOOK_SECRET,DODO_PAYMENTS_PRODUCT_ID,DODO_PAYMENTS_ENVIRONMENT,DODO_PAYMENTS_RETURN_URL - Register webhook URL in Dodo and subscribe to
payment.succeeded - Test with test mode and a test payment
- Switch to live mode and live keys when ready