paytrack docs
Command-line tools
Use the paytrack CLI to inspect records and script supported API workflows from your terminal.
Install
Node.js 18 or later is required. Install the CLI from npm:
npm install -g @paytrack-ng/cli paytrack --help
Or run it once without installing: npx @paytrack-ng/cli --help.
Start with a read-only request
Create a scoped test API key in the developer console and set PAYTRACK_API_KEY in your shell environment. Then inspect your account or customer records.
# PAYTRACK_API_KEY is already set in your environment. paytrack account get --json paytrack customers list --limit 25 --offset 0 --json paytrack reports summary --json
Credentials and configuration
Resolution order is the invocation’s --api-key/--base-url flags, environment variables, then the local config file. For shared shells, prefer environment variables or a secret manager rather than putting raw keys in shell history.
The optional config file is ~/.paytrack/config.json with mode 0600. config show redacts the key. Live write commands print a warning before execution.
paytrack config show # Optional base URL for a development API: paytrack account get --base-url http://127.0.0.1:3000/api/v1 --json
Record an external payment
This write example records a payment you have already received and verified outside Paytrack. It does not charge a customer or transfer money. Replace the sample track ID with an existing record and use one stable idempotency key for retries of the same payment.
paytrack payments record \ --track-id trk_example \ --amount 25000 \ --idempotency-key external-payment-example-1 \ --json
Availability and access
Automation and errors
Use --json for machine-readable successful output. Errors go to stderr and the process exits with code 1. API failures include their code, HTTP status and request ID when available. Use the webhook guide for signed event verification; the CLI can list delivery history but does not retrieve or rotate signing secrets.