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:

Global flags

Available on every command:
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

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.

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