Banxa: a payment infrastructure provider

This tutorial provides an introduction to Banxa, a payment infrastructure and regulatory compliance provider for digital asset platforms. Banxa’s mission is to build a bridge that enables access to a fairer and more equitable financial system for people all over the world. This tutorial focuses on using the Banxa APIs, and includes examples in NodeJS for generating HMAC tokens and sending requests to the Banxa API host. To get started using the Banxa APIs, users need to get in touch with the Banxa team to obtain a user key and secret token.


Banxa powers the largest digital asset platforms by providing payments infrastructure and regulatory compliance across global markets. Our mission and vision is to build the bridge that provides people in every part of the world access to a fairer and more equitable financial system. Visit the Banxa documentation to find out more.

API Host




API Host






NodeJS Examples


Generate HMAC Token

const generateHmac = (signature: string, nonce: number): string => {
  const crypto = require("crypto");
  const key = "YOUR_BANXA_KEY";
  const secret = "YOUR_BANXA_SECRET_TOKEN";

  const localSignature = crypto
    .createHmac("SHA256", secret)
  return `${key}:${localSignature}:${nonce}`;


To get started using the Banxa APIs, please get in touch here with the Banxa team in order to get a user key and secret token.


Send Request

const sendGetRequest = (query: string): void => {
  const hostname = "";
  const nonce =;
  const method = "GET";
  let data = method + "\n" + query + "\n" + nonce;

  const hmac = generateHmac(data, nonce);
  const https = require("https");
  const options = {
    hostname: hostname,
    path: query,
    method: method,
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${hmac}`,

  const req = https.get(
    (res: {
      statusCode: string;
      headers: string;
      setEncoding: (arg0: string) => void;
      on: (arg0: string, arg1: { (chunk: string): void }) => void;
    }) => {
      console.log(`STATUS: ${res.statusCode}`);
      console.log(`HEADERS: ${JSON.stringify(res.headers)}`);
      res.on("data", (chunk: string) => {
        console.log(`BODY: ${chunk}`);
      res.on("end", () => {
        console.log("No more data in response.");

  req.on("error", (e: { message: string }) => {
    console.error(`problem with request: ${e.message}`);