Skip to content

x402 on CantonPay for an HTTP request on Canton

Charge for your API, or pay for someone else's, in a single HTTP round trip — settled on the Canton Network by a facilitator that never holds your funds.

x402 makes an ordinary HTTP request payable: a client that calls a paid endpoint gets back 402 Payment Required, signs a payment, and retries with it. The facilitator is the HTTP service that turns that signed payment into a real, settled payment on the Canton Network — so your server never has to speak to a ledger, hold a wallet, or run a node. The facilitator explains what it does and why it is non-custodial.

Choose your integration path ​

For merchants

Accept payments

Gate your API behind HTTP 402, quote a price, and settle each payment through the facilitator — straight to your Canton party. Pricing, settlements and API keys are managed on the merchant dashboard.

  1. Create your account and link the Canton party you get paid at
  2. Create an API key
  3. Gate your routes with @chainsafe/x402-express
For buyers

Pay for an API

Run the payer SDK on your own infrastructure: it finds your holdings, prepares the transfer on your participant and signs it with your key, which never leaves you. A 402 is paid and the request retried for you.

  1. Install @chainsafe/x402-server-sdk
  2. Connect it to your Ledger API and signing key
  3. Call paid endpoints through the wrapped fetch

Payment flow ​

A paid request is an ordinary HTTP request, retried once. The first try comes back 402 Payment Required with the price and terms. The payer prepares a Canton transfer for exactly that amount, signs it with its own key, and retries with the signed payment attached. Your server hands it to the facilitator, which checks that the signed transfer pays exactly your terms, then executes it on Canton, where the funds land at your party. Custody stays with the payer throughout: the facilitator never sees a private key, and can only submit the transaction the payer signed.

Each step in detail →

Browse the docs ​