TypeScript SDK
for Peppol E-Invoicing
The official TypeScript SDK for e-invoice.be. Full type safety, autocomplete, and promise-based async/await for Node.js, Deno, and Bun.
npm install e-invoice-apiWhat is e-invoice.be?
e-invoice.be is a recognized Peppol Access Point and SMP operating under the Belgian Peppol Authority (BOSA). We enable businesses worldwide to send and receive electronic invoices via the Peppol network.
Our API lets you send invoices from JSON, upload pre-generated UBL XML, create invoices from PDF files, or integrate via our reseller programme. The TypeScript SDK makes integrating with our API seamless and type-safe.
Instant Delivery
E-invoices delivered instantly via Peppol
Peppol Compliant
Automatic UBL BIS Billing 3.0 conversion
Real-time Validation
Validate invoices before sending
Quick Start
Get up and running in minutes with our TypeScript SDK.
1. Install the SDK
npm install e-invoice-api
2. Usage
import EInvoice from 'e-invoice-api';
const client = new EInvoice({
apiKey: process.env['E_INVOICE_API_KEY'], // This is the default and can be omitted
});
const documentResponse = await client.documents.create();
console.log(documentResponse.id);Request & Response types
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
import EInvoice from 'e-invoice-api';
const client = new EInvoice();
const params: EInvoice.DocumentListParams = {
limit: 10,
};
const page = await client.documents.list(params);Auto-pagination
List methods in the EInvoice API are paginated. You can use the for await … of syntax to iterate through items across all pages:
// Iterate through all documents with auto-pagination
for await (const document of client.documents.list()) {
console.log(document.id);
}Features
TypeScript Definitions
Full TypeScript definitions included. Get autocomplete, type checking, and inline documentation in your IDE.
Promise-based API
Modern async/await syntax for all API calls. Works seamlessly with any async workflow.
Auto-retry with Backoff
Automatic retry logic with exponential backoff for transient failures. Configurable max retries.
Auto-pagination
Use async iterators to automatically paginate through large result sets without manual cursor management.
Built-in Error Handling
Typed error classes for different failure scenarios. Easily catch and handle validation, auth, and network errors.
Multi-runtime Support
Works in Node.js 20+, Deno, Bun, Cloudflare Workers, and Vercel Edge Runtime.
Start integrating today
Get your API key and start sending e-invoices in minutes. Our documentation has everything you need to get started.