Skip to main content
Manage your Dodo Payments resources, create checkout sessions, and test webhooks directly from the terminal. Built for developers who prefer the command line.

Installation

npm install -g dodopayments-cli

Manual Installation

  1. Download the latest release from GitHub Releases for your system
  2. Extract and rename the binary to dodo
  3. Move to a directory in your PATH:
sudo mv ./dodo /usr/local/bin/

Authentication

Before using the CLI, authenticate with your API key:
dodo login
This will:
  1. Open your browser to the Dodo Payments API Keys page
  2. Prompt you to enter your API Key
  3. Ask you to select the environment (Test Mode or Live Mode)
  4. Store your credentials locally to ~/.dodopayments/api-key
The CLI supports storing one API key per environment. If both test and live mode keys are configured, you’ll be prompted to choose which environment to use for the current session.

Usage

The general syntax is:
dodo ‹category› ‹sub-command›
Running dodo with no arguments displays all available categories. Running dodo <category> with no subcommand shows the available subcommands for that category.

Products

Manage your product catalog.
CommandDescription
dodo products listList all products (paginated)
dodo products createOpen dashboard to create a product
dodo products infoView details for a specific product

Payments

View payment transactions.
CommandDescription
dodo payments listList all payments (paginated)
dodo payments infoGet information about a specific payment

Customers

Manage your customer base.
CommandDescription
dodo customers listList all customers (paginated)
dodo customers createCreate a new customer profile
dodo customers updateUpdate an existing customer’s details

Discounts

Manage coupons and discounts.
CommandDescription
dodo discounts listList all discounts (paginated)
dodo discounts createCreate a new percentage-based discount
dodo discounts deleteRemove a discount by ID

Licenses

Manage software licenses.
CommandDescription
dodo licences listList all license keys (paginated)

Addons

Manage product addons.
CommandDescription
dodo addons listList all addons (paginated)
dodo addons createOpen dashboard to create an addon
dodo addons infoView details for a specific addon

Refunds

View refund information.
CommandDescription
dodo refund listList all refunds (paginated)
dodo refund infoView details for a specific refund

Checkout

Create checkout sessions.
CommandDescription
dodo checkout newCreate a new checkout session and get the checkout URL
The checkout command supports advanced options including minimal address collection, return URL, 3D Secure enforcement, discount codes, and metadata.

Webhook Testing

The CLI includes two powerful tools for testing webhooks during development: a listener that forwards live test webhooks to your local server, and a trigger that sends mock webhook payloads to any endpoint.

Listen for Webhooks

Forward webhooks from Dodo Payments directly to your local development server in real time.
dodo wh listen
1

Enter your local endpoint URL

Provide the local URL where you want to receive webhooks (e.g., http://localhost:3000/webhook).
2

Automatic setup

The CLI automatically creates a webhook endpoint on your Dodo Payments account if one doesn’t already exist, then opens a WebSocket connection to receive events in real time.
3

Receive and forward

When a webhook event fires (from a test payment, subscription change, etc.), the CLI receives it, logs the event type, and forwards the full request with headers and body to your local endpoint. The response from your endpoint is logged and sent back.
The webhook listener only works with a test mode API key. Make sure you’re logged in with a test mode key before using dodo wh listen.
The listener preserves the original webhook headers (webhook-id, webhook-signature, webhook-timestamp) when forwarding to your local endpoint, so you can test your signature verification logic.

Trigger Test Webhooks

Send mock webhook payloads to any endpoint for quick testing without needing to create real transactions.
dodo wh trigger
This guides you through:
  1. Setting a destination endpoint URL
  2. Optionally configuring Business ID, Product ID, and Metadata
  3. Selecting a specific event to trigger from an interactive menu
  4. Sending the mock payload and viewing the response
After each event, you can select another event to trigger or exit — making it easy to test multiple event handlers in one session.
The trigger tool sends mock payloads without webhook signatures. Disable webhook signature verification during testing by using unsafe_unwrap() instead of unwrap() in your webhook handler.

Supported Webhook Events

CategoryEvents
Subscriptionsubscription.active, subscription.updated, subscription.on_hold, subscription.renewed, subscription.plan_changed, subscription.cancelled, subscription.failed, subscription.expired
Paymentpayment.success, payment.failed, payment.processing, payment.cancelled
Refundrefund.success, refund.failed
Disputedispute.opened, dispute.expired, dispute.accepted, dispute.cancelled, dispute.challenged, dispute.won, dispute.lost
Licenselicence.created

Environment Variables

VariableDescription
DODO_WH_TEST_SERVER_URLOverride the default webhook relay server URL used by dodo wh listen

Resources

Support