Command-line tool
Install the package first: see Node SDK.
The package installs a ctpeway command.
export CTPEWAY_API_KEY=ctp_test_sk_...
npx ctpeway invoices create --price 49.99 --accept USDT:bsc --accept ETH:ethereum --order-id order-1042npx ctpeway invoices create --price 49.99 --customer-email ada@example.com # every enabled assetnpx ctpeway invoices create --amount 25000000 --asset USDT --network tronnpx ctpeway invoices list --status paid,underpaid --limit 20npx ctpeway invoices list --search ada@example.comnpx ctpeway invoices get <invoice id>
npx ctpeway deposit-addresses create --name "Customer 42" --family evmnpx ctpeway deposit-addresses list --network bsc
npx ctpeway payments list --invoice <invoice id>npx ctpeway balancesnpx ctpeway balances bsc
npx ctpeway simulate invoice <invoice id> --outcome paid --settlement heldnpx ctpeway simulate invoice <invoice id> --asset USDT --network bsc-testnet --stage detectednpx ctpeway simulate add-confirmation <payment id>npx ctpeway simulate confirm <payment id> --settlement releasednpx ctpeway simulate deposit-address <deposit address id> --asset USDT --inferrednpx ctpeway simulate attach-transaction <payment id>npx ctpeway simulate deposit-address <deposit address id> --asset USDT --amount 5000000
export CTPEWAY_WEBHOOK_SECRET=whsec_...npx ctpeway webhooks verify --payload event.json --signature "t=1791000000,v1=..."- Output is text by default;
--jsonprints the API’s JSON for scripts (... --json | jq .id).--allfollows every page of a list. - The key is read from
CTPEWAY_API_KEY, or from--api-key. Prefer the environment variable: a flag ends up in shell history and process lists.--base-urlorCTPEWAY_BASE_URLpoints the tool at a local API. - Amounts are base units, as in the library:
--amount 25000000, not25.--priceis in US dollars. - Exit codes:
0success,1the API or the verification said no,2the command was wrong. - The tool never prints the API key or a webhook secret, including in errors.
webhooks verifychecks a payload saved to a file, byte for byte (an editor that adds a final newline changes the bytes). For an old capture add--skip-timestamp-check.
ctpeway --help lists every command and flag.

