Skip to main content
Blockra’s hosted checkout removes the need to build a coin-selection UI or a deposit-address screen yourself. You create a checkout session, redirect the buyer to the returned URL, and Blockra handles everything from there — the buyer picks their preferred coin, gets a deposit address, and pays. This guide shows you how to integrate hosted checkout end to end.

When to use hosted checkout

Use hosted checkout when:
  • You want to accept multiple coins without building a coin-picker UI
  • You want Blockra to manage the deposit timer and UI state
  • You are integrating Blockra into an existing e-commerce flow where a redirect is acceptable
Use the direct payment API instead when you need full control over the payment UI or want to restrict the buyer to a single asset.

Creating a checkout session

1

Create the session

Call POST /checkout/sessions with the amount, currency, and optional redirect URLs. Requires the payments:write scope.
The response contains the session id and the hosted url:
Response
2

Redirect the buyer

Send the buyer to data.url. Blockra’s checkout page lets them select a coin, see the exact deposit amount, and send payment from their wallet.
3

Receive the result

When the payment completes or the buyer cancels, Blockra redirects them to your success_url or cancel_url. For server-side confirmation, listen for the payment.completed webhook — do not rely solely on the redirect.
Always verify payment completion via a webhook or by calling GET /payments/{id}. A buyer could navigate directly to success_url without paying.

Omitting the amount

If you omit amount from the request, Blockra’s checkout page will display an amount entry field so the buyer can specify how much they want to pay. This is useful for donation flows or open-ended invoices.

Pre-filling customer email

Pass customer_email to pre-fill the email field on the checkout page and associate the payment with a customer record: