NexusKit

Docs

Invoices

Digital and printable invoices with auto-numbering, line items, tax support, and email delivery.

Overview

The Invoice module generates professional invoices with auto-numbering, line items, optional flat tax, and multi-currency support. Each invoice gets a printable HTML view you can open in a browser and print to PDF. Optionally email invoices directly to customers. Export all invoices as CSV for accounting. All amounts are stored in cents for precision.

API Endpoints

MethodEndpointAuthDescription
GET/v1/invoicesBearerList all invoices
POST/v1/invoicesBearerCreate a new invoice
GET/v1/invoices/:idBearerGet a single invoice
GET/v1/invoices/:id/printBearerGet HTML print view of an invoice
PATCH/v1/invoices/:idBearerUpdate invoice status
GET/v1/invoices/export.csvBearerExport all invoices as CSV

Create an Invoice

Create an invoice with buyer details, line items, optional tax, and currency. Optionally set sendTo to email the invoice automatically.

POST /v1/invoices
Authorization: Bearer nk_live_...

{
  "buyer": {
    "name": "Acme Corp",
    "email": "[email protected]"
  },
  "lineItems": [
    { "description": "Website design", "quantity": 1, "unitCents": 50000 },
    { "description": "Hosting (12 months)", "quantity": 12, "unitCents": 1500 }
  ],
  "currency": "EUR",
  "taxCents": 10300,
  "sendTo": "[email protected]"
}

// Response:
{
  "id": "...",
  "number": "INV-00001",
  "subtotalCents": 68000,
  "taxCents": 10300,
  "totalCents": 78300,
  "currency": "EUR",
  "status": "issued"
}

Line Items & Tax

Each line item has a description, quantity, and unitCents (price per unit in cents). The subtotal is calculated automatically. TaxCents is a flat amount added to the subtotal. All arithmetic uses integer cents to avoid floating-point rounding issues.

Print View

Get a server-side rendered HTML invoice with clean typography. Open it in a browser and print to PDF.

GET /v1/invoices/{id}/print
Authorization: Bearer nk_live_...

// Returns: text/html
// Open in browser: window.open('/v1/invoices/{id}/print')
// Or print directly: print()

Email Delivery

Set the sendTo field when creating an invoice to automatically email the HTML invoice to your customer. The email is sent via the mail queue. You can also send an existing invoice by updating it with a sendTo value.

Auto-Numbering

Each tenant gets an auto-incrementing invoice sequence starting at 00001. The prefix defaults to INV but is configurable. Numbers are zero-padded to 5 digits: INV-00001, INV-00002, INV-00003, and so on. Numbers are unique per tenant and never reused.

FAQ

How does auto-numbering work?

Each tenant gets a sequence starting at 00001. The prefix defaults to INV but is configurable. Numbers are zero-padded to 5 digits (INV-00001, INV-00002, etc.).

Is NexusKit Invoicing free?

Yes, within fair-use limits. No monthly caps on invoice creation — just rate limits on the API (120 RPM).

Can I send invoices by email?

Yes. Set the sendTo field when creating an invoice. The HTML invoice is sent via the mail queue automatically.

What does the print view look like?

Clean, professional HTML with Georgia serif font, styled table layout, and formatted currency. Open in browser and print to PDF.

Ready to send invoices?

Start free. No credit card. Issue your first invoice in minutes.