BucksBox Developer DocsBucksBox Developer Docs
Getting Started
Merchant API
Partner API
SDK
GitHub
Getting Started
Merchant API
Partner API
SDK
GitHub
  • Quick Start
  • Configuration
  • Auth
  • DMT
  • AEPS
  • QR
  • Vendor
  • Commission
  • Crypto Utilities

SDK Quick Start

The @bucksbox/sdk is the official Node.js client for the BucksBox platform. It handles AES-256-GCM encryption, HMAC signing, JWT management, and response decryption automatically.

Installation

npm install @bucksbox/sdk

Requires Node.js ≥ 18.

Setup

const { BucksBoxClient } = require('@bucksbox/sdk');

const client = new BucksBoxClient({
  gatewayUrl:       'https://api.bucksbox.in/gateway',       // staging: https://api.bucksbox.in/gateway-stage
  paymentSystemUrl: 'https://<paymentSystem-host>',           // ask your integration contact — not fixed in this documentation set
  clientId:         'your-client-id',
  aesKey:           'your-64-char-hex-aes-key',
  checksumSecret:   'your-hmac-secret',
});

Login

await client.auth.login({ email: 'vendor@example.com', password: 'password' });
// Token is stored automatically — all subsequent calls use it

DMT Example

// 1. Register remitter
const remitter = await client.dmt.registerRemitter({
  sender_mobilenumber: '9876543210',
  firstName: 'Ravi',
  lastName:  'Kumar',
});

// 2. Add beneficiary
const bene = await client.dmt.addBeneficiary({
  senderId:            remitter.data.senderId,
  receiver_account_no: '1234567890',
  receiverIfscCode:    'HDFC0001234',
  account_holder_name: 'Priya Sharma',
});

// 3. Verify account (penny-drop)
const verify = await client.dmt.accountVerification({
  senderId:            remitter.data.senderId,
  benefId:             bene.data.benefId,
  receiver_account_no: '1234567890',
  receiverIfscCode:    'HDFC0001234',
  account_holder_name: 'Priya Sharma',
});

if (verify.data.status === 1) {
  // 4. Transfer
  const txn = await client.dmt.instantTransfer({
    senderId: remitter.data.senderId,
    benefId:  bene.data.benefId,
    amount:   500,
  });
  console.log('UTR:', txn.data.utr);
}

AEPS Example

// Daily auth (required once per day)
await client.aeps.merchantAuth({
  merchantId: 'M-uuid',
  latitude:   '19.0760',
  longitude:  '72.8777',
  pidData:    '<base64-biometric>',
});

// Cash withdrawal
const result = await client.aeps.cashWithdrawal({
  merchantId:    'M-uuid',
  aadhaarNumber: '9999-9999-9999',
  bankIin:       '607086',
  amount:        1000,
  pidData:       '<base64-biometric>',
});

QR Example

const qr = await client.qr.generateQr({
  amount:     250,
  merchantId: 'M-uuid',
  orderId:    'ORD-001',
});

// Display qr.data.qrImage to customer, then poll:
const status = await client.qr.checkQrStatus({ orderId: 'ORD-001' });

Available Modules

ModuleAccessDescription
Authclient.authLogin, OTP, registration
Vendorclient.vendorProfile, balance, merchants, transactions
Walletclient.walletWallet CRUD and statements
DMTclient.dmt21 DMT operations
AEPSclient.aeps15 AEPS operations
QRclient.qr2 QR/UPI operations
Commissionclient.commissionCommission config CRUD
Next
Configuration