Skip to main content

When to use the API

Use the Blockonomics API if you are building a custom payment flow that isn’t covered by our plugins — for example, a mobile app, a custom e-commerce stack, or a SaaS platform. If you’re using WordPress, WHMCS, or PrestaShop, use the plugin integrations instead — they handle all API calls for you.

Base URL

https://www.blockonomics.co/api
All requests use HTTPS. The API returns JSON.

Quick reference

EndpointMethodDescription
/new_addressGETGenerate a new Bitcoin address for payment
/merchant/txGETCheck the status of a transaction
/balancePOSTCheck the balance of an xPub
Full API reference: blockonomics.co/api-documentation

Getting your API key

  1. Log into your Blockonomics dashboard
  2. Go to Stores and copy the API key shown at the top
Keep your API key secret. Never expose it in client-side code or public repositories.

Authentication

Include your API key in the Authorization header on every request:
Authorization: Bearer YOUR_API_KEY

Generate a payment address

The core flow: when a customer is ready to pay, request a new address and display it to them.
GET https://www.blockonomics.co/api/new_address
Authorization: Bearer YOUR_API_KEY
Response:
{
  "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7Divf2N",
  "time": 1713183121
}
Display this address (and optionally a QR code) to the customer. Their payment will go directly to your wallet.

Receive payment callbacks

When a payment is made to an address you generated, Blockonomics sends a GET request to your store’s Callback URL with these parameters:
ParameterDescription
addrThe Bitcoin address that received payment
status0 = unconfirmed, 1 = partially confirmed, 2 = fully confirmed
valueAmount received in satoshis
txidThe Bitcoin transaction ID
Example callback:
GET https://yoursite.com/blockonomics-callback?addr=1A1zP1...&status=2&value=100000&txid=abc123
Your server should return HTTP 200 to acknowledge the callback. If it returns anything else, Blockonomics will retry.
Always verify the addr parameter matches an address you generated, and the value matches the expected payment amount before marking an order as paid.

Next steps