logo
SaaSkit
Payments

Dodopayments

A powerful and India-friendly payment provider designed for SaaS businesses, offering seamless subscriptions, one-time payments, and local payment support.

Demo

Setup

Add the following environment variables to your .env file:

# Payment (DodoPayments)
DODO_PAYMENTS_API_KEY=
DODO_PAYMENTS_WEBHOOK_SECRET=

Go to the DodoPayments Dashboard → Developers → API Keys in your DodoPayments account.

Make sure you are on the DodoPayments branch in your project. Create an access key with write permissions and paste it into:

DODO_PAYMENTS_API_KEY=

Make sure you are using the Test mode for development. For production, switch to Live mode in DodoPayments and repeat the same process.

Configure the webhook endpoint.

In the DodoPayments Dashboard, go to Developers → Webhooks and add a new endpoint with your URL. For example: https://yourdomain/api/auth/dodopayments/webhooks

For local development, you can generate a temporary public URL using:

ngrok http 3000

Use the generated URL as your webhook endpoint in DodoPayments.

Enable the following webhook events:

  • payment.cancelled
  • payment.failed
  • payment.processing
  • payment.succeeded
  • subscription.active
  • subscription.cancelled
  • subscription.expired
  • subscription.failed
  • subscription.on_hold
  • subscription.plan_changed
  • subscription.renewed
  • subscription.updated

After creating the webhook, copy the Signing Secret and paste it into:

DODO_PAYMENTS_WEBHOOK_SECRET=

Features

  1. SaaSkit allows you to easily sell both onetime and subscription plans with beautifully designed pricing cards.

  2. SaaSkit has built-in trial abuse prevention ensures users can only claim a trial once across all plans.

  3. Users can upgrade or downgrade their subscriptions directly from within the app.

  4. Upgrades & Downgrades are immediate and difference based:

    Users are downgraded / upgraded instantly. They are charged the difference between the two plans for the remainder of the billing period.

    Immediate upgrades or downgrades do not work with Indian cards or UPI due to RBI regulations in India. This is not a limitation of SaaSkit.

  5. You can sell one-time credit packs using one-time plans.

Usage

To create a one-time or subscription plan, simply add the configuration below to your plans.ts file.

export const plans : Plan[] = [
  {
    plan: "onetime plan",
    description: "your plan description",
    planType: "onetime",
    currency: "$",
    variants: [
      {
        productId: "pdt_0NWX9S3z9mumHWoPuBzY9", // dodopayments producId
        amount: 179,
        credit: 1000, // used to grant credits to user
      },
    ],
    features: [
      { name: "feature 1", included: true },
      { name: "feature 2", included: true },
      { name: "feature 3", included: true },
      { name: "feature 4", included: true },
      { name: "feature 5", included: false },
    ],
  },
]

All other attributes (besides the highlighted ones) are used for UI display purposes only.

On this page