> ## Documentation Index
> Fetch the complete documentation index at: https://docs.horizonpay.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Command reference

> Every invoice-ai command, flag and example, generated from the CLI's own --help output.

Every command accepts the global options shown under `invoice-ai` below (`--json`, `--profile`, `--api-key`, `--yes`, …).

## invoice-ai

```text theme={null}
Usage: invoice-ai [options] [command]

Invoice-AI from your terminal. Log in once, then manage customers, products,
prices, invoices, invoice items and webhooks.

Options:
  -v, --version                  print the CLI version
  --api-key <key>                API key to use (overrides INVOICE_AI_API_KEY
                                 and the saved profile)
  -p, --profile <name>           saved profile to use (see `invoice-ai switch`)
  --json                         print raw JSON (default when output is piped)
  --format <format>              output format (choices: "table", "json", "csv")
  -y, --yes                      skip confirmation prompts
  --debug                        log each API request and retry (secrets
                                 redacted)
  --no-color                     disable colors (also honours NO_COLOR)
  -h, --help                     show help

Commands:
  login [options]                Log in with your browser (or store a key passed
                                 with --api-key)
  logout                         Revoke this profile’s key on the server and
                                 forget it locally
  whoami                         Show the account, key and profile in use
  switch [profile]               Make another logged-in profile the default
                                 (lists profiles without an argument)
  customers                      Manage customers (the people and companies you
                                 bill)
  products                       Manage products in your catalog
  prices                         Manage prices (what a product costs, per
                                 currency)
  invoices                       Create, send and manage invoices
  invoice-items                  Add, inspect and remove the lines of a draft
                                 invoice
  webhooks                       Manage webhook endpoints and test your receiver
  api [options] <method> <path>  Call any API endpoint directly and print the
                                 JSON response
  open [page] [id]               Open the web app: dashboard, invoices,
                                 customers, products, settings, api-keys,
                                 webhooks, or "invoice <id>"
  docs [topic]                   Open the documentation (home, quickstart, auth,
                                 errors, idempotency, pagination, rate-limits,
                                 ids, lifecycle, webhooks, api, cli, changelog)
  completion <shell>             Print a shell completion script (bash, zsh or
                                 fish)

Examples:
  $ invoice-ai login
  $ invoice-ai invoices create
  $ invoice-ai invoices list --status open
  $ invoice-ai customers create --name "Acme" --email ap@acme.com
  $ invoice-ai api GET /business

Environment:
  INVOICE_AI_API_KEY      API key (for CI); beats the saved profile
  INVOICE_AI_PROFILE      profile to use when --profile isn't given
  INVOICE_AI_BASE_URL     API base URL, e.g. http://localhost:3000/api/v1
  INVOICE_AI_NO_KEYCHAIN  keep keys in the config file, not the OS keychain
  NO_COLOR                disable colors

Exit codes: 0 ok · 1 API error · 2 usage error · 3 auth · 4 rate limited
```

## invoice-ai login

```text theme={null}
Usage: invoice-ai login [options]

Log in with your browser (or store a key passed with --api-key)

Options:
  --no-browser          print the login URL instead of opening a browser
  -h, --help            show help


Opens the Invoice-AI authorize page, where you approve this device. A new API key
is created for it and saved in your OS keychain (or ~/.config/invoice-ai/config.json,
mode 0600, when no keychain is available).

Examples:
  $ invoice-ai login
  $ invoice-ai login --profile staging
  $ invoice-ai login --api-key inv_live_…        # no browser; verifies and stores the key
```

## invoice-ai logout

```text theme={null}
Usage: invoice-ai logout [options]

Revoke this profile’s key on the server and forget it locally

Options:
  -h, --help            show help
```

## invoice-ai whoami

```text theme={null}
Usage: invoice-ai whoami [options]

Show the account, key and profile in use

Options:
  -h, --help            show help
```

## invoice-ai switch

```text theme={null}
Usage: invoice-ai switch [options] [profile]

Make another logged-in profile the default (lists profiles without an argument)

Options:
  -h, --help            show help
```

## invoice-ai customers

```text theme={null}
Usage: invoice-ai customers [options] [command]

Manage customers (the people and companies you bill)

Options:
  -h, --help             show help


Commands:
  list [options]         List customers, newest first
  get <id>               Show one customer
  create [options]       Create a customer
  update [options] <id>  Update a customer (only the fields you pass change)
  archive|delete <id>    Archive a customer (issued invoices keep referencing
                         it)
```

## invoice-ai customers list

