Models
Invoice
Documentation for the Invoice document model
Overview
The Invoice model extracts and structures information from invoices, capturing comprehensive details including vendor and customer information, line items, payment details, and tax information.
Schema Structure
Root Level Fields
Field | Type | Description |
---|---|---|
CustomerName | string? | Customer being invoiced |
CustomerId | string? | Reference ID for the customer |
PurchaseOrder | string? | Purchase order reference number |
InvoiceId | string? | Invoice number or identifier |
InvoiceDate | string? | Date the invoice was issued |
DueDate | string? | Due date for payment |
VendorName | string? | Name of the vendor issuing the invoice |
VendorAddress | Address? | Mailing address for the vendor |
VendorAddressRecipient | string? | Name associated with the vendor address |
CustomerAddress | Address? | Mailing address for the customer |
CustomerAddressRecipient | string? | Name associated with the customer address |
BillingAddress | Address? | Explicit billing address |
BillingAddressRecipient | string? | Name associated with the billing address |
ShippingAddress | Address? | Explicit shipping address |
ShippingAddressRecipient | string? | Name associated with the shipping address |
SubTotal | number? | Subtotal amount |
TotalDiscount | number? | Total discount amount |
TotalTax | number? | Total tax amount |
InvoiceTotal | number? | Total invoice amount |
AmountDue | number? | Total amount due |
PreviousUnpaidBalance | number? | Previous unpaid balance |
RemittanceAddress | Address? | Explicit remittance address |
RemittanceAddressRecipient | string? | Name associated with the remittance address |
ServiceAddress | Address? | Explicit service address |
ServiceAddressRecipient | string? | Name associated with the service address |
ServiceStartDate | string? | First date of service period |
ServiceEndDate | string? | End date of service period |
VendorTaxId | string? | Tax ID of the vendor |
CustomerTaxId | string? | Tax ID of the customer |
PaymentTerm | string? | Payment terms |
KVKNumber | string? | KVK number for Netherlands businesses |
Line Item Fields
Each item in the Items
array contains:
Field | Type | Description |
---|---|---|
Amount | number? | Total amount for this line item |
Date | string? | Date corresponding to the line item |
Description | string? | Item description |
Quantity | number? | Quantity of each item |
ProductCode | string? | Product code or SKU |
Tax | number? | Tax amount for this line item |
TaxRate | string? | Tax rate for this line item |
Unit | string? | Unit of measure |
UnitPrice | number? | Price per unit |
Tax Detail Fields
Each tax detail in the TaxDetails
array contains:
Field | Type | Description |
---|---|---|
Amount | number? | Tax amount |
Rate | string? | Tax rate as a percentage |
Payment Detail Fields
Each payment detail in the PaymentDetails
array contains:
Field | Type | Description |
---|---|---|
IBAN | string? | International bank account number |
SWIFT | string? | SWIFT/BIC code |
BankAccountNumber | string? | Bank account number |
BPayBillerCode | string? | BPay biller code |
BPayReference | string? | BPay reference number |
Installment Fields
Each installment in the PaidInFourInstallements
array contains:
Field | Type | Description |
---|---|---|
Amount | number? | Installment amount |
DueDate | string? | Due date for the installment |
Type Definitions
Validation Rules
Basic Validation
- All fields are optional by default
- Arrays (PaymentDetails, TaxDetails, Items, PaidInFourInstallements) default to empty arrays if not specified
Strict Validation
The following fields are required in strict mode:
- InvoiceId
- InvoiceDate
- CustomerName
- InvoiceTotal
- Items (minimum 1 item)
Example Usage
Date Handling
The model accepts dates in multiple formats:
- ISO 8601 datetime strings
- YYYY-MM-DD format strings
All dates are converted to ISO format during validation.