# Paysio CLI

Everything the [Paysio](https://paysio.com) dashboard does, from your terminal - by hand or by an AI agent.

```bash
npm install -g paysio
paysio login
```

## Quick start

```bash
paysio login                 # opens your browser to authorize this terminal
paysio use my-workspace      # pick the workspace to work in
paysio balance               # you are in TEST mode by default
```

Create something and sell it:

```bash
paysio products create --name "Coaching call" --price 149
paysio payment-links create --name "Coaching call" --product <productId>
# -> https://paysio.com/pay/coaching-call
```

## Test vs live

Every workspace has a **test** and a **live** mode. New logins start in test.

```bash
paysio mode            # show the current mode
paysio mode live       # switch
paysio transactions list --test   # or override for a single command
```

Commands that move real money refuse to run in live mode unless you confirm:
interactively you retype the amount, non-interactively you pass `--confirm`.

```bash
paysio transactions refund txn_123 --amount 25.00 --confirm
```

## The webhook dev loop

```bash
paysio listen --forward-to localhost:3000/webhooks   # prints a signing secret
paysio trigger payment.completed                     # real sandbox activity
```

`listen` streams events as they happen and forwards them to your local server with a
real `Paysio-Signature`, so your handler verifies exactly like production. It works
even with no webhook endpoints configured.

## Apply for Paysio Debit & Payouts

The production application, without the form:

```bash
paysio apply debit-payouts               # 6-step guided wizard
paysio apply debit-payouts --template    # or a JSON skeleton for scripts and agents
paysio apply debit-payouts --file app.json --dry-run   # field-level validation
paysio apply status
```

## Built for AI agents

```bash
paysio mcp add claude-code   # register the Paysio MCP server
paysio skills add            # install the Paysio skill for Claude Code
paysio agent-context --json  # one-call briefing: workspace, mode, balance, activity
paysio --llms                # machine-readable manifest of every command
```

Every command accepts `--json`, which emits machine-readable output, disables colour and
never prompts. Exit codes: `0` ok, `1` API/validation error, `2` usage error,
`3` auth, `4` confirmation required.

Amount **flags** are dollars (`--amount 25.50`); amounts in JSON payloads and output are
always **integer cents**.

## What it covers

Products, payment links, customers, subscriptions, invoices, discounts, transactions
(refund/void/cancel), disputes (evidence, AI drafts, submission), balances, payouts,
payout links and requests, API keys, webhooks, team members, custom domains, Apple Pay
domains, blocklist, pixels, checkout settings, branding, billing, imports and exports.

```bash
paysio --help
paysio <group> --help
```

## Security

- Login is a browser handoff; the session is revocable from Settings > API keys.
- The token lives in `~/.paysio/credentials.json` with owner-only permissions and is never printed.
- **The CLI never accepts card numbers.** Keyed payments stay in the dashboard, which keeps
  your terminal out of PCI scope.
- Secrets (SSN, bank numbers) are entered through masked prompts, never as flags that
  would land in your shell history.
- No telemetry.

## Configuration

| Variable | Purpose |
|---|---|
| `PAYSIO_API_BASE` | Point the CLI at another environment (default `https://api.paysio.com`) |
| `PAYSIO_WEB_BASE` | Override where dashboard and pay links point (derived from the API base by default) |
| `PAYSIO_API_KEY` | Use an API key instead of a session (public v1 API only) |
| `PAYSIO_NO_UPDATE_CHECK` | Silence the update check |

A `paysio.json` in your project pins the workspace and mode for everyone working in it:

```json
{ "workspace": "my-workspace", "mode": "test" }
```

## Docs

https://paysio.com/docs/cli
