Paycurl docs

Quickstart

Install the package for your framework, for example npm install @paycurl/express. Add the middleware with your payTo wallet address and a routes map of method, path and price.

Request a priced route with curl. You should get a 402 response containing the amount, asset, payTo address and an expiry. Then call it with paycurl.fetch from a test wallet to see a 200.

How payment works

Paycurl uses the x402 pattern. The server answers an unpaid request with 402 and a quote. The client signs a USDC transfer with the connected wallet, such as Phantom, Solflare or Backpack, and retries with the payment attached.

The middleware verifies the payment through a facilitator before your handler runs. The transfer goes from the payer to your wallet, so Paycurl never takes custody.

Test mode and going live

Routes start in test mode. The sandbox facilitator uses fake balances and settles instantly, with the same quote and error shapes as production.

To go live, switch a route to Live in the Endpoints view and confirm your payout wallet. Receipts then link to Solscan so payers and sellers can check each transfer.