Skip to main content
The CLI is the fastest way to build and test your webhook handler. It only works in test mode, so it can never touch real money.

Install

You need Node.js 18 or later.

Log in

Your browser opens on the Modem Pay dashboard with a short code. Check it matches the code in your terminal, choose the account to test with, and click Approve.
  • Works however you sign in to the dashboard: Google, password or two-factor. You never type a password into the terminal.
  • On a server with no browser, run modempay login --no-browser and open the link on any device.
  • The login lasts 30 days. It’s saved in ~/.modempay-cli-config.json, which only your user can read.
What the CLI can do with your account. When you approve, the CLI gets its own test-mode API key that can only create and read payments, and expires after 30 days. Logging in again replaces it. The CLI’s session can only manage test webhooks. It can’t see live data, send payouts or change settings.
Only approve a code you started yourself, just now, in your own terminal. Never approve a code someone sent you. If the dashboard warns that the request came from a different network, click Deny unless you know why.

Switch accounts

If your business has more than one account (for example a GMD and a USD account), choose which one to test with:
Team members limited to one account always get that account.

Receive webhooks on your machine

The CLI opens a public URL and forwards every test-mode webhook to your local server. The body and the x-modem-signature header arrive unchanged, so your signature check works exactly as it will in production.
Use the signing secret the CLI shows to verify events while listen is running.
While listen runs, your account’s test webhook URL and signing secret are replaced by the CLI’s. When you stop, set your test webhook back in the dashboard if you use one. Your live webhook is never touched.

Send sample events

Events go to your current test webhook: the CLI’s while listen runs, or your dashboard one. You can trigger: charge.created, charge.succeeded, charge.failed, charge.cancelled, payment_intent.created, payment_intent.cancelled, customer.created, customer.updated and customer.deleted.

Create test payments

init prints a checkout link you can open and pay in test mode. Add --json to either command to see the raw API response.

A typical session

Settings

Something not working? Run modempay status first. If it says your login expired, run modempay login again.