Skip to main content

Overview

Dodo Payments handles all subscription management, billing, and payment processing for your application. This guide walks you through setting up your account and obtaining the necessary API credentials.

Create Your Dodo Payments Account

1

Sign up for Dodo Payments

Go to Dodo Payments Dashboard and create a new account.Fill in your business details and verify your email address.
2

Get your API key

Once logged in, navigate to SettingsAPI Keys.Copy your API key - this is your DODO_PAYMENTS_API_KEY.
Your API key has full access to your Dodo Payments account. Never expose it in client-side code or commit it to version control.
3

Get your webhook secret

In the same Settings section, navigate to Webhooks.Copy the webhook secret - this is your DODO_WEBHOOK_SECRET.
You’ll use this secret to verify that webhook events are genuinely from Dodo Payments and haven’t been tampered with.
4

Set your environment

Dodo Payments provides two environments:
  • test_mode: For development and testing (no real charges)
  • live_mode: For production (real payments)
For initial setup, use test_mode:
DODO_PAYMENTS_ENVIRONMENT=test_mode

Environment Variables

Add these values to your .env.local file:
# Dodo Payments Configuration
DODO_PAYMENTS_API_KEY=your-dodo-api-key
DODO_WEBHOOK_SECRET=your-webhook-secret
DODO_PAYMENTS_ENVIRONMENT=test_mode

Create Subscription Products

Before your application can offer subscriptions, you need to create products in Dodo Payments.
1

Navigate to Products

In your Dodo Payments dashboard, go to ProductsCreate Product.
2

Configure product details

Fill in the basic product information:
  • Product name: e.g., “Pro Plan”, “Enterprise Plan”
  • Description: Brief description of what the plan includes
  • Price: The recurring subscription price
  • Currency: Select your currency (e.g., USD, EUR)
  • Billing cycle: Choose the interval:
    • Daily
    • Weekly
    • Monthly
    • Yearly
3

Add product features via metadata

The starter kit uses product metadata to dynamically display features in the pricing UI.In the Metadata section, add a JSON object with a features array:
{
  "features": [
    "Unlimited projects",
    "Advanced analytics",
    "Priority support",
    "Custom integrations",
    "99.9% uptime SLA"
  ]
}
These features will automatically appear in your application’s pricing page.
4

Save the product

Click Save to create the product.Repeat this process for each subscription tier you want to offer (e.g., Basic, Pro, Enterprise).

Product Metadata Structure

The application expects product metadata in this format:
{
  "features": [
    "Feature 1",
    "Feature 2",
    "Feature 3"
  ]
}
The features array is required for the pricing page to display correctly. Without it, the product will still work but won’t show any features in the UI.

Test vs Live Mode

Test Mode

  • Use for development and testing
  • No real payment processing
  • Use test card numbers (provided by Dodo Payments documentation)
  • All data is isolated from production

Live Mode

Before switching to live mode, ensure:
  • Your webhook endpoint is properly secured and deployed
  • You’ve thoroughly tested all payment flows in test mode
  • Your business information is complete in Dodo Payments settings
  • You’ve reviewed and understood Dodo Payments’ pricing and fees
To switch to live mode, update your environment variable:
DODO_PAYMENTS_ENVIRONMENT=live_mode

Next Steps

Database Setup

Configure your database schema with Drizzle

Webhooks

Deploy webhook handlers to process payment events

Build docs developers (and LLMs) love