Skip to navigation

Command reference

Use the Paid CLI to manage Paid resources from your terminal.

Install

npm install -g @paid-ai/cli

Authentication

Save a Paid API key for this machine. Opens the API keys page, prompts for a key, and sets the active profile.

paid init

By default, init creates a sandbox profile labelled Sandbox.

paid init --api-key paid_xxx
FlagDescription
--api-key <key>Save this API key instead of prompting.
--env <name>Create or update a named profile and make it active.
--env-type <type>Label the profile, for example Sandbox or Production.
--base-url <url>Save a custom API URL for the profile.

Show the active profile and API URL.

paid env

Select a profile for one command:

paid --env production env

Switch the active environment profile.

paid env switch production

Resources

Create, list, retrieve, and update products.

paid product list

Create, list, retrieve, update, and delete customers. Retrieve credit balances and upsert customer users.

paid customer list

Create, list, retrieve, update, and delete customer contacts.

paid contact list

Create, list, retrieve, update, and delete a customer’s units, the customer’s internal hierarchy (departments, tenants, teams). Address the customer by its Paid id with --id, or use the -external variants with your own customer id in --external-id; units are always addressed by your key in --external-customer-unit-id. Requires @paid-ai/cli 1.2.0 or later.

paid customer-unit list-external --external-id acme
paid customer-unit create-external --external-id acme externalId=eu-tenant parentExternalId=acme name="EU tenant"
paid customer-unit get-external --external-id acme --external-customer-unit-id eu-tenant

Set, read, and end a unit’s credit cap. Same addressing as paid customer-unit. When your organization has more than one credits currency, name it with creditsCurrencyId=… in the body of set, and with the --credits-currency-id flag on get and end.

paid customer-unit-cap set-external --external-id acme --external-customer-unit-id eu-tenant amount=10000 frequency=MONTHLY
paid customer-unit-cap get-external --external-id acme --external-customer-unit-id eu-tenant --credits-currency-id "$CREDITS_CURRENCY_ID"
paid customer-unit-cap end-external --external-id acme --external-customer-unit-id eu-tenant --credits-currency-id "$CREDITS_CURRENCY_ID"

Create, activate, list, retrieve, update, and delete orders. List order lines, manage order seats and seat assignments.

paid order list

List invoices, retrieve an invoice, update an invoice, and list invoice lines.

paid invoice list

Send signals in bulk.

paid signal create-bulk --file ./signals.json

Create, list, retrieve, and archive checkout links.

paid checkout list

List credit currencies.

paid credit currencies

Create customer portal sessions. Deprecated: the customer portal is being retired, and this command will be removed in a future release. It keeps working for existing integrations meanwhile.

paid customer-portal create --file ./portal.json

Create, list, retrieve, archive, unarchive, publish, and unpublish value receipts. Sync, refresh and seal are deprecated.

paid value-receipt list

List, retrieve, and update pricing configurations.

paid pricing list

Ingest costs.

paid cost create-bulk --file ./costs.json

List, update, and test webhooks.

paid webhook list

Request Bodies

Commands that accept JSON bodies support three input styles.

Shorthand fields

Pass fields directly as key=value pairs.

paid customer create name="Acme Corp" externalId=acme

--file

Read JSON from a file.

paid customer create --file ./customer.json

--stdin

Read JSON from stdin.

cat customer.json | paid customer create --stdin

Global Options

Global options can be used with any command.

paid product list --api-key paid_xxx --timeout-ms 30000
FlagDescription
--api-key <key>Use this API key for the command.
--base-url <url>Use this API URL for the command.
--env <name>Use a saved profile for the command.
--timeout-ms <ms>Set the HTTP timeout in milliseconds.
--helpShow command help.
--versionShow the CLI version.

Environment Variables

VariableDescription
PAID_API_KEYAPI key to use when --api-key is not provided.
PAID_BASE_URLAPI URL to use when --base-url is not provided.
PAID_ENVSaved profile name to use.
PAID_ACTIVE_ENVIRONMENTSaved profile name to use when PAID_ENV is not set.