Skip to content

LightSpeedPlusOne/invovate-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

invovate

Official JavaScript / TypeScript client for the Invovate invoice API. Generate PDF, JSON, or UBL 2.1 invoices in 11 languages (incl. Arabic RTL, Japanese, Hindi, Cyrillic) from one call. Zero dependencies — uses the built-in fetch (Node 18+, Bun, Deno, Cloudflare Workers, browsers).

npm install invovate

Quick start

import { Invovate } from 'invovate';

// JSON totals work WITHOUT a key. PDF, UBL, QR codes, and hosted/shareable links
// require a free API key (inv_…) — get one instantly, no card, at https://invovate.com/auth
const client = new Invovate({ apiKey: process.env.INVOVATE_API_KEY });

// 1) Compute totals (no key needed)
const totals = await client.calculateTotals({
  from: { name: 'Acme LLC' },
  to:   { name: 'Globex Corp' },
  currency: 'USD',
  items: [{ description: 'Consulting', quantity: 2, unit_price: 150, tax_rate: 10 }],
});
console.log(totals.grand_total); // 330

// 2) Get a downloadable PDF link (requires a free API key)
const { hostedUrl } = await client.createPdfLink({
  from: { name: 'Acme BV', tax_id: 'NL0012' },
  to:   { name: 'Client KK' },
  language: 'nl', currency: 'EUR', template: 'modern',
  items: [{ description: 'Onderhoud', quantity: 1, unit_price: 450, tax_rate: 21 }],
});
console.log(hostedUrl); // https://invovate.com/api/i/...  (renders the PDF, valid 7 days)

With an API key (direct file bytes)

const pdf = await client.createPdf({ from, to, items, output: 'pdf' }); // Uint8Array
import { writeFile } from 'node:fs/promises';
await writeFile('invoice.pdf', pdf);

const xml = await client.createUbl({ from, to, items }); // UBL 2.1 XML string

API

Method Returns Key
calculateTotals(invoice) totals object no
createPdfLink(invoice) { hostedUrl, invoice } (7-day link) no
createPdf(invoice) Uint8Array (PDF bytes) yes
createUbl(invoice) UBL 2.1 XML string yes
batch(invoices) batch result (≤ 50) yes
generate(invoice, { output, hostedLink, idempotencyKey }) low-level

Idempotent retries: pass { idempotencyKey: 'your-key' } to any generate call.

Errors throw InvovateError with .status, .code, .requestId.

Notes

  • Languages: en, nl, de, fr, es, it, pt, ar, ja, ru, hi. Templates: classic, modern, bold, minimal, navy.
  • Money: ISO 4217 codes; per-line tax_rate (%), or taxes: [{name, rate}] for multi-component (CGST+SGST/VAT).
  • Not regulated e-invoicing. UBL is for interoperability/archival — no Peppol/Factur-X/XRechnung/NF-e compliance.

Docs: https://invovate.com/api · AI agents: https://invovate.com/invoice-api-for-ai-agents · MCP server: https://invovate.com/mcp-invoice-generator

License

MIT © Invovate

About

Official JavaScript/TypeScript client for the Invovate invoice API — PDF, JSON & UBL invoices in 11 languages. Zero deps.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors