Skip to main content
The Expenses Data Model represents a payment made by a business at the time of purchase. This unified model streamlines the management and retrieval of expense-related information across various accounting platforms.
  • Unified expense properties: Essential expense information, including document numbers, posted dates, payment modes, and currency details, are standardized across different accounting platforms
  • Contact and account relationships: Expenses can be easily linked to specific contacts and accounts using their respective platform IDs, allowing for efficient organisation and reporting
  • Line item support: The inclusion of line items within the expense data model enables more granular and detailed expense management, as well as the ability to track individual components of an expense
  • Currency conversion: The currency_rate property supports multi-currency scenarios by providing the conversion rate between the expense currency and the base currency, ensuring accurate financial reporting across various currencies

Attributes

Expense Attributes

PropertyTypeDescription
rootfi_idintegerUnique identifier assigned by Commenda for this expense
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 expense belongs to within Commenda
platform_idstringUnique identifier for this expense in the source accounting platform
platform_unique_idstringAlternative unique identifier from the platform (some platforms provide multiple IDs)
contact_idstringThe contact ID of the expense
account_idstringThe account ID of the expense
currency_idstringThe ISO-4217 currency code of the expense
document_numberstringThe document number of the expense
posted_datestringThe posted date of the expense
payment_modestringThe payment mode of the expense
currency_ratedoubleThe currency rate of the expense
total_amountdoubleThe total amount of the expense
sub_totaldoubleThe sub total of the expense
tax_amountdoubleThe tax amount of the expense
total_discountdoubleThe total discount of the expense
memostringThe memo or notes of the expense
updated_atstringThe date and time the expense was last updated
line_itemsarrayThe line items of the expense

Expandable Attributes

Use the expand query parameter to include related objects:
  • expand=contact - Includes full Contact object details
  • expand=account - Includes full Account object details
  • expand=currency - Includes full Currency object details
  • expand=documents - Includes all Document objects attached to the expense
  • expand=line_items - Includes detailed LineItem objects

Properties Supported

PropertyTypeDescription
platform_idstringThe Platform’s ID of the expense
contact_idstringThe contact ID of the expense
account_idstringThe account ID of the expense
currency_idstringThe ISO-4217 currency code of the expense
document_numberstringThe document number of the expense
posted_datestringThe posted date of the expense
payment_modestringThe payment mode of the expense
currency_ratedoubleThe currency rate of the expense
total_amountdoubleThe total amount of the expense
sub_totaldoubleThe sub total of the expense
tax_amountdoubleThe tax amount of the expense
total_discountdoubleThe total discount of the expense
memostringThe memo or notes of the expense
line_itemsarrayThe line items of the expense
updated_atstringThe date and time the expense was last updated

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": "co_UVH2BXam9VXbtZzJXa4Ctr",
  "account_id": "acc_56S9s4tRcvkHJBCrgzj3YM",
  "currency_id": "AED",
  "document_number": "AO-123",
  "posted_date": "2023-06-03T00:00:00.000Z",
  "payment_mode": "cash",
  "currency_rate": 1.5,
  "total_amount": 400.0,
  "sub_total": 400.0,
  "tax_amount": 2.5,
  "total_discount": 0.0,
  "memo": "This is a test expense",
  "updated_at": "2023-06-03T00:00:00.000Z",
  "line_items": []
}