npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

carbon-baas-sdk

v1.0.4

Published

## Welcome to our API Developer Documentation Carbon aims to unlock the full potential of your business with a feature-rich account designed for growth. ## Integrations We aim to provide our APIs for developers and businesses to offer financial service

Readme

Carbon Business API SDK

This SDK provides a simple interface to interact with the Carbon Business API, allowing developers to integrate Carbon's financial services into their applications.

API Documentation

Postman

Installation

npm install carbon-baas-sdk

Configuration

Initialize the SDK with your API key and mode (live or sandbox):

CommonJS

const carbon = require('carbon-baas-sdk');

carbon.initialize('your_api_key_here', 'sandbox');

// Create an account for a third-party customer
carbon.createAccount({
  account_type: 'static',
  third_party: true,
  customer_id: 'customer_123'
})
  .then(response => console.log(response))
  .catch(error => console.error(error));

// Fetch an account
carbon.fetchAccount('account_number')
  .then(response => console.log(response))
  .catch(error => console.error(error));

// Fetch all accounts with pagination
carbon.fetchAccounts(1, 10) // page 1, limit 10
  .then(response => console.log(response))
  .catch(error => console.error(error));

ES Modules

import { initialize, createAccount, fetchAccount, fetchAccounts } from 'carbon-baas-sdk';

initialize('your_api_key_here', 'sandbox');

// Create an account for a third-party customer
const account = await createAccount({
  account_type: 'static',
  third_party: true,
  customer_id: 'customer_123'
});
console.log(account);

// Fetch an account
const accountDetails = await fetchAccount('account_number');
console.log(accountDetails);

// Fetch accounts
const accounts = await fetchAccounts(1, 10); // page 1, limit 10
console.log(accounts);
import { initialize } from 'carbon-baas-sdk';

initialize('your_api_key_here', 'sandbox');

API Reference

Authentication

initialize(apiKey: string, mode: 'live' | 'sandbox')

Accounts

createAccount(accountData: CreateAccountRequest)
// accountData: { 
//   account_type: "static",      // Must always be "static"
//   third_party?: boolean,       // true for third-party customer, false for own business sub-account (defaults to true)
//   customer_id?: string,        // Required if third_party is true
//   account_name?: string        // Required if third_party is false
// }

fetchAccount(accountNumber: string)

fetchAccounts(page?: number, limit?: number)

Customers

createCustomer(customerData: CreateCustomerRequest)
// customerData: {
//   first_name: string;
//   last_name: string;
//   email: string;
//   phone: string;
//   dob: string;
//   gender: string;
//   street: string;
//   city: string;
//   state: string;
//   country: string;
//   bvn: string;
//   nin: string;
// }

fetchCustomer(customerId: string)

fetchCustomers(page?: number, limit?: number)

Transactions

verifyTransaction(accountNumber: string, reference: string)

fetchTransactions(accountNumber: string, page?: number, limit?: number)

Payouts

initiatePayout(payoutData: InitiatePayoutRequest)
// payoutData: {
//   amount: number;
//   source: { account_number: string };
//   beneficiary: {
//     bank_code: string;
//     bank_name: string;
//     account_number: string;
//     account_name: string;
//   };
//   reference: string;
//   meta_data: object;
//   remark: string;
// }

fetchPayout(payoutId: string)

Banks

fetchBanks()

resolveAccount(accountData: ResolveAccountRequest)
// accountData: { account_number: string, bank_code: string }

fetchBanksUptime()

Webhooks

fetchWebhook()

updateWebhook(data: UpdateWebhookRequest)
// data: { url: string }

fetchWebhookHistory(page?: number, limit?: number)

resendWebhookEvent(eventId: string)

Example Usage

Managing Accounts

import { createAccount, fetchAccount, fetchAccounts } from 'carbon-baas-sdk';

// Create an account for a third-party customer
const newCustomerAccount = await createAccount({
  account_type: 'static',
  third_party: true,
  customer_id: 'customer_123'
});

// Create a sub-account for your own business (for collections)
const newSubAccount = await createAccount({
  account_type: 'static',
  third_party: false,
  account_name: 'Collections'
});

// Fetch account details
const accountDetails = await fetchAccount('1234567890');

// Fetch all accounts (with pagination)
const accounts = await fetchAccounts(1, 20); // page 1, 20 items per page

Managing Customers

import { createCustomer, fetchCustomer } from 'carbon-baas-sdk';

// Create a customer
const customerData = {
  first_name: 'John',
  last_name: 'Doe',
  email: '[email protected]',
  phone: '2348012345678',
  dob: '1990-01-01',
  gender: 'male',
  street: '123 Main St',
  city: 'Lagos',
  state: 'Lagos',
  country: 'Nigeria',
  bvn: '12345678901',
  nin: '12345678901'
};

const newCustomer = await createCustomer(customerData);

// Fetch customer details
const customerDetails = await fetchCustomer('customer_id');

Managing Webhooks

import { resendWebhookEvent, fetchWebhookHistory } from 'carbon-baas-sdk';

// Resend webhook event
const webhook = await resendWebhookEvent(eventId);

// Fetch webhook history
const history = await fetchWebhookHistory(1, 10);

Bank Operations

import { fetchBanks, resolveAccount, fetchBanksUptime } from 'carbon-baas-sdk';

// Fetch all banks
const banks = await fetchBanks();

// Resolve account
const accountDetails = await resolveAccount({
  account_number: '1234567890',
  bank_code: '058'
});

// Check banks uptime
const uptime = await fetchBanksUptime();

Error Handling

The SDK uses a consistent error handling pattern. All API calls return a response object that includes status and error information when applicable:

try {
  const result = await createCustomer(customerData);
  if (result.status === 'failed') {
    console.error('API Error:', result.message, result.errors);
  } else {
    console.log('Success:', result.data);
  }
} catch (error) {
  console.error('Request failed:', error);
}

License

This project is licensed under the MIT License.