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

> An Invoice is a request for payment of goods or services that have been provided. The Invoice Data Model simplifies the handling and retrieval of invoices from different payment gateways.

**The Invoice Data Model** simplifies the handling and retrieval of invoices from different payment gateways. The model provides a unified representation of invoices, enabling you to easily access and manage invoice data from different platforms.

* Unified invoice properties: The model provides a unified representation of invoices, enabling you to easily access and manage invoice data from different platforms.
* Comprehensive invoices information: The model provides a comprehensive representation of invoices, enabling you to easily access and manage invoice data from different platforms.

## Attributes

### Invoice Attributes

| Property             | Type         | Description                                                           |
| -------------------- | ------------ | --------------------------------------------------------------------- |
| rootfi\_id           | integer      | The RootFi ID of the invoice                                          |
| rootfi\_created\_at  | string       | The ISO 8601 timestamp at which the record was created in RootFi      |
| rootfi\_updated\_at  | string       | The ISO 8601 timestamp at which the record was last updated in RootFi |
| rootfi\_company\_id  | integer      | The RootFi company ID associated with the invoice                     |
| platform\_id         | string       | The Platform's ID for the invoice                                     |
| platform\_unique\_id | string       | The platform's unique identifier for the invoice                      |
| contact\_id          | string       | The contact id of the invoice                                         |
| currency\_id         | string       | The currency id of the invoice                                        |
| document\_number     | string       | The document number of the invoice                                    |
| posted\_date         | string       | The posted date of the invoice                                        |
| due\_date            | string       | The due date of the invoice                                           |
| status               | string       | The status of the invoice                                             |
| total\_discount      | number       | The total discount of the invoice                                     |
| sub\_total           | number       | The sub total of the invoice                                          |
| tax\_amount          | number       | The tax amount of the invoice                                         |
| total\_amount        | number       | The total amount of the invoice                                       |
| amount\_due          | number       | The amount due of the invoice                                         |
| shipping\_amount     | number       | The shipping amount of the invoice                                    |
| memo                 | string       | The memo or notes for the invoice                                     |
| created\_at          | string       | The date and time the invoice was created                             |
| updated\_at          | string       | The date and time the invoice was last updated                        |
| line\_items          | Line Item\[] | The line items of the invoice                                         |
| addresses            | Address\[]   | The addresses associated with the invoice                             |

### Line Item Attributes

| Property             | Type   | Description                                                              |
| -------------------- | ------ | ------------------------------------------------------------------------ |
| platform\_id         | string | The Platform's ID for the line item                                      |
| line\_item\_type\_id | string | The ID of the parent document this line item belongs to                  |
| item\_id             | string | The item ID associated with the line item                                |
| tax\_id              | string | The tax ID associated with the line item                                 |
| description          | string | The description of the line item                                         |
| quantity             | number | The quantity of the line item                                            |
| unit\_amount         | number | The unit amount of the line item                                         |
| line\_item\_type     | string | The type of line item (PAYMENT\_INVOICES, PAYMENT\_PAYMENT\_LINKS, etc.) |
| sub\_total           | number | The sub total of the line item                                           |
| tax\_amount          | number | The tax amount of the line item                                          |
| total\_amount        | number | The total amount of the line item                                        |
| total\_discount      | number | The total discount of the line item                                      |
| updated\_at          | string | The date and time the line item was last updated                         |

### Address Attributes

| Property             | Type        | Description                                             |
| -------------------- | ----------- | ------------------------------------------------------- |
| rootfi\_id           | integer     | The RootFi ID of the address                            |
| platform\_id         | string      | The Platform's ID for the address                       |
| platform\_unique\_id | string      | The platform's unique identifier for the address        |
| type                 | AddressType | The type of address (SHIPPING, BILLING, COMPANY)        |
| data\_model\_id      | string      | The ID of the parent data model this address belongs to |
| street               | string      | The street address                                      |
| locality             | string      | The locality or neighborhood                            |
| city                 | string      | The city                                                |
| state                | string      | The state or province                                   |
| pincode              | string      | The postal or zip code                                  |
| country              | string      | The country                                             |

## Properties Supported

| Property         | Type      | Description                                    |
| ---------------- | --------- | ---------------------------------------------- |
| platform\_id     | string    | The Platform's ID for the invoice              |
| contact\_id      | string    | The contact id of the invoice                  |
| currency\_id     | string    | The currency id of the invoice                 |
| document\_number | string    | The document number of the invoice             |
| posted\_date     | string    | The posted date of the invoice                 |
| due\_date        | string    | The due date of the invoice                    |
| status           | string    | The status of the invoice                      |
| total\_discount  | number    | The total discount of the invoice              |
| sub\_total       | number    | The sub total of the invoice                   |
| tax\_amount      | number    | The tax amount of the invoice                  |
| total\_amount    | number    | The total amount of the invoice                |
| amount\_due      | number    | The amount due of the invoice                  |
| shipping\_amount | number    | The shipping amount of the invoice             |
| memo             | string    | The memo or notes for the invoice              |
| created\_at      | string    | The date and time the invoice was created      |
| updated\_at      | string    | The date and time the invoice was last updated |
| line\_items      | object\[] | The line items of the invoice                  |
| addresses        | object\[] | The addresses associated with the invoice      |

<ResponseExample name="The Invoice Object">
  ```json The Invoice Response Object theme={null}
  {
    "rootfi_id": 157,
    "rootfi_created_at": "2024-01-22T05:07:31.465Z",
    "rootfi_updated_at": "2024-01-22T05:07:31.000Z",
    "rootfi_company_id": 1089,
    "platform_id": "123456",
    "contact_id": "123456",
    "currency_id": "USD",
    "document_number": "INV-001",
    "posted_date": "2024-01-22T05:07:31.000Z",
    "due_date": "2024-02-22T05:07:31.000Z",
    "status": "SUBMITTED",
    "total_discount": 10.0,
    "sub_total": 90.0,
    "tax_amount": 9.0,
    "total_amount": 99.0,
    "amount_due": 99.0,
    "shipping_amount": 5.0,
    "memo": "Payment for services rendered",
    "created_at": "2024-01-22T05:07:31.000Z",
    "updated_at": "2024-01-22T05:07:31.000Z",
    "line_items": [
      {
        "platform_id": "li_123456",
        "line_item_type_id": "123456",
        "item_id": "item_123",
        "tax_id": "tax_123",
        "description": "Consulting services",
        "quantity": 1,
        "unit_amount": 100.0,
        "line_item_type": "PAYMENT_INVOICES",
        "sub_total": 100.0,
        "tax_amount": 10.0,
        "total_amount": 110.0,
        "total_discount": 10.0,
        "updated_at": "2024-01-22T05:07:31.000Z"
      }
    ],
    "addresses": [
      {
        "rootfi_id": 278264,
        "platform_id": "addr_123456",
        "platform_unique_id": "123456",
        "type": "BILLING",
        "data_model_id": "123456",
        "street": "123 Main Street",
        "locality": "Downtown",
        "city": "New York",
        "state": "New York",
        "pincode": "10001",
        "country": "USA"
      }
    ]
  }
  ```
</ResponseExample>
