Show the buyer
Show the buyer the invoice
You have two options.
Option A — Redirect to our hosted checkout (easiest)
const { invoice } = await createInvoice(...);
res.redirect(invoice.hosted_checkout_url);
Buyer sees a polished, mobile-first payment page with QR code, address, countdown, status pill, and "Open in wallet" button. Auto-updates via Server-Sent Events when the payment confirms, then redirects to your success_url.
Option B — Build your own checkout UI
Render whatever you want in your own frontend. SatLane gives you everything you need:
// 1. Fetch the snapshot (no auth — invoice ID is the credential)
const res = await fetch(`https://api.satlane.com/pay/invoices/${invoiceId}`);
const { invoice, store, live } = await res.json();
// 2. Render `invoice.payment_uri` as a QR code in your UI
// 3. Subscribe to live status updates via SSE
const es = new EventSource(`https://api.satlane.com${live.events_url}`);
es.addEventListener('invoice.paid', (e) => {
const { invoice } = JSON.parse(e.data);
// Show success screen, redirect, etc.
});
es.addEventListener('invoice.expired', (e) => { /* ... */ });
es.addEventListener('invoice.payment_seen', (e) => { /* "Detected, waiting for confirmation" */ });
// Or listen to the generic message event — every status change fires one:
es.onmessage = (e) => {
const payload = JSON.parse(e.data);
console.log(payload.event_type, payload.invoice.status);
};
If your stack prefers WebSocket over SSE, use live.stream_url instead (same JSON payload, one per event).