Skip to Content
Docs
pay CLI

Install and log in

Use the Pay.com API from your terminal.

pay operates in the sandbox environment only and rejects live API keys.

Install

Install pay with Homebrew or Scoop, or run it in Docker.

brew install pay-com/tap/pay

Check that it works:

Terminal

pay version

Log in

Make a sandbox key under Developers → API keys, then run:

Terminal

pay login

pay asks for the key without showing it, checks it, and keeps it in your operating system's keychain. There's no flag for the key itself, so it stays out of your shell's history. To remove it, run pay logout.

A key that works but can't read webhook endpoints is kept, with a warning. A key the API refuses isn't kept. When the key can't be checked, for example without a connection, --no-verify keeps it anyway.

In a script, pass the key on standard input:

Terminal

printf '%s' "$PAY_COM_API_KEY" | pay login --api-key-stdin

Permissions

Give the key the permissions of what you'll call with it. For pay listen, that's Write on Webhook endpoints, and Read on the resources whose events you forward.

Use several keys

A profile keeps a key and a workspace of its own:

Terminal

pay login --profile shop --merchant-id "$MERCHANT_ID"
pay charges list --profile shop

Use --merchant-id with multi-workspace API keys. Without --profile, commands use the default profile.

Use it in CI

Commands use PAY_COM_API_KEY when it's set, ahead of any stored key, and store nothing:

Terminal

pay charges list --limit 3

pay login and pay listen keep a secret. Where there's no keychain, set PAY_COM_CLI_KEYRING=file to keep it in a file only your user can read.

Was this page helpful?