API Reference

Integration Guide

Three steps to collect payments: create an invoice, let the payer settle through x402 or browser, and confirm completion.

Base URLhttps://x402invoices.com/api
POST/api/invoices

Create an invoice by specifying the recipient, accepted networks, amount, and token. The response includes an invoiceId and a shareable payment url. Optionally include a webhookUrl to receive a callback when payment settles.

Required
payTostring
Wallet address or registered username slug
networksstring[]
"base", "arbitrum", and/or "solana"
amountstring
Payment amount as a positive decimal
tokenstring
Token symbol — currently "USDC"
Optional
expiresAtstring?
ISO 8601 timestamp for invoice expiry
webhookUrlstring?
HTTPS callback URL for payment events
orderIdstring?
Your internal order or reference ID
metadataobject?
Arbitrary key-value pairs stored with the invoice
cURL
curl -X POST "https://x402invoices.com/api/invoices" \
  -H "Content-Type: application/json" \
  -d '{
    "payTo": "alice",
    "networks": ["base", "arbitrum", "solana"],
    "amount": "10.50",
    "token": "USDC",
    "webhookUrl": "https://example.com/webhooks/invoice-paid",
    "orderId": "order-123"
  }'
Response201 Created
JSON
{
  "invoiceId": "inv_abc123",
  "url": "https://x402invoices.com/inv/inv_abc123"
}