```text theme={null}
Usage: invoice-ai customers list [options]

List customers, newest first

Options:
  -q, --query <text>    search name and email
  --include-deleted     include archived customers
  --limit <n>           results per page (1-100)
  --cursor <cursor>     start after this cursor (from a previous page)
  --all                 fetch every page, not just the first
  -h, --help            show help
```

## invoice-ai customers get

```text theme={null}
Usage: invoice-ai customers get [options] <id>

Show one customer

Options:
  -h, --help            show help
```

## invoice-ai customers create

```text theme={null}
Usage: invoice-ai customers create [options]

Create a customer

Options:
  --name <name>         customer name
  --email <email>       billing email (invoices are sent here)
  --phone <phone>       phone number
  --tax-id <id>         tax id, e.g. a GSTIN or VAT number
  -d, --data <json>     request body as JSON, @file.json or @- for stdin (flags
                        override its fields)
  -h, --help            show help
```

## invoice-ai customers update

```text theme={null}
Usage: invoice-ai customers update [options] <id>

Update a customer (only the fields you pass change)

Options:
  --name <name>         customer name
  --email <email>       billing email (invoices are sent here)
  --phone <phone>       phone number
  --tax-id <id>         tax id, e.g. a GSTIN or VAT number
  -d, --data <json>     request body as JSON, @file.json or @- for stdin (flags
                        override its fields)
  -h, --help            show help
```

## invoice-ai customers archive

```text theme={null}
Usage: invoice-ai customers archive|delete [options] <id>

Archive a customer (issued invoices keep referencing it)

Options:
  -h, --help            show help
```

## invoice-ai products

```text theme={null}
Usage: invoice-ai products [options] [command]

Manage products in your catalog

Options:
  -h, --help             show help


Commands:
  list [options]         List products
  get <id>               Show one product
  create [options]       Create a product (then add a price with `prices
                         create`)
  update [options] <id>  Update a product (only the fields you pass change)
  archive <id>           Archive a product (existing invoices are unaffected)
```

## invoice-ai products list

```text theme={null}
Usage: invoice-ai products list [options]

List products

Options:
  -q, --query <text>    search by name
  --active <bool>       only active (true) or archived (false) products
  --limit <n>           results per page (1-100)
  --cursor <cursor>     start after this cursor (from a previous page)
  --all                 fetch every page, not just the first
  -h, --help            show help
```

## invoice-ai products get

```text theme={null}
Usage: invoice-ai products get [options] <id>

Show one product

Options:
  -h, --help            show help
```

## invoice-ai products create

```text theme={null}
Usage: invoice-ai products create [options]

Create a product (then add a price with `prices create`)

Options:
  --name <name>         product name, shown on invoice lines
  --description <text>  longer description
  --active <bool>       whether it can be added to new invoices (true/false)
  -d, --data <json>     request body as JSON, @file.json or @- for stdin (flags
                        override its fields)
  -h, --help            show help
```

## invoice-ai products update

```text theme={null}
Usage: invoice-ai products update [options] <id>

Update a product (only the fields you pass change)

Options:
  --name <name>         product name, shown on invoice lines
  --description <text>  longer description
  --active <bool>       whether it can be added to new invoices (true/false)
  -d, --data <json>     request body as JSON, @file.json or @- for stdin (flags
                        override its fields)
  -h, --help            show help
```

## invoice-ai products archive

```text theme={null}
Usage: invoice-ai products archive [options] <id>

Archive a product (existing invoices are unaffected)

Options:
  -h, --help            show help
```

## invoice-ai prices

```text theme={null}
Usage: invoice-ai prices [options] [command]

Manage prices (what a product costs, per currency)

Options:
  -h, --help             show help


Commands:
  list [options]         List prices
  get <id>               Show one price
  create [options]       Create a price for a product
  update [options] <id>  Update a price (nickname, default tax rate)
  archive <id>           Archive a price (it can no longer be added to invoices)
```

## invoice-ai prices list

```text theme={null}
Usage: invoice-ai prices list [options]

List prices

Options:
  --product <id>        only prices of this product
  --currency <code>     only this currency, e.g. USD
  --type <type>         one_time or recurring
  --active <bool>       only active (true) or archived (false) prices
  --limit <n>           results per page (1-100)
  --cursor <cursor>     start after this cursor (from a previous page)
  --all                 fetch every page, not just the first
  -h, --help            show help
```

## invoice-ai prices get

```text theme={null}
Usage: invoice-ai prices get [options] <id>

Show one price

Options:
  -h, --help            show help
```

## invoice-ai prices create

