Skip to main content
The Invoices Data Model represents an itemized record of goods sold or services provided to a customer. This unified model simplifies handling invoice-related information across different accounting platforms.
  • Unified invoice properties: Essential invoice details like document number, due date, currency, status, and total amounts are standardized across different accounting platforms
  • Linked entities: Invoices can be associated with contacts, line items, payments, and sales orders, providing a complete view of the invoicing process and related transactions
  • Flexible status tracking: The model supports a range of invoice statuses, such as draft, submitted, partially paid, and overdue, for better organisation and reporting

Attributes

Invoice Attributes

PropertyTypeDescription
rootfi_idintegerUnique identifier assigned by Commenda for this invoice
rootfi_created_atstringTimestamp when this record was created in Commenda’s system (ISO 8601)
rootfi_updated_atstringTimestamp when this record was last updated in Commenda’s system (ISO 8601)
rootfi_company_idintegerCompany identifier this invoice belongs to within Commenda
platform_idstringUnique identifier for this invoice in the source accounting platform
platform_unique_idstringAlternative unique identifier from the platform (some platforms provide multiple IDs)
contact_idstringThe contact ID of the invoice
currency_idstringThe currency ID of the invoice
document_numberstringThe document number of the invoice
posted_datestringThe posted date of the invoice
due_datestringThe due date of the invoice
statusenumThe status of the invoice
total_discountdoubleThe total discount of the invoice
sub_totaldoubleThe sub total of the invoice
tax_amountdoubleThe tax amount of the invoice
total_amountdoubleThe total amount of the invoice
amount_duedoubleThe amount due of the invoice
memostringThe memo or notes of the invoice
updated_atstringThe date and time the invoice was last updated
currency_ratedoubleThe currency rate of the invoice
sales_order_idsarrayThe sales order IDs associated with the invoice
line_itemsarrayThe line items of the invoice

Status Enum Values

ValueDescription
draftInvoice is in draft status and has not been finalized
submittedInvoice has been submitted but not yet paid
partially_paidInvoice has received partial payment
paidInvoice has been fully paid
overdueInvoice has passed its due date without payment
voidInvoice has been voided or cancelled
unknownStatus cannot be determined from the platform

Expandable Attributes

Use the expand query parameter to include related objects:
  • expand=currency - Includes full Currency object details
  • expand=line_items - Includes detailed LineItem objects
  • expand=contact - Includes full Contact object details
  • expand=documents - Includes all Document objects attached to the invoice
  • expand=invoice_payments - Includes all InvoicePayment objects associated with the invoice

Properties Supported

PropertyTypeDescription
platform_idstringThe Platform’s ID for the invoice
contact_idstringThe contact ID of the invoice
currency_idstringThe currency ID of the invoice
document_numberstringThe document number of the invoice
posted_datestringThe posted date of the invoice
due_datestringThe due date of the invoice
statusenumThe status of the invoice
total_discountdoubleThe total discount of the invoice
sub_totaldoubleThe sub total of the invoice
tax_amountdoubleThe tax amount of the invoice
total_amountdoubleThe total amount of the invoice
amount_duedoubleThe amount due of the invoice
memostringThe memo or notes of the invoice
currency_ratedoubleThe currency rate of the invoice
sales_order_idsarrayThe sales order IDs associated with the invoice
line_itemsarrayThe line items of the invoice

Addresses

PropertyTypeDescription
platform_idstringPlatform's ID for the address
typeenumThe type of address. Values are: BILLING, SHIPPING.
data_modelstringThe data model to which this address is linked. Values are COMPANY_INFO, CONTACTS, INVOICES, BILLS, EXPENSES, BILL_CREDIT_NOTES, INVOICE_CREDIT_NOTES, SALES_ORDERS, PURCHASE_ORDERS
data_model_idstringThe unique identifier for the data model associated with this address
streetstringThe street information of the address
localitystringThe locality or neighborhood information of the address
citystringThe city information of the address
statestringThe state or region information of the address
countrystringThe country information of the address
pincodestringThe postal or zip code of the address
updated_atdateThe date and time at which the address information was last updated in the accounting platform

Line Items

PropertyTypeDescription
platform_idstringPlatform ID associated with this line item
item_idstringThe platform ID of the item associated with this line item
tax_idstringThe platform ID of the tax associated with this line item
account_idstringThe platform ID of the account associated with this line item
line_item_typeenumThe data model linked to the line item. Values are: BILLS, INVOICES, INVOICE_CREDIT_NOTES, BILL_CREDIT_NOTES, EXPENSES, PURCHASE_ORDERS,SALES_ORDERS,GOODS_RECEIPT_NOTES
line_item_type_idstringThe platform ID of the associated data model
descriptionstringThe description for this line item
quantityfloatThe quantity of the product/service for this line item
unit_amountfloatPrice per unit for this line item
sub_totalfloatThe pre tax total value for this line item
tax_amountfloatThe tax amount for this line item
total_amountfloatThe total value of this line item
tracking_category_idsobjectThe tracking category Ids associated with this line item

Line Items Expandable Attributes

You can expand the following attributes to get the related line item data
PropertyData ModelDescription
itemItemsThe item associated with this line item
tax_rateTax RatesThe tax associated with this line item
accountAccountsThe account associated to the invoice
{
  "rootfi_id": 123,
  "rootfi_created_at": "2024-01-25T09:00:00Z",
  "rootfi_updated_at": "2024-01-25T09:00:00Z",
  "rootfi_company_id": 456,
  "platform_id": "123456_1",
  "platform_unique_id": "123456",
  "contact_id": "123456",
  "currency_id": "123456",
  "document_number": "INV-000001",
  "posted_date": "2024-01-25T09:00:00Z",
  "due_date": "2024-01-25T09:00:00Z",
  "status": "paid",
  "total_discount": 100.0,
  "sub_total": 1000.0,
  "tax_amount": 100.0,
  "total_amount": 1100.0,
  "amount_due": 0.0,
  "memo": "Thanks for your business.",
  "updated_at": "2024-01-25T09:00:00Z",
  "currency_rate": 1.0,
  "sales_order_ids": ["123456"],
  "line_items": []
}