Skip to main content
This example creates an invoice; it does not submit a payment. The customer pays directly to the merchant wallet; FlareHQ never holds checkout funds. Hosted checkout is live on Arc Mainnet. See mainnet availability.
Production is Arc Mainnet (5042) and uses real funds. Explicitly choose a testnet deployment (5042002) for development with Get Test Tokens. Mainnet escrow, ERC-8183 jobs and job streams are unavailable; x402 is disabled and bridging is not yet proven end to end. Do not follow older stream or x402 SDK examples as mainnet instructions.

Prepare your merchant account

Sign up and verify your email at flarehq.xyz. Finish wallet setup before creating a merchant invoice. Use the API key issued to your verified merchant for /api/payments/initialize; its current resolver does not accept a bare merchant session. The separate /api/merchant/payment-link route supports that session. Store the key on your backend; never paste it into browser code or commit it. The server resolves the merchant’s business identity and payout wallet from the authenticated account. A client-supplied merchant label, registry address or arbitrary recipient does not override that wallet.

Initialize an invoice

Use the documented REST endpoint without assuming a particular SDK package or method is installed:
Use the returned checkoutUrl, which contains the actual reference. Hosted checkout is /checkout/{reference}; the embed is /checkout/embed/{reference}. Bare /checkout or /pay is not a valid invoice route. Initialized invoices have a 120-minute expiry; do not assume a reference is permanently reusable. Mainnet merchant checkout settles USDC only. Same-token payment needs no conversion. Check the invoice amount, recipient and network before the customer authorizes a payment.

Verify before fulfillment

Fetch GET /api/payments/verify/{reference} from your server and compare it with your saved order. Top-level status: true means the query succeeded; payment success is data.status === 'SUCCESS'. This is a cached database read, not a live chain verification. Verify the expected amount and currency, frozen merchant recipient and actual transaction evidence. Where necessary, use owner-authorized records, the receipt and recipient balance deltas at fixed blocks; do not infer settlement from a browser return URL or a notification. Fulfill once using your application’s durable, transactional order state. A notification can be missing, duplicated or spoofed.

Treat webhooks as hints

You can attach webhookUrl at invoice creation, but current outbound checkout notifications are unsigned and best-effort, with no durable retry queue or delivery guarantee. They use an event field such as payment.settled, not an authenticated SDK event object. There is no documented signing secret or constructEvent validation for these deliveries. Always perform server-side payment verification before fulfillment. Read Webhooks for the actual limitations.

Next steps