getdoc-sdk
v0.1.0
Published
Official GetDoc SDK — render PDFs, QR codes, and compliant Factur-X/ZUGFeRD e-invoices (EN 16931) with one call.
Maintainers
Readme
getdoc-sdk
Official Node.js SDK for GetDoc — render PDFs, QR codes, and compliant Factur-X / ZUGFeRD e-invoices (EN 16931) with one call. Zero dependencies, Node ≥ 18, TypeScript types included.
npm install getdoc-sdkimport { GetDoc } from 'getdoc-sdk';
import { writeFile } from 'node:fs/promises';
const gd = new GetDoc({ apiKey: process.env.GETDOC_API_KEY });
// PDF from a built-in template
const pdf = await gd.pdf({
template: 'invoice',
data: { to: { name: 'Acme' }, total: 49, currency: 'USD',
items: [{ desc: 'Pro plan', amount: 49 }] },
});
await writeFile('invoice.pdf', pdf);
// QR code
const png = await gd.qr({ data: 'https://getdoc.dev', size: 400 });
// Compliant Factur-X e-invoice (Compliance plan) — validated before it's returned
const inv = await gd.einvoice({
invoice_number: 'INV-2026-0042',
issue_date: '2026-09-01',
seller: { name: 'My Company', vat_id: 'FR12345678901',
address: { city: 'Paris', country_code: 'FR' } },
buyer: { name: 'Acme GmbH', vat_id: 'DE811569869',
address: { city: 'Berlin', country_code: 'DE' } },
lines: [{ name: 'Consulting', quantity: 10, net_price: 100,
vat_category: 'S', vat_rate: 20 }],
});
await writeFile('facturx.pdf', inv.pdf); // PDF/A-3 with embedded XML
await writeFile('factur-x.xml', inv.xml); // the EN 16931 CII XML
console.log(inv.validation.status, inv.doc_hash);Errors throw GetDocError with status, code (e.g. quota_exceeded,
rate_limited, validation_failed), and — for e-invoice input problems —
issues[] naming the exact JSON field and how to fix it. 429/503 are retried
once automatically, honoring Retry-After.
- Docs: https://dashboard.getdoc.dev (Docs tab)
- OpenAPI spec: https://api.getdoc.dev/openapi.json
- MCP server (for AI assistants):
npx getdoc-mcp
