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

> The Documents Data Model simplifies the handling of document documents across various accounting platforms, providing a standardised approach to accessing and managing document-related information.

* Unified document properties: The model unifies essential document details, such as file name, file type, file size, and platform ID, making it easier to work with documents from different platforms.
* Document type association: Documents can be linked to specific document types (e.g., bills, invoices, expenses) using the `document_type_id` and `document_type` properties, facilitating easy retrieval and organisation of documents.
* File metadata: The model includes file type (MIME Type) and file size properties, enabling developers to handle documents appropriately and ensure compatibility with their applications.
* Document upload status: When you request for a document to be downloaded, RootFi will download the document then cache the document on to its servers so future calls to download the document will be faster. The `document_uploaded` property indicates whether RootFi has uploaded the document to its servers.

<Note>
  **Downloading the Document**

  After initially syncing the documents data `document_uploaded` will be `false` for all the documents. To download the document you must call the [Download Documents API](api-reference/v3/accounting/documents/download-document). This API will download the document and return a temporary `download_url`. Subsequent calls to download the document will be faster as the document will be cached on RootFi's servers.
</Note>

## Properties Supported

| Property           | Type    | Description                                                                                                                                                                                                   |
| ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| platform\_id       | string  | The Platform's ID for the document                                                                                                                                                                            |
| file\_name         | string  | Name of the document that was used on the accounting platform                                                                                                                                                 |
| file\_type         | string  | The file type of the document as given by the accounting platform. Formatted as a [MIME Type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics%5Fof%5FHTTP/MIME%5Ftypes)                              |
| file\_size         | float   | The file size of the document in bytes                                                                                                                                                                        |
| document\_type\_id | string  | The platform ID of the document type with which this document is linked to                                                                                                                                    |
| document\_type     | enum    | The name of the data model with which this document is linked. Values are: `BILLS`, `INVOICES`, `EXPENSES`, `BILL_CREDIT_NOTES`, `INVOICE_CREDIT_NOTES`, `PURCHASE_ORDERS`, `SALES_ORDERS`, `JOURNAL_ENTRIES` |
| document\_uploaded | boolean | A value to verify that RootFi has uploaded the document to it's servers                                                                                                                                       |
| updated\_at        | date    | The date at which the information was updated on the accounting platform                                                                                                                                      |

<ResponseExample name="The Document Object">
  ```json The Document Response Object theme={null}
  {
    "platform_id": "3770712000000085065_3770712000000080327",
    "document_type_id": "3770712000000080327",
    "file_name": "Documents.csv",
    "file_type": "text/csv",
    "file_size": 254.8828125,
    "document_type": "INVOICES",
    "document_uploaded": false,
    "updated_at": "2021-03-03T10:00:00.000Z"
  }
  ```
</ResponseExample>
