DuckyPayDocs

create-duckypay-checkout

A one-command scaffold: a minimal Node server that creates charges and verifies webhooks — the quickstart, as runnable code.

Run it#

terminal
npm create duckypay-checkout@latest my-shop

cd my-shop
cp .env.example .env   # paste your dp_test_… key + webhook secret
npm install
npm start

The generated .env.example asks for exactly two secrets: your API key and a webhook signing secret. With a dp_test_… key it charges Polygon Amoy out of the box — pair it with the quickstart to see a full payment round-trip.

Flags#

terminal
# choose a network by name or raw chain id (default: polygon-amoy)
npm create duckypay-checkout@latest my-shop -- --chain polygon

# pin the token instead of the chain default
npm create duckypay-checkout@latest my-shop -- --chain polygon --token USDC
FlagValuesDefault
--chainpolygon · polygon-amoy · base · arbitrum · any numeric chain idpolygon-amoy
--tokenA symbol, e.g. USDT, USDCthe chain’s default token

What it scaffolds#

routes
# what you get — a dependency-light Node server with two routes:
POST /charges    # creates a charge via @duckypay/node, returns checkoutUrl
POST /webhooks   # verifies x-duckypay-signature, handles invoice.paid

Plus package.json, .gitignore, and a README. The server is plain Node with @duckypay/node as its only DuckyPay dependency — read it in five minutes, then lift the two routes into your real app.