NHBCoin
NHBCoin

NHBCoin REST API Quickstart

There is no npm SDK package -- integrate directly against the REST API below with whatever HTTP client your stack already uses.

1. Get a live API key

From a business workspace on nhbcoin.com, go to Developer -> API Keys and generate a key. The secret is shown once -- store it server-side only.

Sandbox-environment keys exist but the checkout-invoice endpoint currently rejects them (no simulated/test-mode payment flow yet) -- use a live key.

No install step -- this is a plain REST API
curl -s https://api.nhbcoin.com/ \
  -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"nhb_getLatestBlocks","params":[1]}'

2. Create a checkout invoice

The merchant-checkout endpoint is the primary integration surface -- see the full Accepting Payments guide for the complete request/response contract, webhook setup, and signature verification.

  1. POST to https://nhbcoin.com/api/v1/checkout/invoice with your X-Api-Key and a per-order Idempotency-Key header.
  2. Redirect your customer to the payUrl in the response -- that hosted page handles their wallet connection and payment.
  3. Configure a webhook once per workspace (Developer -> Webhooks) to get notified server-side when payment completes.
Create an invoice
curl -X POST https://nhbcoin.com/api/v1/checkout/invoice \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: sk_live_xxxxxxxxxxxxx" \
  -H "Idempotency-Key: ord-12345" \
  -d '{
    "amountFiat": "100.00",
    "fiatCurrency": "USD",
    "orderId": "ord-12345"
  }'

3. Read chain state directly (optional)

For read-only queries -- balances, transaction history, market data -- call the public JSON-RPC endpoint directly. No API key is required for read methods.

curl example
curl -s https://api.nhbcoin.com/ \
  -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"nhb_getBalance","params":["nhb1youraddresshere"]}'

The full JSON-RPC method reference is in the API Endpoints guide -- see the link below.

See the Accepting Payments guide for the full merchant-checkout contract, the API Endpoints reference for every JSON-RPC method, and the GitHub repository at github.com/josephblackelite/nhbchain for source and issue tracking.