```text theme={null}
Usage: invoice-ai prices create [options]

Create a price for a product

Options:
  --product <id>         the product this price belongs to
  --amount <decimal>     amount in major units, e.g. 25.00 (converted using the
                         currency)
  --unit-amount <minor>  amount in minor units, e.g. 2500 for $25.00
  --currency <code>      ISO 4217 code, e.g. USD
  --nickname <text>      label shown in the dashboard
  --interval <interval>  makes it recurring: day, week, month or year
  --interval-count <n>   intervals between bills (default 1)
  --tax-rate <percent>   default tax percentage for lines billed from this price
  -d, --data <json>      request body as JSON, @file.json or @- for stdin (flags
                         override its fields)
  -h, --help             show help


Example:
  $ invoice-ai prices create --product prod_123 --amount 25.00 --currency USD
```

## invoice-ai prices update

```text theme={null}
Usage: invoice-ai prices update [options] <id>

Update a price (nickname, default tax rate)

Options:
  --nickname <text>     label shown in the dashboard ("" clears it)
  --tax-rate <percent>  default tax percentage for new lines billed from this
                        price
  -d, --data <json>     request body as JSON, @file.json or @- for stdin (flags
                        override its fields)
  -h, --help            show help


Amount, currency and interval changes go through --data. The product can't change;
create a new price instead.

Example:
  $ invoice-ai prices update price_123 --nickname "Annual" --tax-rate 18
```

## invoice-ai prices archive

```text theme={null}
Usage: invoice-ai prices archive [options] <id>

Archive a price (it can no longer be added to invoices)

Options:
  -h, --help            show help
```

## invoice-ai invoices

```text theme={null}
Usage: invoice-ai invoices [options] [command]

Create, send and manage invoices

Options:
  -h, --help             show help


Commands:
  list [options]         List invoices, newest first
  get <id>               Show one invoice with its totals
  create [options]       Create an invoice: a guided wizard with no flags, or
                         scripted with flags
  update [options] <id>  Update a draft invoice (only the fields you pass
                         change)
  delete <id>            Delete a draft invoice (finalized invoices can only be
                         voided)
  finalize <id>          Finalize a draft: assigns the number and locks the
                         lines
  send [options] <id>    Email the invoice to the customer (finalizes a draft
                         first)
  pay [options] <id>     Record a payment received outside Invoice-AI (marks it
                         paid)
  void [options] <id>    Void a finalized invoice (it stays on record, marked
                         void)
  pdf [options] <id>     Download the invoice PDF
  events [options] <id>  Show an invoice's history (created, emailed, viewed,
                         paid…)
```

## invoice-ai invoices list

```text theme={null}
Usage: invoice-ai invoices list [options]

List invoices, newest first

Options:
  --status <status>     only this status: draft, open, paid, overdue, void
  --customer <id>       only invoices billed to this customer
  --from <YYYY-MM-DD>   issued on or after this date
  --to <YYYY-MM-DD>     issued on or before this date
  --limit <n>           results per page (1-100)
  --cursor <cursor>     start after this cursor (from a previous page)
  --all                 fetch every page, not just the first
  -h, --help            show help
```

## invoice-ai invoices get

```text theme={null}
Usage: invoice-ai invoices get [options] <id>

Show one invoice with its totals

Options:
  -h, --help            show help
```

## invoice-ai invoices create

```text theme={null}
Usage: invoice-ai invoices create [options]

Create an invoice: a guided wizard with no flags, or scripted with flags

Options:
  --finalize                    finalize it right away (assigns a number, locks
                                the lines)
  --send                        finalize and email it to the customer
  --no-interactive              never start the wizard
  --customer <id>               customer to bill (cus_…)
  --price <id>                  add a line from this price (repeatable)
  --qty <n>                     quantity for the --price in the same position
                                (repeatable, default 1)
  --currency <code>             invoice currency (defaults to your business
                                currency)
  --due-date <YYYY-MM-DD>       due date
  --days-until-due <n>          due this many days after finalizing
  --description <text>          memo shown on the invoice
  --footer <text>               footer text
  --collection-method <method>  send_invoice (default) or charge_automatically
  -d, --data <json>             request body as JSON, @file.json or @- for stdin
                                (flags override its fields)
  -h, --help                    show help


Examples:
  $ invoice-ai invoices create                      # guided wizard
  $ invoice-ai invoices create --customer cus_123 --price price_abc --qty 2 --send
```

## invoice-ai invoices update

