Skip to main content
This guide walks through accepting a payment end to end: creating a checkout session for a single customer, sending them to the hosted payment page, and confirming the result via a webhook. The funds land directly in your own wallet — Blockra never holds them.
There are two ways to take money. A checkout session (this guide) is single-use — one customer, one order — and is what you create from your server at the moment of purchase. A payment link is reusable and shareable — one URL you hand out or embed. The direct POST /payments endpoint has been removed; every payment now starts from a session or a link.

Prerequisites

  • A Blockra account (app.blockra.io) with a wallet set up — this is where crypto lands. See Set Up Your Wallet; it is created in your browser under Settings → Payment Methods, and takes about a minute. To take cards as well, connect your Stripe account on the same page.
  • An API key with the payments:write and payments:read scopes — see Authentication.

Step-by-step

1

Create a checkout session

Call POST /checkout/sessions with the amount, currency, and where to send the buyer afterwards. Blockra returns a hosted checkout url.
Response
2

Send the customer to checkout

Redirect the buyer to data.url, or open it in an embedded checkout so they pay without leaving your site. On the page they pick a coin, see the exact amount and a QR code, and pay. The quote is valid for 30 minutes.
3

Confirm via webhook

Register an endpoint under Developers → Webhooks and listen for payment.completed. Match the event to your order with the reference you passed:
payment.completed event
By the time this fires, the funds are already in your wallet. See Webhooks for signature verification.
4

Poll the payment status (alternative)

If you can’t receive webhooks, poll GET /payments/{id} until status is terminal. The payment id arrives on the payment.* webhooks, or you can list payments filtered by your reference.
Node.js
Prefer webhooks over polling — they are faster and use fewer API requests.

Handling edge cases

If the buyer doesn’t send funds within the 30-minute quote window, the payment status changes to expired and you receive a payment.expired webhook. Create a new session if the buyer still wants to complete the purchase — the exchange rate is re-locked.
Blockra marks the payment underpaid or overpaid. Because the deposit address is yours, any coins the buyer sent are already in your wallet — resolve the order with them (refund or top-up) directly. The webhook payload and dashboard show the exact amounts.
Pass customer_email when creating the session. Blockra creates a customer record (or matches an existing one) and links the payment to it. Retrieve it from GET /payments/{id} in the customers field.