Interfaces

CLI

How to create OpenPayment payment links from a terminal, with validated flags, JSON output, and scripting-friendly workflows.

The OpenPayment CLI is the terminal interface for creating payment links. It is ideal when creation must be scriptable, repeatable, and easy to embed in operational workflows.

What the CLI does

The CLI is focused on one job: creating payment definitions and returning the public payment URL.

It does not currently handle:

  • paying a link
  • fetching receipts
  • running checkout locally

For settlement and receipt inspection, use the hosted OpenPayment checkout and receipt pages.

Install

Install the package globally:

npm i -g openpayment

You can then inspect the command surface with:

openpayment --help

Command shape

openpayment create \
  --type "<SINGLE_USE|MULTI_USE|VARIABLE|PROXY>" \
  --price "<amount>" \
  --payTo "<0x recipient>" \
  --network "<eip155:8453|eip155:84532>" \
  [--description "<text>"] \
  [--resourceUrl "<https://...>"] \
  [--json]

Required and optional flags

FlagRequiredNotes
--typeYesPayment behavior
--priceYesPositive decimal amount
--payToYesRecipient EVM address
--networkYesBase Mainnet or Base Sepolia
--descriptionNoOptional payer-facing context
--resourceUrlOnly for PROXYProtected HTTPS resource
--jsonNoMachine-readable output

Examples

One-time payment

openpayment create \
  --type "SINGLE_USE" \
  --price "49" \
  --payTo "0xYourWalletAddress" \
  --network "eip155:8453" \
  --description "Order #2048"
openpayment create \
  --type "MULTI_USE" \
  --price "9.99" \
  --payTo "0xYourWalletAddress" \
  --network "eip155:8453" \
  --description "Monthly membership"
openpayment create \
  --type "VARIABLE" \
  --price "5" \
  --payTo "0xYourWalletAddress" \
  --network "eip155:8453" \
  --description "Support this project"

Proxy payment

openpayment create \
  --type "PROXY" \
  --price "3" \
  --payTo "0xYourWalletAddress" \
  --network "eip155:8453" \
  --resourceUrl "https://example.com/private/report" \
  --description "Premium report"

Output

By default, the CLI prints a human-readable result:

Payment created successfully
paymentId: <paymentId>
url: <paymentUrl>

For scripts and automation, use --json:

openpayment create \
  --type "SINGLE_USE" \
  --price "25" \
  --payTo "0xYourWalletAddress" \
  --network "eip155:8453" \
  --json
{
  "paymentId": "<paymentId>",
  "url": "<paymentUrl>"
}

Validation behavior

The CLI validates input before making a network call. That means obvious mistakes fail fast in the terminal.

The public validation rules are:

  • type must be SINGLE_USE, MULTI_USE, VARIABLE, or PROXY
  • price must be a positive decimal
  • payTo must be a valid EVM address
  • network must be eip155:8453 or eip155:84532
  • resourceUrl is required only for PROXY and must be HTTPS

This makes the CLI safe to use in scripts where you want predictable failures.

When the CLI is the right choice

Choose the CLI when you want:

  • shell automation
  • admin tooling
  • CI or release-adjacent workflows that generate payment links
  • simple integrations without writing application code

Choose the SDK instead when payment creation must happen inside your application logic.