> ## Documentation Index
> Fetch the complete documentation index at: https://integrations.docs.commenda.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Payment made by a business at the time of purchase (ex. a credit card payment).

**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

### Expenses Attributes

| Property                  | Type    | Description                                                                 |
| ------------------------- | ------- | --------------------------------------------------------------------------- |
| `rootfi_id`               | integer | Unique identifier assigned by Commenda for this expense                     |
| `rootfi_created_at`       | string  | Timestamp when this record was created in Commenda's system (ISO 8601)      |
| `rootfi_updated_at`       | string  | Timestamp when this record was last updated in Commenda's system (ISO 8601) |
| `rootfi_integration_type` | enum    |                                                                             |
| `platform_id`             | string  | Unique identifier for this expense in the source accounting platform        |
| `document_number`         | string  | The document number of the expense                                          |
| `currency_id`             | enum    | The ISO-4217 currency code of the expense                                   |
| `currency_rate`           | double  | The currency rate of the expense                                            |
| `memo`                    | string  | The memo or notes of the expense                                            |
| `account_id`              | string  | The account ID of the expense                                               |
| `payment_mode`            | string  | The payment mode of the expense                                             |
| `posted_date`             | string  | The posted date of the expense                                              |
| `sub_total`               | double  | The sub total of the expense                                                |
| `tax_amount`              | double  | The tax amount of the expense                                               |
| `total_discount`          | double  | The total discount of the expense                                           |
| `total_amount`            | double  | The total amount of the expense                                             |
| `contact_id`              | string  | The contact ID of the expense                                               |
| `updated_at`              | string  | The date and time the expense was last updated                              |

## Expandable Attributes

Use the `expand` query parameter to include related objects:

* `expand=line_items` — includes the related Line Items object(s).
* `expand=documents` — includes the related Documents object(s).

## Properties Supported

Fields accepted when creating or updating a record:

| Property          | Type   | Description                                                          |
| ----------------- | ------ | -------------------------------------------------------------------- |
| `platform_id`     | string | Unique identifier for this expense in the source accounting platform |
| `document_number` | string | The document number of the expense                                   |
| `currency_id`     | enum   | The ISO-4217 currency code of the expense                            |
| `currency_rate`   | double | The currency rate of the expense                                     |
| `memo`            | string | The memo or notes of the expense                                     |
| `account_id`      | string | The account ID of the expense                                        |
| `payment_mode`    | string | The payment mode of the expense                                      |
| `posted_date`     | string | The posted date of the expense                                       |
| `sub_total`       | double | The sub total of the expense                                         |
| `tax_amount`      | double | The tax amount of the expense                                        |
| `total_discount`  | double | The total discount of the expense                                    |
| `total_amount`    | double | The total amount of the expense                                      |
| `contact_id`      | string | The contact ID of the expense                                        |
| `updated_at`      | string | The date and time the expense was last updated                       |
