The OpenNode Developer Hub

Welcome to the OpenNode developer hub. You'll find comprehensive guides and documentation to help you start working with OpenNode as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    API Reference

Charges Webhooks

On-chain transactions

  • status = processing - Transaction is seen for the first time on the mempool
  • status = paid - Transaction is confirmed on the Bitcoin blockchain

Lighting Network transactions

  • status = paid - Transaction is settled
POST callback_url | application/x-www-form-urlencoded
    id: id,
    callback_url: callback_url,
    success_url: success_url,
    status: status,
    order_id: order_id,
    description: description,
    price: price,
    fee: fee,
    auto_settle: auto_settle,
    hashed_order: hashed_order

OpenNode signs all charge related events it sends to your endpoints with a hashed_order field on the event payload. This allows you to validate that the events were sent by OpenNode and not by a third party.

You can verify the signatures by computing an HMAC with the SHA256 hash function. Use the api-key used on the charge creation as the key, and the charge id as the message.

const crypto = require('crypto');

const received = charge.hashed_order;
const calculated = crypto.createHmac('sha256', MY_API_KEY).update('hex');

if (received === calculated) {
    //Signature is valid
else {
    //Signature is invalid. Ignore.

Charges Webhooks

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.