Skip to main content
The ZendFi CLI gives you full control over your payment infrastructure without leaving your terminal. Create payments, manage API keys, test webhooks locally, and scaffold new projects in seconds.

Installation

npm install -g @zendfi/cli
Verify the installation:
zendfi --version

Scaffolding Tool

To create a brand new ZendFi project from a template, use the companion scaffolding package:
npx create-zendfi-app my-store
This is a separate entry point that wraps the create command with interactive prompts. More details in the Init and Create reference.

Authentication

The CLI reads your API key from the ZENDFI_API_KEY environment variable. Set it before running commands:
export ZENDFI_API_KEY=zfi_test_your_key_here
Or add it to your shell profile (~/.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

CommandDescription
zendfi initAdd ZendFi to an existing project
zendfi payment createCreate a test payment
zendfi payment status <id>Check payment status
zendfi webhooksTest webhooks locally via tunnel
zendfi keys listList all API keys
zendfi keys createCreate a new API key
zendfi keys rotate <id>Rotate an API key
zendfi intents createCreate a payment intent
zendfi intents listList 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 factorsList all PPP factors
zendfi ppp calculateCalculate localized price

Command Groups

Global Options

Every command supports these flags:
FlagDescription
--helpShow help for a command
--versionShow CLI version

Environment Variables

VariableDescriptionDefault
ZENDFI_API_KEYYour API key (required for most commands)
ZENDFI_API_URLCustom API base URLhttps://api.zendfi.tech/api/v1
DEBUGEnable verbose output for troubleshooting

Quick Start

1

Install the CLI

npm install -g @zendfi/cli
2

Set your API key

export ZENDFI_API_KEY=zfi_test_your_key_here
3

Create a test payment

zendfi payment create --amount 50
The CLI creates the payment, copies the checkout URL to your clipboard, and optionally opens it in your browser.
4

Watch the payment

zendfi payment status pay_test_abc123
See rich, formatted payment details including status, timeline, transaction signature, and wallet addresses.

What’s Next