This guide walks you through creating a payment intent, rendering a QR code, and receiving a webhook when the customer pays. The entire integration is two API calls.
The Stable Genius API is currently in private beta. Request early access to get your API keys.
When a customer is ready to pay, create a payment intent. This returns a payment address and QR code payload that the customer scans with their wallet.
Render the QR code on your terminal, app, or checkout page. You have two options:Option A: Render the QR payload yourself — Use qr_payload with any QR code library. This is the EIP-681 standard that wallets like Coinbase Wallet and MetaMask understand natively.Option B: Use our hosted QR image — Display qr_image_url directly as an image. No QR library needed.
// Option A: Render with a QR library (e.g., qrcode.js)import QRCode from 'qrcode';const qrDataUrl = await QRCode.toDataURL(paymentIntent.qr_payload);document.getElementById('qr').src = qrDataUrl;// Option B: Use hosted imagedocument.getElementById('qr').src = paymentIntent.qr_image_url;
The customer scans the QR code with their wallet (Coinbase Wallet, MetaMask, Phantom, etc.), sees the pre-filled transfer, and taps confirm.
Your system processes the webhook and marks the order as paid:
app.post('/webhooks/stablegenius', (req, res) => { const event = req.body; // Verify webhook signature (see Webhook Security) // verifySignature(req); if (event.type === 'payment_intent.confirmed') { const { amount, tx_hash, metadata } = event.data; // Mark order as paid in your system markOrderPaid(metadata.order_id, { amount, tx_hash, paid_at: event.data.confirmed_at, }); // Trigger your POS to show success (beep, receipt, etc.) notifyTerminal(metadata.terminal_id, 'payment_success'); } res.status(200).json({ received: true });});
That’s it. The merchant’s funds settle automatically to their bank account on the configured withdrawal schedule. You don’t manage wallets, watch blockchains, or handle settlements.