Skip to content
GitHub (opens in a new tab)

InvoiceDocument

A document view for an invoice or a credit note.

stableOrganismcontracts/invoicedocument.json

Preview

InvoiceDocument

A document view for an invoice or a credit note, not a PDF engine.

Master

An issued invoice. Variants shows each status, with its badge, solid primary and footnote.

Invoice INV-2026-0117

Issued

Northwind Ledger Ltd · example issuer

Bill to
Acme Co · 12 Example St
Issued
01 Nov 2026
Due
15 Nov 2026
DescriptionQtyUnitAmount
Pro plan · Nov 20261$480.00$480.00
Extra seats3$24.00$72.00
AI credits top-up2$50.00$100.00
Subtotal
$652.00
Tax 20%
$130.40
Total
$782.40

Usage

One solid primary at most: Issue invoice on a draft, Record payment when issued or overdue. A credit note names the invoice it reduces. Money arrives pre-formatted, so currency and locale stay with the app. All data here is an example.

Do's

  • show one invoice or credit note inside the product
  • issue, send or record payment on an invoice
  • show what a credit note reduces

Don'ts

  • a list of charges over time — the billing-schedule pattern
  • a generic data table — DataTable
  • printing or generating PDFs
<InvoiceDocument
  number="INV-2026-0117"
  status="issued"
  from="Northwind Ledger Ltd · example issuer"
  to="Acme Co · 12 Example St"
  issuedOn="01 Nov 2026"
  dueOn="15 Nov 2026"
  lines={lines}
  subtotal="$652.00"
  taxLabel="Tax 20%"
  tax="$130.40"
  total="$782.40"
  onDownload={download}
  onSend={send}
  onRecordPayment={record}
/>

A document view for an invoice or a credit note, not a PDF engine: header with status and actions, bill-to and dates, line items, totals and one line about payment. A credit note always names the invoice it reduces. Built on kit Table, Badge, Button and Empty.

When to use

  • show one invoice or credit note inside the product
  • issue, send or record payment on an invoice
  • show what a credit note reduces

When not to use

  • a list of charges over time — the billing-schedule pattern
  • a generic data table — DataTable
  • printing or generating PDFs

What an agent reads

import { InvoiceDocument } from "agentic-ds-kit";
must
  • article aria-labelledby the h3 ("Invoice INV-…")
  • status is a word in a kit Badge
  • bill-to, dates and totals are description lists
  • lines are a kit Table
  • the footnote states paid, overdue or voided in words
  • void dims the lines and strikes through the total; the badge and footnote say Void
  • below 30rem of width the Table keeps its four columns for screen readers; Qty and Unit show as one line under the description
  • Pay is named with the amount (Pay $889.68)
defaults
  • kind invoice
  • status draft
  • taxLabel Tax
  • loading false
stops if
  • Do not invent a local InvoiceView or CreditNoteCard
  • Do not show a credit note without the invoice it reduces
  • Do not show more than one solid primary
  • Do not use raw hex

From contracts/invoicedocument.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
kindinvoice | creditNoteNoinvoice—
numberstringYes——
statusenumNodraftestimate: the next invoice before the period closes. Badge Estimate, total reads Estimated total, no pay or record action. estimate | draft | issued | paid | overdue | void
fromstringNo——
tostringYes——
issuedOnstringYes——
dueOnstringNo——
periodstringNo—Billing period, e.g. "1–30 Nov 2026".
relatedInvoiceIdstringNo—Credit notes: the invoice it reduces.
linesarrayYes—{ id, description, quantity, unitPrice, amount }[]; money pre-formatted.
subtotalstringYes——
taxLabelstringNoTax—
taxstringNo——
totalstringYes——
footnotestringNo—Paid on, overdue reminder, voided, estimate as of, or what the credit note reduces; the icon follows the status (paid check, issued and estimate clock, overdue warning, void cross).
onDownloadfunctionNo——
onSendfunctionNo——
onIssuefunctionNo—Draft: Issue invoice, the solid primary.
onRecordPaymentfunctionNo—Issued or overdue: Record payment, the solid primary.
onPayfunctionNo—Issued or overdue, the customer's view: Pay {total}, the solid primary. Wins over onRecordPayment.
loadingbooleanNofalse—
errorstringNo——
onRetryfunctionNo——
  • Pattern
    →

    Billing schedule

    Next charge, a failed-payment notice, and every charge with its status.

  • Component
    →

    DataTable

    Framed dataset with search, filters, column settings, and a caption title.

  • Component
    →

    Empty

    Placeholder when a list, page, or region has nothing to show.

  • Component
    →

    Table

    Simple semantic table for invoices, lists, and text rows, with optional sort, row menu, sticky header, loading, empty and error states, row dividers on or off, and one optional highlighted row.