```text theme={null}
Usage: invoice-ai invoices update [options] <id>

Update a draft invoice (only the fields you pass change)

Options:
  --customer <id>               customer to bill (cus_…)
  --price <id>                  add a line from this price (repeatable)
  --qty <n>                     quantity for the --price in the same position
                                (repeatable, default 1)
  --currency <code>             invoice currency (defaults to your business
                                currency)
  --due-date <YYYY-MM-DD>       due date
  --days-until-due <n>          due this many days after finalizing
  --description <text>          memo shown on the invoice
  --footer <text>               footer text
  --collection-method <method>  send_invoice (default) or charge_automatically
  -d, --data <json>             request body as JSON, @file.json or @- for stdin
                                (flags override its fields)
  -h, --help                    show help
```

## invoice-ai invoices delete

```text theme={null}
Usage: invoice-ai invoices delete [options] <id>

Delete a draft invoice (finalized invoices can only be voided)

Options:
  -h, --help            show help
```

## invoice-ai invoices finalize

```text theme={null}
Usage: invoice-ai invoices finalize [options] <id>

Finalize a draft: assigns the number and locks the lines

Options:
  -h, --help            show help
```

## invoice-ai invoices send

```text theme={null}
Usage: invoice-ai invoices send [options] <id>

Email the invoice to the customer (finalizes a draft first)

Options:
  --to <email>          send to this address instead of the customer's email
  -h, --help            show help
```

## invoice-ai invoices pay

```text theme={null}
Usage: invoice-ai invoices pay [options] <id>

Record a payment received outside Invoice-AI (marks it paid)

Options:
  --paid-on <date>      when the payment arrived (default: now)
  --reference <ref>     your payment reference, e.g. a cheque number
  -h, --help            show help
```

## invoice-ai invoices void

```text theme={null}
Usage: invoice-ai invoices void [options] <id>

Void a finalized invoice (it stays on record, marked void)

Options:
  --reason <text>       why it is being voided (kept on the invoice)
  -h, --help            show help
```

## invoice-ai invoices pdf

```text theme={null}
Usage: invoice-ai invoices pdf [options] <id>

Download the invoice PDF

Options:
  -o, --out <file>      where to save it (default: <id>.pdf; "-" writes to
                        stdout)
  --open                open the PDF once saved
  -h, --help            show help
```

## invoice-ai invoices events

```text theme={null}
Usage: invoice-ai invoices events [options] <id>

Show an invoice's history (created, emailed, viewed, paid…)

Options:
  --limit <n>           results per page (1-100)
  --cursor <cursor>     start after this cursor (from a previous page)
  --all                 fetch every page, not just the first
  -h, --help            show help
```

## invoice-ai invoice-items

```text theme={null}
Usage: invoice-ai invoice-items [options] [command]

Add, inspect and remove the lines of a draft invoice

Options:
  -h, --help             show help


Commands:
  list [options]         List an invoice's lines, in order
  get <id>               Show one line (ii_…)
  create [options]       Add a line to a draft: from a --price, or ad hoc with
                         --description and an amount
  delete [options] <id>  Remove a line from a draft (a draft keeps at least one
                         line)
```

## invoice-ai invoice-items list

```text theme={null}
Usage: invoice-ai invoice-items list [options]

List an invoice's lines, in order

Options:
  --invoice <id>        the invoice (in_…), required
  -h, --help            show help
```

## invoice-ai invoice-items get

```text theme={null}
Usage: invoice-ai invoice-items get [options] <id>

Show one line (ii_…)

Options:
  -h, --help            show help
```

## invoice-ai invoice-items create

```text theme={null}
Usage: invoice-ai invoice-items create [options]

Add a line to a draft: from a --price, or ad hoc with --description and an
amount

Options:
  --invoice <id>         the draft to add to (in_…), required
  --price <id>           bill from this catalog price (fills description, amount
                         and tax rate)
  --description <text>   what you are billing for (required without --price)
  --qty <n>              quantity, may be fractional (default 1)
  --unit <unit>          unit of measure (default NOS) (choices: "NOS", "PCS",
                         "KGS", "GMS", "LTR", "MTR", "SQF", "SQM", "HRS", "DAY",
                         "MON", "BOX", "SET", "OTH")
  --amount <decimal>     unit amount in major units, e.g. 25.00 (uses the
                         invoice currency)
  --unit-amount <minor>  unit amount in minor units, e.g. 2500 for $25.00
  --currency <code>      currency for --amount (defaults to the invoice
                         currency)
  --discount <percent>   discount percentage applied before tax
  --tax-rate <percent>   tax percentage added on top (defaults to the price
                         rate, or 0)
  -d, --data <json>      request body as JSON, @file.json or @- for stdin (flags
                         override its fields)
  -h, --help             show help


Examples:
  $ invoice-ai invoice-items create --invoice in_123 --price price_abc --qty 3
  $ invoice-ai invoice-items create --invoice in_123 --description "Rush fee" --amount 50
```

