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

Configuration

BucksBoxClient Options

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

const client = new BucksBoxClient({
  gatewayUrl:       'https://api.bucksbox.in/gateway',  // required — staging: https://api.bucksbox.in/gateway-stage
  paymentSystemUrl: 'https://<paymentSystem-host>',      // required — ask your integration contact, not fixed in this documentation set
  clientId:         'your-client-id',                    // required
  aesKey:           'your-64-char-hex-aes-256-key',      // required
  checksumSecret:   'your-hmac-secret',                  // required
  token:            'existing-jwt',                      // optional — skip login
  timeout:          30000,                               // optional — ms, default 30000
});
OptionTypeRequiredDescription
gatewayUrlstringYesfintech-gateway base URL — production https://api.bucksbox.in/gateway, staging https://api.bucksbox.in/gateway-stage
paymentSystemUrlstringYespaymentSystem base URL
clientIdstringYesIssued by your aggregator
aesKeystringYes64 hex-char AES-256 key (32 bytes)
checksumSecretstringYesHMAC-SHA256 signing secret
tokenstringNoPre-existing JWT — skips auth.login()
timeoutnumberNoRequest timeout in ms (default: 30000)

Token Management

// Login stores the token automatically
await client.auth.login({ email, password });

// Replace token manually (e.g. after token refresh)
client.setToken(newToken);

// Clear on logout
client.clearToken();

Environment Example

Store credentials in environment variables — never hard-code them:

const client = new BucksBoxClient({
  gatewayUrl:       process.env.BUCKSBOX_GATEWAY_URL,
  paymentSystemUrl: process.env.BUCKSBOX_API_URL,
  clientId:         process.env.BUCKSBOX_CLIENT_ID,
  aesKey:           process.env.BUCKSBOX_AES_KEY,
  checksumSecret:   process.env.BUCKSBOX_CHECKSUM_SECRET,
});
Prev
Quick Start
Next
Auth