Skip to main content
The payments commands let you create, monitor, and inspect payments directly from the CLI. Useful for testing your integration without writing any code.

payment create

Create a new payment and get a checkout URL.
Aliases: zendfi payment test, zendfi pay create

Options

Interactive Mode

If you omit the flags, the CLI prompts you for each value:

Non-Interactive Mode

Pass all options as flags to skip prompts:

What Happens

1

API key validation

The CLI checks for ZENDFI_API_KEY in your environment. If the key starts with zfi_live_ instead of zfi_test_, it warns you and asks for confirmation before proceeding.
2

Payment creation

Sends a POST /api/v1/payments request with your parameters:
All CLI-created payments include "source": "cli-test" in their metadata so you can identify them.
3

Display results

Shows a formatted summary with Payment ID, status, amount, mode (Test/Live), and checkout URL. The checkout URL is automatically copied to your clipboard.
4

Optional: open in browser

If you pass --open or confirm the prompt, the CLI opens the checkout URL in your default browser.
5

Optional: watch status

If you pass --watch or confirm the prompt, the CLI polls the payment status every few seconds and displays live updates until the payment is confirmed, fails, or expires.

Example Output


payment status

Check the current status and details of any payment.

Arguments

Output Sections

The status command displays a rich, formatted view of the payment: Payment Details — ID, status badge, amount, mode (test/live), description, customer email. Timeline — Creation time, confirmation time (if confirmed), duration between creation and confirmation, expiration countdown (if still pending). Transaction — Solana transaction signature and a direct link to the block explorer (Solscan). Wallets — Merchant wallet address and customer wallet address (truncated for readability). Metadata — Any custom metadata attached to the payment. Actions — For pending payments, shows the checkout URL. For confirmed payments, shows a success message. For failed or expired payments, shows the reason and suggests creating a new payment.

Status Badges

Example


Debugging

Enable verbose output with the DEBUG environment variable:
This logs the raw API response JSON, which is useful for troubleshooting unexpected behavior.

Common Patterns

Quick smoke test

Scripting

Live key safety

The CLI prevents accidental live payments. If your ZENDFI_API_KEY starts with zfi_live_, the CLI displays a warning and requires explicit confirmation before creating a real payment. Use test keys (zfi_test_) for development and CI environments.