Payment flow

Inspect /api/payment-methods for the current list of enabled payment rails. Each rail has its own purchase and redemption contract.

x402 USDC

Agent requests to paid API routes receive an x402 Solana USDC challenge when x402 is enabled. Retry with the protocol settlement proof after payment.

Bitcoin Lightning

Human Lightning checkout is available at /web/buy/{product}. Pay the BOLT11 invoice, then redeem with X-Payment-Hash and X-Payment-Preimage.

Stripe Checkout

Start card checkout at /web/stripe/buy/{product} or POST a product ID to /api/stripe/checkout. After Stripe redirects to /web/stripe/success, the server re-verifies the paid Checkout Session before releasing data.

Lightning curl example

curl -i https://YOUR-WORKER/api/data
curl -H "X-Payment-Hash: HASH" -H "X-Payment-Preimage: PREIMAGE" https://YOUR-WORKER/api/data

Important: never share private keys, seed phrases, or payment preimages. Always consult /api/payment-methods for the currently enabled rails.

Need help? Email contact@tradedatahub.net