Skip to main content
Callers pay before your handler runs. FTP’s facilitator settles each payment and pays the network fee; you only receive.

Quickstart

1

Create a wallet

Back up the key with 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

To make a test payment, use a second wallet as in Agent integration. Paying yourself is refused.

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 --status shows the expiry, preapproval --force renews early, and --days 180 buys 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 set asset and extra.instrumentId to 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 merge now and then.
  • feePayer set before 2026-09-29? Switch it to the value above.