Skip to Content

Checkout & redirects

The hosted checkout page, expiry, and returning to your store.

Each order has a hosted checkout page at checkoutUrl. It shows the amount in dollars, a QR code with the Lightning invoice, a copy button, and a button to open Cash App. The customer can pay from any Lightning wallet.

Expiry

The invoice expires one hour after the order is created (expiresAt). The checkout page counts down and shows the order as expired afterwards. To let the customer try again, create a new order with a new idempotency key.

If a payment arrives after expiry, the order still becomes paid and you receive order.paid. Your store should handle a paid order whose checkout already timed out.

Returning to your store

Both URLs are optional and must be HTTPS.

URLWhen it is used
cancelUrlBehind the Return to store link, shown while the order is unpaid.
successUrlAfter payment the page counts down 3 seconds and opens it. The customer can also click a button.

Without a URL, the page doesn't show the matching link or redirect. The URLs are opened as you sent them, with no added parameters, so include your own order number if you need it:

https://shop.example.com/orders/WC-10234/thanks

Reaching successUrl doesn't prove payment. Confirm with the order.paid webhook or Retrieve an order before you fulfil.

Showing the invoice yourself

Instead of the hosted page you can render invoice (a BOLT11 string) as a QR code in your own checkout. You then handle expiry and status display yourself, using webhooks to learn about payment.

On this page