Command-line interface for interacting with the Dodo Payments API from your terminal
Manage your Dodo Payments resources, create checkout sessions, and test webhooks directly from the terminal. Built for developers who prefer the command line.
Before using the CLI, authenticate with your API key:
Copy
dodo login
This will:
Open your browser to the Dodo Payments API Keys page
Prompt you to enter your API Key
Ask you to select the environment (Test Mode or Live Mode)
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.
Running dodo with no arguments displays all available categories. Running dodo <category> with no subcommand shows the available subcommands for that category.
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.
Forward webhooks from Dodo Payments directly to your local development server in real time.
Copy
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.
Send mock webhook payloads to any endpoint for quick testing without needing to create real transactions.
Copy
dodo wh trigger
This guides you through:
Setting a destination endpoint URL
Optionally configuring Business ID, Product ID, and Metadata
Selecting a specific event to trigger from an interactive menu
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.