SDK and CLI for creating x402 stablecoin payment links that settle in USDC on Base.
Powered by OpenPayment and x402.
OpenPayment lets merchants, creators, developers, and AI agents accept USDC payments with shareable payment links and APIs. 0% platform fees, instant settlement to recipient wallet, and no sign-up required. Powered by x402.
Discover more about OpenPayment.
- Public SDK method:
create(...) - CLI command:
openpayment create ... - Strict input validation before network calls
- Zero runtime dependencies
npm i openpaymentGlobal CLI:
npm i -g openpaymentimport { create } from "openpayment";
const result = await create({
type: "SINGLE_USE",
price: "10",
payTo: "0xYourWalletAddress",
network: "eip155:84532",
description: "Example payment",
});
console.log(result.paymentId); // "ed5b8e83-607b-4853-90c6-f4f3ba821424"
console.log(result.url); // "https://openpayment.link/pay/?paymentId=ed5b8e83-607b-4853-90c6-f4f3ba821424"create(input) returns:
{
paymentId: string;
url: string;
}openpayment create \
--type "SINGLE_USE" \
--price "10" \
--payTo "0xYourWalletAddress" \
--network "eip155:84532" \
--description "Example payment"Output:
Payment created successfully
paymentId: <paymentId>
url: <paymentUrl>
Example:
Payment created successfully
paymentId: ed5b8e83-607b-4853-90c6-f4f3ba821424
url: https://openpayment.link/pay/?paymentId=ed5b8e83-607b-4853-90c6-f4f3ba821424
openpayment create \
--type "SINGLE_USE" \
--price "10" \
--payTo "0xYourWalletAddress" \
--network "eip155:8453" \
--description "Example payment" \
--jsonOutput:
{
"paymentId": "<paymentId>",
"url": "<paymentUrl>"
}Example:
{
"paymentId": "ed5b8e83-607b-4853-90c6-f4f3ba821424",
"url": "https://openpayment.link/pay/?paymentId=ed5b8e83-607b-4853-90c6-f4f3ba821424"
}type:SINGLE_USE(one-time)MULTI_USE(reusable fixed amount)VARIABLE(reusable custom amount)
price: positive decimal string/number (example:10,0.01)payTo: EVM address (0x+ 40 hex chars)network:eip155:8453oreip155:84532description: optional string, max 500 chars
OpenPayment is released under the MIT License.
