Skip to main content
The Atoa CLI is a command-line tool for interacting with the Atoa payment API from your terminal. Create payments, manage customers, test webhooks, and inspect transactions — without leaving the shell, and without writing a script. It’s scriptable for CI/CD, automated test pipelines, support workflows, and one-off operations. Source code: github.com

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

Verify the install:
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:
Your default browser opens the Atoa dashboard, you approve the request, and the CLI is logged in. If your account has multiple businesses, you pick one (or run 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).
No account yet? 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:
A single 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.
SDK keys are per-env and not interchangeable — a sandbox key won’t work against production. Mint one per env with atoa keys create --env <env>.

Per-profile settings

CLI state is stored entirely under profiles. To change which env a profile defaults to, use atoa profile set. To wipe everything, use atoa reset.

Inspect state

Change the default env on a profile

The keys you can set:

Reset everything

atoa reset is destructive — it removes every profile and clears every stored credential for this CLI. Use --revoke only when you also want the server-side keys deactivated (e.g. when offboarding a shared device).

Core workflows

Create a payment

Returns a 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

Every atoa login registers a device session server-side. Audit and revoke them:
Revoking the current device’s session logs this CLI out — you’ll need to atoa login again.

SDK key lifecycle


Team, onboarding & business setup

Staff and roles

KYB (Know Your Business) verification

Bank accounts

Stores

All stores 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.

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 fresh Idempotency-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:
Available on 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’s webhook service dispatches the body to whatever sandbox URL you registered with 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:
  1. On a workstation: atoa login, plus atoa keys create if the job hits SDK/data commands.
  2. Copy ~/.atoa/auth/ to a location the runner can read.
  3. Point the runner at it with ATOA_HOME (credentials live in $ATOA_HOME/.atoa/auth/).
Every command accepts --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.
-d and --data are flags on the generic verbs only (atoa get, atoa post, atoa delete). Typed commands like atoa payments create and atoa customers create accept only their named flags — they do not accept -d key=value or --data @file.json.

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 .exe / .cmd programs, so the bash-style '{"key":"value"}' doesn’t survive intact. Use backslash-escaped double quotes inside the single quotes instead:
If a value contains whitespace (e.g. "Jane Doe"), wrap the whole backslash-escaped JSON in an extra pair of outer double-quotes so Windows doesn’t split at the space:
bash / zsh / git-bash users — the single-quoted plain form (top of section) works directly, no escaping needed.
If a typed command doesn’t expose a flag for the field you need, fall through to the generic verbs below.

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).
These use your active profile’s credentials and respect every common flag (--env, --output, --dryRun, --verbose). Useful for:
  • New endpoints that haven’t gained a typed wrapper yet
  • Debugging--verbose prints 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:
After installing, hit <TAB> mid-command:

Command reference

Most commands accept these common flags (per-command --help is authoritative):

Troubleshooting

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.
Another atoa process is mid-write. If none is running (e.g. one crashed), remove the stale lockfile:
The session file gained group/other read bits — fix with chmod 600 ~/.atoa/auth/session.json.
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.
  1. Re-source your shell config after install (e.g. source ~/.bashrc, or open a new PowerShell window).
  2. Confirm completion is registered:
  3. For PowerShell specifically, make sure you ran | Out-String | Invoke-Expression after atoa completion pwsh — the script must be evaluated, not just printed.

Need Help?

Contact our team at [email protected] or use chat support on the Dashboard.