number | string | no | required once status is not draft; unique per workspace when receivable, per counterparty when payable |
direction | enum(receivable|payable) | yes | a bill is a payable Invoice; default receivable |
counterparty | Ref<Organization | Person> | yes | |
bill_to | Address | no | the billing address as printed; defaults from the counterparty |
status | Status(draft|open|paid|void|uncollectible) | yes | default map[category:draft] |
issued_at | date | yes | |
due_at | date | no | due_at or terms is given when amount_due is above zero |
terms | string | no | payment terms as text, e.g. Net 30 |
currency | string | yes | ISO 4217; every Money on the invoice uses it; pattern ^[A-Z]{3}$ |
tax_inclusive | bool | yes | default false |
lines | object[] | yes | {product?: Ref<Product>, price?: Ref<Price>, description: string, quantity: decimal, unit?: string, unit_price: Money, discount?: Money, tax_rate?: Ref<Tax rate>, tax_amount?: Money, amount: Money, period?: Period} |
subtotal | Money | yes | the sum of lines.amount |
discount_total | Money | no | document-level discount |
tax_total | Money | yes | |
total | Money | yes | |
amount_paid | Money | yes | maintained from applied Payments |
amount_due | Money | yes | total minus amount_paid |
paid_at | datetime | no | |
reference | string | no | the buyer's PO or reference |
memo | text | no | a customer-facing note printed on the invoice |
subscription | Ref<Subscription> | no | |
about | Ref<any>[] | no | the Deal, the Project |