## invoice-ai invoice-items delete

```text theme={null}
Usage: invoice-ai invoice-items delete [options] <id>

Remove a line from a draft (a draft keeps at least one line)

Options:
  --invoice <id>        the invoice the line belongs to (speeds up the lookup)
  -h, --help            show help
```

## invoice-ai webhooks

```text theme={null}
Usage: invoice-ai webhooks [options] [command]

Manage webhook endpoints and test your receiver

Options:
  -h, --help            show help


Commands:
  list [options]        List webhook endpoints
  create [options]      Register an https endpoint (prints the signing secret
                        once)
  delete <id>           Delete a webhook endpoint (deliveries stop immediately)
  test [options] <url>  Send a correctly signed sample event to your receiver
                        (no API key needed)
```

## invoice-ai webhooks list

```text theme={null}
Usage: invoice-ai webhooks list [options]

List webhook endpoints

Options:
  --limit <n>           results per page (1-100)
  --cursor <cursor>     start after this cursor (from a previous page)
  --all                 fetch every page, not just the first
  -h, --help            show help
```

## invoice-ai webhooks create

```text theme={null}
Usage: invoice-ai webhooks create [options]

Register an https endpoint (prints the signing secret once)

Options:
  --url <url>           https URL that will receive events
  --events <types>      comma-separated event types (default: all).
                        invoice.created, invoice.updated, invoice.finalized,
                        invoice.emailed, invoice.email_failed, invoice.viewed,
                        invoice.downloaded, invoice.paid, invoice.voided
  -h, --help            show help
```

## invoice-ai webhooks delete

```text theme={null}
Usage: invoice-ai webhooks delete [options] <id>

Delete a webhook endpoint (deliveries stop immediately)

Options:
  -h, --help            show help
```

## invoice-ai webhooks test

```text theme={null}
Usage: invoice-ai webhooks test [options] <url>

Send a correctly signed sample event to your receiver (no API key needed)

Options:
  --secret <whsec>      the endpoint's signing secret (whsec_…)
  --event <type>        event type to send (default: "invoice.paid")
  -h, --help            show help


Signs the body exactly like a real delivery (Standard Webhooks: webhook-id,
webhook-timestamp, webhook-signature), so your verification code runs for real.

Example:
  $ invoice-ai webhooks test http://localhost:3000/webhooks --secret whsec_…
```

## invoice-ai api

```text theme={null}
Usage: invoice-ai api [options] <method> <path>

Call any API endpoint directly and print the JSON response

Options:
  -d, --data <json>        request body as JSON, @file.json or @- for stdin
  -q, --query <key=value>  query parameter (repeatable)
  --idempotency-key <key>  Idempotency-Key for POST (default: generated)
  -h, --help               show help


The path is relative to /api/v1 (a leading /api/v1 is accepted too).

Examples:
  $ invoice-ai api GET /business
  $ invoice-ai api GET /invoices --query status=open --query limit=5
  $ invoice-ai api POST /customers --data '{"name":"Acme","email":"ap@acme.com"}'
  $ invoice-ai api PATCH /customers/cus_123 --data @patch.json
```

## invoice-ai open

```text theme={null}
Usage: invoice-ai open [options] [page] [id]

Open the web app: dashboard, invoices, customers, products, settings, api-keys,
webhooks, or "invoice <id>"

Options:
  -h, --help            show help


Examples:
  $ invoice-ai open
  $ invoice-ai open invoice in_123     # the invoice's public page
```

## invoice-ai docs

```text theme={null}
Usage: invoice-ai docs [options] [topic]

Open the documentation (home, quickstart, auth, errors, idempotency, pagination,
rate-limits, ids, lifecycle, webhooks, api, cli, changelog)

Options:
  -h, --help            show help
```

## invoice-ai completion

```text theme={null}
Usage: invoice-ai completion [options] <shell>

Print a shell completion script (bash, zsh or fish)

Options:
  -h, --help            show help


Install:
  bash  $ invoice-ai completion bash > ~/.local/share/bash-completion/completions/invoice-ai
  zsh   $ invoice-ai completion zsh > "${fpath[1]}/_invoice-ai"
  fish  $ invoice-ai completion fish > ~/.config/fish/completions/invoice-ai.fish
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.