When to use a payment link
- Email invoicing: a Xero or QuickBooks invoice with a “pay in USDC” URL
- Chat-bot replies: a Telegram or Discord bot that replies to
pay £5with a URL - Phone-to-phone: shopkeeper generates the URL, customer scans the QR
- Anywhere x402 is too low-level: you want a hosted checkout page with QR rendering, not a 402 response that the customer’s tooling has to handle
Lifecycle
payment_ledger_id column points at the on-chain transaction record.
Creating a link
cancel_secret is the only way to cancel the link before payment. Hold it server-side.
TTL and expiry
Default expiry is 30 minutes from creation. Maximum is 7 days. After expiry the link’s status flips toexpired and the page returns “this checkout has expired”.
Cancellation
Bot integration metadata
When a payment link is created by a chat bot, the link record carries metadata that lets the bot reply to the right conversation when the payment confirms:tweet_idfor X / Twitter bot paymentsconfirmation_tweet_idonce the bot has posted the “payment confirmed” replytelegram_chat_idfor Telegram bot paymentstelegram_confirmedboolean, flipped to true once the reply has been sent
See also
- Quickstart walks through creating your first link
- Outbound webhooks for the event your backend receives on payment confirmation
- x402 for the agent-equivalent flow