Log in with your browser
atoa login opens the dashboard, you approve, done. No token to copy-paste.Test webhooks locally
atoa webhooks trigger PAYMENTS_STATUS fires a fake event at your sandbox URL — no real payment needed.Two credential types
Your browser login runs account commands; an SDK key runs payments/data commands.
Shell completion
TAB-completes commands, flags, profile names, and key IDs across bash, zsh, and PowerShell.
Prerequisites
- Node.js 20 or later — verify with
node --version - An Atoa merchant account and a desktop browser on the same machine (login is browser-based). No account yet? Run
atoa signup, or see the Getting Started guide.
Installation
- npm
- yarn
- pnpm
The CLI stores credentials locally under
~/.atoa/auth/, readable only by
your user account.First-time setup
Pair the CLI with your Atoa account through your browser:atoa business use <id> afterwards). A profile is created, named after your business.
atoa login requires an interactive terminal (TTY) and a desktop browser
on the same machine — there is no headless/CI login path (see
CI / automation).atoa signup walks you through account creation (email + one-time code) and business onboarding — no prior login needed.
Confirm you’re logged in
The dual-credential model
The CLI holds two independent credential types per profile:atoa login always creates the login session. The SDK key is optional — add it whenever you need the payments/data commands:
atoa keys create requires an admin role on the business. The apiSecret is stored locally under ~/.atoa/auth/, so the CLI picks it up automatically on later commands.
Which login does each command need?
Environments and profiles
A single machine can hold credentials for many businesses (profiles) and both environments (sandbox + production). The CLI keeps them separate so you can’t accidentally run a production refund while testing locally.Per-profile settings
CLI state is stored entirely under profiles. To change which env a profile defaults to, useatoa profile set. To wipe everything, use atoa reset.
Inspect state
Change the default env on a profile
Reset everything
Core workflows
Create a payment
paymentRequestId, the customer-facing paymentLink, and a qrCodeUrl.
Check payment status (poll until terminal)
--poll keeps polling every 5 seconds until the status is no longer PENDING, up to 3 minutes.
List recent transactions
Refund a payment
Manage customers and saved cards
Account management
These run on your browser login — no SDK key needed.Switch the active business
If your account owns several businesses, account commands operate on one at a time:Manage login sessions
Everyatoa login registers a device session server-side. Audit and revoke them:
SDK key lifecycle
Team, onboarding & business setup
Staff and roles
KYB (Know Your Business) verification
Bank accounts
Stores
Allstores subcommands need a browser login:
Onboard a brand-new account
atoa signup is the one command that needs no prior login — it creates
the account and logs you in as part of the flow.Payment links
Create a hosted checkout link (browser login;--store-id is required):
--amount is in GBP (e.g. 10.50 for £10.50), not pence.Idempotency — duplicate-charge protection
The CLI auto-generates a freshIdempotency-Key: <uuidv4> header on every POST/PUT/PATCH, so a network blip on the response never double-charges a customer. You don’t need to think about this for interactive use.
For CI / scripted retries — where one logical operation may run more than once (a job restarts) — pass a stable --idempotencyKey so a re-run produces the same key and the server deduplicates:
atoa payments create, atoa refunds create, atoa card-on-file charge, and the generic atoa post. Every other POST still sends an auto-generated key, so all retries are safe by default.
Trigger test webhook events
The CLI can fire a synthetic webhook payload at your registered sandbox URL — same shape as production — without you actually creating a real payment.atoa webhooks create. Inspect the request on your endpoint (e.g. webhook.site) to verify your signature-check, routing logic, and response shape work end-to-end.
Supported events
Customising the dispatched body
Test triggers are sandbox-only by design. If you pass
--env production,
the CLI warns you and proceeds with your active profile’s sandbox key
anyway — this prevents accidentally driving fake events at your live customers.Using the CLI in CI
atoa login needs an interactive browser, so a CI runner cannot log in itself. Instead, provision credentials on a workstation once, then hand the files to the runner:
- On a workstation:
atoa login, plusatoa keys createif the job hits SDK/data commands. - Copy
~/.atoa/auth/to a location the runner can read. - Point the runner at it with
ATOA_HOME(credentials live in$ATOA_HOME/.atoa/auth/).
--output json (the default) for machine-readable output and --dryRun to resolve the request without sending it. --yes is required on destructive commands in a non-TTY context.
Exit codes
The CLI uses POSIX-style exit codes so pipelines can branch on the failure mode:Environment variables
Generic HTTP verbs
When you need to hit an endpoint the CLI doesn’t yet wrap (or you want full control over the request body), use the raw verbs:How -d and --data work
These are two different ways to build the request body. Pick whichever fits the call:
So
atoa post /api/webhook/merchant --data @webhook.json reads webhook.json from the directory you ran the command in, takes its contents as the JSON request body, and POSTs it to /api/webhook/merchant. Example file:
-d and --data are mutually meaningful — they both contribute to the same
body. If you pass both, --data wins and -d fields are ignored. Use one or
the other per command.Passing nested objects and arrays
Some API fields aren’t a single string or number — they’re objects (e.g.authentication, consumerDetails) or arrays (e.g. paymentMethod, storeIds). How you pass these depends on which kind of command you’re using.
On typed commands (e.g. atoa payments create)
Use the command’s own named flags. Quote complex values so the shell passes them to the CLI intact:
PowerShell users: Windows re-parses arguments when handing them to
native If a value contains whitespace (e.g. bash / zsh / git-bash users — the single-quoted plain form (top of
section) works directly, no escaping needed.
.exe / .cmd programs, so the bash-style '{"key":"value"}'
doesn’t survive intact. Use backslash-escaped double quotes inside the
single quotes instead:"Jane Doe"), wrap the whole
backslash-escaped JSON in an extra pair of outer double-quotes so Windows
doesn’t split at the space:On generic verbs (e.g. atoa post /api/...)
The generic verbs accept any JSON body. Three ways to specify it:
Wrap JSON values in single quotes so
{, ", and spaces pass through
untouched.PowerShell: same rule, but escape any inner single quote by
doubling it ('It''s urgent' → It's urgent).--env, --output, --dryRun, --verbose). Useful for:
- New endpoints that haven’t gained a typed wrapper yet
- Debugging —
--verboseprints the redacted request line so you can see exactly what was sent - CI scripts where you want explicit control over the exact body sent
Shell completion
Enable TAB-completion of commands, flags, profile names, and IDs:- bash
- zsh
- PowerShell
<TAB> mid-command:
Command reference
Authentication & account setup
Authentication & account setup
Business, sessions & SDK keys
Business, sessions & SDK keys
Team, KYB & bank accounts
Team, KYB & bank accounts
Payment links
Payment links
Profiles
Profiles
Payments
Payments
Customers, Cards & Card-on-File
Customers, Cards & Card-on-File
Refunds
Refunds
Webhooks
Webhooks
Bank Feed (Open Banking)
Bank Feed (Open Banking)
Payouts
Payouts
Utilities
Utilities
--help is authoritative):
Troubleshooting
401 or 'No profile is configured' on every command
401 or 'No profile is configured' on every command
First-run state, or your session expired / was revoked (e.g. a later login
on the same device evicted it). Check who you are, then re-pair:If an account command complains you only have an SDK key (or vice versa),
obtain the missing credential —
atoa login for a login session,
atoa keys create for an SDK key. See the dual-credential
model.'Timed out acquiring lock on …/session.json.lock'
'Timed out acquiring lock on …/session.json.lock'
Another
atoa process is mid-write. If none is running (e.g. one crashed),
remove the stale lockfile:'Refusing to read …/session.json: insecure permissions' (POSIX)
'Refusing to read …/session.json: insecure permissions' (POSIX)
The session file gained group/other read bits — fix with
chmod 600 ~/.atoa/auth/session.json.`atoa webhooks trigger` says 'No webhook subscription configured'
`atoa webhooks trigger` says 'No webhook subscription configured'
You need to register a sandbox webhook URL first:The trigger uses the URL registered for the same event type under your active profile’s sandbox.
TAB completion doesn't work
TAB completion doesn't work
-
Re-source your shell config after install (e.g.
source ~/.bashrc, or open a new PowerShell window). -
Confirm completion is registered:
-
For PowerShell specifically, make sure you ran
| Out-String | Invoke-Expressionafteratoa completion pwsh— the script must be evaluated, not just printed.
Want to nuke everything and start fresh
Want to nuke everything and start fresh
Need Help?
Contact our team at[email protected] or use chat support on the Dashboard.