payment create
Create a new payment and get a checkout URL.zendfi payment test, zendfi pay create
Options
| Flag | Description | Default |
|---|---|---|
--amount <amount> | Payment amount in USD | Interactive prompt |
--description <text> | Payment description | Interactive prompt |
--email <email> | Customer email address | Interactive prompt |
--open | Open the checkout URL in your browser | Interactive prompt |
--watch | Watch payment status until completion | Interactive prompt |
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
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.Payment creation
Sends a All CLI-created payments include
POST /api/v1/payments request with your parameters:"source": "cli-test" in their metadata so you can identify them.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.
Optional: open in browser
If you pass
--open or confirm the prompt, the CLI opens the checkout URL in your default browser.Example Output
payment status
Check the current status and details of any payment.Arguments
| Argument | Description | Required |
|---|---|---|
payment-id | The payment ID (e.g., pay_test_abc123) | Yes |
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
| Status | Badge |
|---|---|
pending | PENDING |
confirmed | CONFIRMED |
failed | FAILED |
expired | EXPIRED |
Example
Debugging
Enable verbose output with theDEBUG environment variable:
Common Patterns
Quick smoke test
Scripting
Live key safety
The CLI prevents accidental live payments. If yourZENDFI_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.