Invoice
TheInvoice interface represents a complete invoice document with customer information, line items, and metadata.
Unique identifier for the invoice
Human-readable invoice number (e.g., “INV-001”)
Invoice issue date in ISO 8601 format
Payment due date in ISO 8601 format
Current status of the invoice. One of:
draft- Invoice is being preparedsent- Invoice has been sent to customerpaid- Payment has been receivedcancelled- Invoice has been cancelled
Optional notes or terms to display on the invoice
Optional global tax rate as a percentage (e.g., 10 for 10%)
Three-letter ISO 4217 currency code (e.g., “USD”, “EUR”, “GBP”)
Timestamp when the invoice was created in ISO 8601 format
Timestamp when the invoice was last updated in ISO 8601 format
TypeScript definition
Example
InvoiceItem
TheInvoiceItem interface represents a single line item on an invoice.
Unique identifier for the line item
Description of the product or service
Quantity of items or hours worked
Price per unit in the invoice’s currency
Optional discount percentage (e.g., 5 for 5% off)
Optional tax rate specific to this item as a percentage (e.g., 10 for 10%)
TypeScript definition
Example
Calculations
Line item calculations are performed as follows:- Line total =
quantity × rate - After discount = Line total × (1 -
discount/ 100) - Tax amount = After discount × (
taxRate/ 100) - Final amount = After discount + Tax amount