Skip to main content
This guide walks you through the full flow for accepting a crypto payment using the Blockra API: creating a charge, presenting the deposit details to your customer, and handling the result via a webhook or polling.

Prerequisites

Step-by-step

1

Create a payment

Call POST /payments with the fiat amount, the currency, and the crypto asset the customer will pay in. Blockra locks the live exchange rate and returns a deposit address.
Blockra returns a payment object. The key fields are in deposit:
Response
2

Show deposit details to the customer

Present deposit.address and deposit.expected_amount clearly. Use deposit.qr_data to render a QR code for mobile wallets.
The customer must send exactly expected_amount (the value in deposit.expected_amount_atoms for precision). Sending a different amount results in an underpaid or overpaid status.
The deposit quote is valid for 30 minutes (see expires_at). If the timer elapses with no payment, the status moves to expired and a new payment must be created.
3

Detect confirmation via webhook

Register a webhook endpoint in Developers → Webhooks to receive real-time status updates. Listen for payment.completed to confirm the payment:
payment.completed event
Use the reference field to match the event back to your order. See Webhooks for signature verification.
4

Poll the payment status (alternative)

If webhooks are not available, poll GET /payments/{id} until status is completed, expired, or failed:
Node.js
Prefer webhooks over polling — they are faster and use fewer API requests.

Handling edge cases

If the buyer does not send funds within the 30-minute quote window, the payment status changes to expired and you receive a payment.expired webhook. Create a new payment if the buyer still wants to complete the purchase — the exchange rate will be re-locked.
Blockra marks the payment underpaid or overpaid respectively. Check your dashboard or webhook payload for details. You can contact Blockra support for resolution of over/underpayments.
Pass customer_email in the create-payment request. Blockra will create a customer record (or match an existing one) and link the payment to it. You can retrieve the associated customer from GET /payments/{id} in the customers field.