Skip to main content

CLI

Command-line interface for Von Payments, powered by the @vonpay/checkout-cli package.

The vonpay command is the umbrella CLI. checkout is a product subcommand — all checkout-related commands live under vonpay checkout.

Install

npm install -g @vonpay/checkout-cli@0.3.2

Authentication

The CLI resolves your API key in this order:

  1. Environment variable VON_PAY_SECRET_KEY (takes precedence)
  2. Stored key saved by vonpay checkout login (persisted to ~/.vonpay/config.json)

Commands

vonpay checkout login

Interactively store your API key. The CLI prompts for your secret key and saves it to ~/.vonpay/config.json.

vonpay checkout login
# ? Enter your Von Payments secret key: vp_sk_test_...
# Key saved to ~/.vonpay/config.json

vonpay checkout init

Write a .env file in the current directory using the stored API key.

vonpay checkout init
# Created .env with VON_PAY_SECRET_KEY

vonpay checkout sessions create

Create a checkout session from the command line.

vonpay checkout sessions create --amount 1499 --currency USD
FlagRequiredDescription
--amountYesAmount in smallest currency unit (e.g. 1499 = $14.99)
--currencyYesThree-letter currency code
--countryNoTwo-letter country code (e.g. US)
--dry-runNoValidate without creating a session
--jsonNoOutput raw JSON response
# Dry-run validation
vonpay checkout sessions create --amount 1499 --currency USD --dry-run

# JSON output for scripting
vonpay checkout sessions create --amount 1499 --currency USD --country US --json

vonpay checkout sessions get

Retrieve a session by ID.

vonpay checkout sessions get vp_cs_test_abc123
FlagDescription
--jsonOutput raw JSON response

vonpay checkout trigger

Send a test webhook event to a URL. Useful for verifying your webhook handler during development.

vonpay checkout trigger session.succeeded --url https://localhost:3000/webhooks

Supported events:

  • session.succeeded
  • session.failed
  • session.expired
  • refund.created

vonpay checkout health

Check the API health status.

vonpay checkout health

# JSON output
vonpay checkout health --json