Prerequisites
- A Blockra account (app.blockra.io)
- An API key with the
payments:writeandpayments:readscopes — see Authentication
Step-by-step
Create a payment
Call Blockra returns a payment object. The key fields are in
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.deposit:Response
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 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.Detect confirmation via webhook
Register a webhook endpoint in Developers → Webhooks to receive real-time status updates. Listen for Use the
payment.completed to confirm the payment:payment.completed event
reference field to match the event back to your order. See Webhooks for signature verification.Handling edge cases
What happens if a payment expires?
What happens if a payment expires?
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.What if the buyer sends too little or too much?
What if the buyer sends too little or too much?
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.How do I associate a payment with a customer?
How do I associate a payment with a customer?
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.
