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

> A record of goods or services purchased from a vendor.

The Bills Data Model represents a record of goods or services purchased from a vendor. This unified model simplifies handling bill-related information across various accounting platforms.

* **Unified bill properties**: Essential bill information such as vendor, account, dates, currency, and amounts are standardized across different accounting platforms
* **Status tracking**: The model supports tracking the status of a bill, including draft, submitted, partially paid, paid, overdue, void, or unknown, for better bill management and reporting
* **Relationship with other data models**: The model allows for the inclusion of associated line items, bill payments, and purchase orders, providing a complete picture of each bill
* **Currency conversion**: The `currency_rate` property allows for easy currency conversion between the payment currency and the base currency, ensuring accurate financial reporting and analysis

## Attributes

### Bills Attributes

| Property                  | Type    | Description                                                                 |
| ------------------------- | ------- | --------------------------------------------------------------------------- |
| `rootfi_id`               | integer | Unique identifier assigned by Commenda for this bill                        |
| `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 bill in the source accounting platform           |
| `document_number`         | string  | The document number of the bill                                             |
| `posted_date`             | string  | The posted date of the bill                                                 |
| `due_date`                | string  | The due date of the bill                                                    |
| `currency_id`             | enum    | ISO 4217 currency code                                                      |
| `currency_rate`           | double  | The currency rate of the bill                                               |
| `sub_total`               | double  | The sub total of the bill                                                   |
| `tax_amount`              | double  | The tax amount of the bill                                                  |
| `total_discount`          | double  | The total discount of the bill                                              |
| `total_amount`            | double  | The total amount of the bill                                                |
| `amount_due`              | double  | The amount due of the bill                                                  |
| `status`                  | enum    | The status of the bill                                                      |
| `contact_id`              | string  | The contact ID of the bill                                                  |
| `memo`                    | string  | The memo or notes of the bill                                               |
| `purchase_order_ids`      | array   | The purchase order IDs associated with the bill                             |
| `updated_at`              | string  | The date and time the bill was last updated                                 |

### Status Enum Values

| Value            | Description                                        |
| ---------------- | -------------------------------------------------- |
| `DRAFT`          | Bill is in draft status and has not been finalized |
| `SUBMITTED`      | Bill has been submitted but not yet paid           |
| `PARTIALLY_PAID` | Bill has received partial payment                  |
| `PAID`           | Bill has been fully paid                           |
| `OVERDUE`        | Bill has passed its due date without payment       |
| `VOID`           | Bill has been voided or canceled                   |
| `UNKNOWN`        | Status cannot be determined from the platform      |

## 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).
* `expand=contact` — includes the related Contact object(s).
* `expand=currency` — includes the related Currency object(s).
* `expand=bill_payments` — includes the related Bill Payments object(s).

## Properties Supported

Fields accepted when creating or updating a record:

| Property             | Type   | Description                                                       |
| -------------------- | ------ | ----------------------------------------------------------------- |
| `platform_id`        | string | Unique identifier for this bill in the source accounting platform |
| `document_number`    | string | The document number of the bill                                   |
| `posted_date`        | string | The posted date of the bill                                       |
| `due_date`           | string | The due date of the bill                                          |
| `currency_id`        | enum   | ISO 4217 currency code                                            |
| `currency_rate`      | double | The currency rate of the bill                                     |
| `sub_total`          | double | The sub total of the bill                                         |
| `tax_amount`         | double | The tax amount of the bill                                        |
| `total_discount`     | double | The total discount of the bill                                    |
| `total_amount`       | double | The total amount of the bill                                      |
| `amount_due`         | double | The amount due of the bill                                        |
| `status`             | enum   | The status of the bill                                            |
| `contact_id`         | string | The contact ID of the bill                                        |
| `memo`               | string | The memo or notes of the bill                                     |
| `purchase_order_ids` | array  | The purchase order IDs associated with the bill                   |
| `updated_at`         | string | The date and time the bill was last updated                       |
