Installation
Scaffolding Tool
To create a brand new ZendFi project from a template, use the companion scaffolding package:create command with interactive prompts. More details in the Init and Create reference.
Authentication
The CLI reads your API key from theZENDFI_API_KEY environment variable. Set it before running commands:
~/.bashrc, ~/.zshrc) for persistence. You can also store it in a .env file in your project root and the CLI will pick it up when running zendfi init.
The CLI detects whether your key is a test key (
zfi_test_) or live key (zfi_live_). If you run a payment command with a live key, it will prompt for confirmation before proceeding.Command Reference
| Command | Description |
|---|---|
zendfi init | Add ZendFi to an existing project |
zendfi payment create | Create a test payment |
zendfi payment status <id> | Check payment status |
zendfi webhooks | Test webhooks locally via tunnel |
zendfi keys list | List all API keys |
zendfi keys create | Create a new API key |
zendfi keys rotate <id> | Rotate an API key |
zendfi intents create | Create a payment intent |
zendfi intents list | List payment intents |
zendfi intents get <id> | Get intent details |
zendfi intents confirm <id> | Confirm a payment intent |
zendfi intents cancel <id> | Cancel a payment intent |
zendfi ppp check <country> | Get PPP factor for a country |
zendfi ppp factors | List all PPP factors |
zendfi ppp calculate | Calculate localized price |
Command Groups
Init and Create
Project scaffolding and framework detection. Add ZendFi to existing projects or start from a template.
Payments
Create test payments, check status, and watch payment lifecycle in real time.
Webhooks
Local webhook testing with automatic tunnel setup through ngrok or Cloudflare.
API Keys
List, create, and rotate API keys directly from the terminal.
Payment Intents
Two-phase payment flow management with create, confirm, and cancel operations.
PPP Pricing
Purchasing Power Parity tools for international pricing optimization.
Global Options
Every command supports these flags:| Flag | Description |
|---|---|
--help | Show help for a command |
--version | Show CLI version |
Environment Variables
| Variable | Description | Default |
|---|---|---|
ZENDFI_API_KEY | Your API key (required for most commands) | — |
ZENDFI_API_URL | Custom API base URL | https://api.zendfi.tech/api/v1 |
DEBUG | Enable verbose output for troubleshooting | — |
Quick Start
Create a test payment