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
| Flag | Required | Notes |
|---|---|---|
--type | Yes | Payment behavior |
--price | Yes | Positive decimal amount |
--payTo | Yes | Recipient EVM address |
--network | Yes | Base Mainnet or Base Sepolia |
--description | No | Optional payer-facing context |
--resourceUrl | Only for PROXY | Protected HTTPS resource |
--json | No | Machine-readable output |
Examples
One-time payment
openpayment create \
--type "SINGLE_USE" \
--price "49" \
--payTo "0xYourWalletAddress" \
--network "eip155:8453" \
--description "Order #2048"
Reusable fixed-price link
openpayment create \
--type "MULTI_USE" \
--price "9.99" \
--payTo "0xYourWalletAddress" \
--network "eip155:8453" \
--description "Monthly membership"
Variable amount link
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:
typemust beSINGLE_USE,MULTI_USE,VARIABLE, orPROXYpricemust be a positive decimalpayTomust be a valid EVM addressnetworkmust beeip155:8453oreip155:84532resourceUrlis required only forPROXYand 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.