CLI
Extract invoices from the terminal and pipe structured results into anything. The invoicejet CLI wraps the REST API: same keys, same quota, same resources.
Install & authenticate
shell
npm install -g invoicejet
# one of:
export INVOICEJET_API_KEY=ijk_live_...
invoicejet config set-key ijk_live_... # persists to ~/.config/invoicejet/
invoicejet me # verifyCommands
| Command | Does |
|---|---|
invoicejet extract file.pdf --wait | Extract a local file and print the result. |
invoicejet extract --url https://… --wait | Extract from a public URL. |
invoicejet extract file.pdf | Async: prints the id to poll. |
invoicejet get <id> | Fetch one invoice. |
invoicejet list --unpaid --overdue | Query: --status --source --vendor --paid/--unpaid --overdue --min/--max --due-before/--due-after --created-after/--created-before. One page (--limit, default 25); --starting-after <cursor> for the next, --all for every page. |
invoicejet vendors | Vendors by total billed. |
invoicejet events [--type t] [--all] | Invoice events, newest first (the same payloads webhooks deliver). Same pagination and created filters as list. |
invoicejet paid <id> [--undo] | Mark paid or unpaid. |
invoicejet tag <id> <value|--clear> | Set or clear the entity tag. |
invoicejet file <id> | Signed download URL (1 hour) for the original document. |
invoicejet retry <id> [--force] | Re-run extraction for a failed invoice; --force re-runs a complete one. |
invoicejet request-approval <id> --email a@b.co | Email an approve/reject link. |
invoicejet export --shape lines [filters] [-o file] | Export to CSV/JSON (shapes: lines, xero, invoices, vendors); same filters as list. |
invoicejet me | Key check + monthly quota. |
Scripting
Every command takes --json for the raw API response. Errors exit non-zero with the API's type/code, so failures are scriptable.
shell
# total of completed invoices ingested this month (every page)
invoicejet list --status complete --created-after "$(date +%Y-%m-01)" --all --json \
| jq '[.data[].amount] | add'
# batch a folder
for f in ./inbox/*.pdf; do invoicejet extract "$f"; done
# what's overdue, then chase the big one
invoicejet list --overdue
invoicejet request-approval 9b2f0c1e-… --email sam@company.com
# mark a vendor's invoices paid after a payment run
invoicejet list --vendor jetstream --unpaid --all --json \
| jq -r '.data[].id' | xargs -n1 invoicejet paidTimeouts & retries
| Flag | Does |
|---|---|
--timeout <sec> | Per-attempt timeout. Default 60s, or 120s for file uploads and --wait. An explicit value applies to every request; 0 means no timeout. |
--max-retries <n> | Retries on network errors, timeouts and 408/429/500/502/503/504, with jittered backoff and Retry-After honored. Default 2; 0 turns retries off. Other 4xx (409 included) are never retried, and neither are retry and request-approval. |
extract always sends an Idempotency-Key, so a retry never extracts the same document twice. When the outcome is unknown (a timeout or 5xx), the error prints the key; re-run with --idempotency-key <key> to get the original result. Errors also print the request id.
shell
invoicejet extract big-scan.pdf --wait --timeout 180 # slow scan
invoicejet list --all --max-retries 5 # long walk
invoicejet me --max-retries 0 --timeout 5 # fail fast in a health check