A modern, type-safe client for integrating with the SmartBill API. This package provides a comprehensive implementation for managing invoices, estimates, payments, and other business documents through the SmartBill platform.
- 🧾 Complete invoice management
- 📋 Estimate handling
- 💰 Payment processing
- 🛠️ Additional features
- Node.js 16+ or Bun runtime
- TypeScript 4.x+ (for type definitions)
- npm, yarn, pnpm, or bun package manager
Before installing, you need to configure your package manager to access the GitHub Packages registry.
First, create a GitHub Personal Access Token with the read:packages
permission. Add it to your package manager's configuration file.
- Create or edit
$HOME/.bunfig.toml
and add:
[install.scopes]
"@paulgeorge35" = { token = "your_github_token", url = "https://npm.pkg.github.com/" }
- Install the package:
bun add @paulgeorge35/smartbill@latest
- Create or edit
$HOME/.npmrc
and add:
//npm.pkg.github.com/:_authToken=your_github_token
- Install the package:
npm install @paulgeorge35/smartbill@latest
- Create or edit
$HOME/.yarnrc
and add:
//npm.pkg.github.com/:_authToken=your_github_token
- Install the package:
yarn add @paulgeorge35/smartbill@latest
- Create or edit
$HOME/.npmrc
and add:
//npm.pkg.github.com/:_authToken=your_github_token
- Install the package:
pnpm add @paulgeorge35/smartbill@latest
node
(>=16.0.0)
- For crypto module support
import { SmartBillClient } from 'smartbill';
// Initialize the client
const client = new SmartBillClient({
username: 'YOUR_USERNAME',
token: 'YOUR_TOKEN'
});
// Get payment status
const invoiceStatus = await client.invoice.getPaymentStatus({
companyVatCode: 'YOUR_COMPANY_VAT_CODE',
seriesName: 'YOUR_SERIES_NAME',
number: 'YOUR_NUMBER'
});
console.log(invoiceStatus);
// {
// success: true,
// data: {
// invoiceTotalAmount: 100,
// paidAmount: 0,
// unpaidAmount: 100,
// paid: false
// }
// }
username
: Your SmartBill usernametoken
: Your SmartBill token
create
: Create a new invoicegetPaymentStatus
: Get payment statusgetPdf
: Get invoice PDFdelete
: Delete an invoicereverse
: Reverse an invoicecancel
: Cancel an invoicerestore
: Restore an invoicesendToEmail
: Send an invoice to email
create
: Create a new paymentgetReceipt
: Get receipt contentdeleteReceipt
: Delete a receiptdelete
: Delete a payment
create
: Create a new estimategetInvoices
: Get list of invoices generated from an estimatedelete
: Delete an estimatecancel
: Cancel an estimaterestore
: Restore an estimate
getSeries
: Get list of configured document series
getStock
: Get list of stock
getTaxTypes
: Get list of configured tax types
All methods return a ApiResponse<T>
type with the following structure:
interface ApiResponse<T> {
success: boolean;
data?: T;
message?: string;
}
This project is licensed under the MIT License - see the LICENSE file for details.
Paul George - contact@paulgeorge.dev
Project Link: https://github.com/paulgeorge35/smartbill