Skip to main content
The HitPay CLI is a command-line client for the HitPay API. Create payment requests, list charges, generate QR codes, and test webhooks end-to-end from your shell, scripts, and CI pipelines.

What’s Included

Account & Payments

Manage payment requests, charges, refunds, customers, invoices, subscriptions, beneficiaries, and transfers with a consistent hitpay <resource> <action> syntax.

Webhook Testing

hitpay listen tunnels your local server to the public internet and auto-registers a webhook endpoint. hitpay trigger simulates events without waiting for live traffic.

QR Codes in Terminal

hitpay qr create renders scannable QR codes directly in your terminal for PayNow, QRIS, PromptPay, GCash, DuitNow, and 50+ other methods across Southeast Asia.

Installation

1

Install the CLI

Install globally with npm:
Or run without installing:
Requires Node.js 18 or later.
2

Log in

Interactive login (prompts for API key):
Or provide the key directly for non-interactive environments like CI:
Get your API key from Dashboard → Settings → Payment Gateway → API Keys.
3

Verify

Check you’re logged in and on the right environment:
Then run any command. For example, list recent charges:
The CLI is in Beta (v0.1.0). If npm install -g @hit-pay/cli fails with a 404, install from source until the first npm publish:

Authentication & Config

Credentials are stored locally at ~/.hitpay/config.json with 0600 permissions. Inspect or update them with the config command:

Environment variables

Override any stored config with env vars, useful for CI:
VariableDescription
HITPAY_API_KEYAPI key; overrides ~/.hitpay/config.json
HITPAY_ENVIRONMENTsandbox or production

Global flags

Available on every command:
FlagDescription
--env <environment>One-shot environment override (e.g. --env production)
--jsonOutput raw JSON for piping to jq, scripts, or CI
--helpShow command help
--versionPrint CLI version
The CLI defaults to sandbox. Run hitpay config set environment production (or pass --env production) only when you are ready to move real money.

Commands

CategoryCommands
Accountlogin, logout, whoami, config set/get/list
Payment Requestspayment create, payment get, payment list, payment cancel
Chargescharge list, charge get, charge export
Refundsrefund
Customerscustomer create/list/get/update/delete
Invoicesinvoice create/list/delete
Subscriptionsplan create/list/get/delete, subscription create/list/get/cancel
Payoutsbeneficiary create/list/delete, transfer estimate/create/list/get
QR Codesqr create, methods
Webhooks (dev)listen, trigger
Run hitpay <command> --help for full argument details on any command.

Webhook development flow

The CLI’s webhook tooling lets you build and test webhook handlers locally without ngrok setup or manual endpoint registration.

Forward live events to localhost

This opens a secure tunnel, registers a temporary webhook endpoint with HitPay, and forwards every event to your local server. When you press Ctrl+C, the endpoint is cleaned up automatically.

Simulate events without live traffic

trigger posts a signed payload to whichever endpoint listen is currently forwarding, so you can exercise your handler’s signature verification, idempotency, and event routing without waiting for a real payment.

Usage Examples

Returns the checkout URL and payment request ID. Add --json to parse the result in a script.

Prerequisites

  1. HitPay Account: create an account or use the sandbox environment
  2. API Key: found in Settings → Payment Gateway → API Keys
  3. Node.js 18 or later: check with node --version

Which AI tool should I use?

HitPay offers four AI tooling options that can be used together.
ToolUse when you want to…
MCP ServerQuery your sales, payouts, and transactions from Claude, signed in with your HitPay account
Claude Code PluginBuild payment integrations with Claude Code using live API access and auto-triggered skills
Agent SkillsGenerate HitPay integration code with Cursor, Copilot, Windsurf, or any AI assistant
CLI (this page)Drive the API from your terminal, scripts, and CI pipelines, including webhook testing

Resources

GitHub Repository

View source, report issues, and contribute

HitPay MCP Server

Query your business data from an AI assistant

Claude Code Plugin

Live API access from inside Claude Code

Agent Skills

Skills for Cursor, Copilot, and Windsurf

API Reference

Full API documentation

Webhook Events

Handle payment notifications

Sandbox Guide

Test your integration

Feedback

Have suggestions or found an issue? Open an issue on GitHub.
Last modified on July 14, 2026