Integrations
Node.js SDK
The official Beliq SDK for Node.js and TypeScript. Generate, validate, parse, and convert EN 16931 e-invoices from your own code.
Available
The official Node/TypeScript SDK for Beliq. Every option enum is typed from the OpenAPI spec, so wrong values fail at compile time, and the content type is sniffed from the bytes (PDF versus XML) so you write less plumbing.
- Package:
@beliq/sdkon npm - Source: github.com/beliq-eu/beliq-sdk-node
Install
npm install @beliq/sdk
Requires Node.js 20.15 or newer. Ships ESM and CommonJS builds with bundled type declarations.
Authentication
Create an API key in the Beliq dashboard under Integration → API Keys, then pass it to the client:
import { Beliq } from '@beliq/sdk';
new Beliq({ apiKey: 'blq_...' }); // sends X-API-Key (default)
new Beliq({ apiKey: 'blq_...', auth: 'bearer' }); // sends Authorization: Bearer
new Beliq({ apiKey: 'blq_...', baseUrl: 'https://api.beliq.eu' }); // default; set only for a self-hosted endpointQuick start
import { Beliq } from '@beliq/sdk';
const beliq = new Beliq({ apiKey: process.env.BELIQ_API_KEY! });
// Account, plan, and quota context (no quota cost).
const account = await beliq.me();
// Generate an XRechnung document from an EN 16931 invoice object.
const generated = await beliq.generate({
standard: 'xrechnung',
verify: true,
invoice: {
number: 'INV-2026-001',
issueDate: '2026-01-15',
currencyCode: 'EUR',
seller: { name: 'Seller GmbH', address: { city: 'Berlin', postalCode: '10115', countryCode: 'DE' } },
buyer: { name: 'Buyer GmbH', address: { city: 'Munich', postalCode: '80331', countryCode: 'DE' } },
lines: [{ description: 'Consulting', quantity: 10, unitCode: 'HUR', unitPrice: 100, lineTotal: 1000, vatRate: 19, vatCategoryCode: 'S' }],
totalNetAmount: 1000,
totalTaxAmount: 190,
totalGrossAmount: 1190,
},
});
console.log(generated.xml, generated.meta.schematronVersion);
// Validate any document against authority-pinned rules.
const result = await beliq.validate(generated.xml!, { format: 'auto' });
if (!result.valid) {
for (const issue of result.errors) console.log(issue.ruleId, issue.message);
}Methods
| Method | Endpoint | Returns |
|---|---|---|
me() |
GET /v1/me |
AccountInfo (no quota cost) |
generate(input) |
POST /v1/generate |
{ contentType, bytes, xml?, meta } |
validate(document, options?) |
POST /v1/validate |
ValidationResult |
parse(document, options?) |
POST /v1/parse |
ParseResult |
convert(document, options) |
POST /v1/convert |
{ contentType, bytes, meta } |
document accepts a string, Uint8Array, Buffer, ArrayBuffer, or typed array. Errors throw BeliqApiError with a typed .code, HTTP .status, and any .details.
See also
- Quickstart: the underlying API in five minutes.
- Authentication: keys, quotas, and rate limits.
- API reference: full request and response schemas.