Quickstart
1
Create a wallet
canton-agent-wallet export. Creating a wallet accepts the Terms of Service.2
Turn on receiving
Send a few CC to your party id, then:The
TransferPreapproval lets each payment settle to you in one transaction. It lasts 30 days.3
Gate a route
4
Check
Next.js
Official x402 SDK
Already on the official x402 SDK? You can build it yourself with@x402/express and @x402/canton, settled by FTP’s facilitator:
Good to know
- Keep the preapproval live. Without it payers get
402 invalid_exact_canton_preapproval_missing.preapproval --statusshows the expiry,preapproval --forcerenews early, and--days 180buys a longer one (about 0.016 CC per day). - Charging USDCx or another token. Create its preapproval once with
canton-agent-wallet preapproval --admin <registrar> --id USDCx, and setassetandextra.instrumentIdto the token from MainNet values. Every token uses 10 decimals. - More than one instance. Each payment is served once per process. With several instances, pass a shared store so a payment is served once in total:
- Header size. The payment header is 8 to 10 KiB. Every proxy in front of your app must accept 16 KiB: nginx
large_client_header_buffers 4 16k;, Node--max-http-header-size=32768. - Route keys are literal. Use
"METHOD /path"; a pattern (:id,*) is refused at startup. - Settlement runs before your handler. If the handler answers 5xx or throws, the payment is given back and the payer retries the same payment without paying again.
- Busy wallet. Every payment adds a holding. Run
canton-agent-wallet mergenow and then. feePayerset before 2026-09-29? Switch it to the value above.