> This page is for version v2024-05-25 (default).
> For other versions, use one of these documentation indexes:
> - v2024-05-25 (default): https://docs.monite.com/v-2024-05-25/llms.txt
> - v2024-01-31: https://docs.monite.com/v2024-01-31/llms.txt
> - v2023-09-01: https://docs.monite.com/v2023-09-01/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.monite.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server.

# Data export

## Overview

Monite allows [entities](../entities/index) to export all their [accounts payable](../accounts-payable/index), so they can integrate this data into their accounting systems.

The exported payables data are structured in CSV format and must be selected by specific statuses, and start and end dates.

## Compatible accounting systems

Currently, Monite supports accounting data export to [Xero](https://www.xero.com/). More export formats will be added in the future.

### Xero

The Xero export contains just the essential data for Xero to execute the import. Monite does not validate the exported data. To check Xero’s requirements and validations, check the [Xero documentation](https://developer.xero.com/).

## Considerations

* Counterpart-related data is exported only for payables that have been [submitted for approval](../accounts-payable/payables/collect) as the information about the [counterparts](../common/counterparts/index) is inserted into the payables only at this status.

* The prices in the exported data are **tax-exclusive**, that is, do not include taxes.

## Export the accounting data \[#export]

To export the accounting data of a specific entity, call [`POST /data_exports`](/api/data-export/post-data-exports) and specify the desired format (`csv_xero`), the object type name (in this example - `payable`) and [statuses](../accounts-payable/payables/collect), and the date range:

```sh
curl -X POST 'https://api.sandbox.monite.com/v1/data_exports' \
     -H 'X-Monite-Version: 2024-05-25' \
     -H 'X-Monite-Entity-Id: ENTITY_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
       "format": "csv_xero",
       "objects": [
         {
           "name": "payable",
           "statuses": [
             "new"
           ]
         }
       ]
       "date_from": "2022-08-10",
       "date_to": "2022-08-18"
     }'
```

The successful response contains the data export ID:

```json
{
  "id": "edb064b2-af7f-4730-9b73-38c699c383d9"
}
```

To get the link to download the exported files, call [`GET /data_exports/{data_export_id}`](/api/data-export/get-data-exports-id), passing the previously obtained data export ID in the URL:

```sh
curl -X GET 'https://api.sandbox.monite.com/v1/data_exports/{data_export_id}' \
     -H 'X-Monite-Version: 2024-05-25' \
     -H 'X-Monite-Entity-Id: ENTITY_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN'
```

The successful response contains information about the data export and the `source_url` field, which contains the URL to download the exported file:

```json
{
  "source_url": "https://monite-file-saver-zip-eu-central-1-sandbox.s3.com/1a65fd3b-...22c4/02825c72-...f04c.zip",
  "entity_id": "c23dd09c-077a-4afa-914f-f53fc2748ec4",
  "start_datetime": "2022-08-17T13:48:57.455932+00:00",
  "end_datetime": "2022-08-17T13:48:57.584375+00:00",
  "count": 5,
  "id": "edb064b2-af7f-4730-9b73-38c699c383d9",
  "language": "pt-br,pt;q=0.9,en-us;q=0.8,en;q=0.7",
  "status": "done",
  "created_by_entity_user_id": null,
  "format": "csv_xero"
}
```

The file is exported in the ZIP format which includes one or more CSV files, depending on the amount of entries. Each file can contain up to 100 payables with multiple [line items](../accounts-payable/payables/line-items) per payable.

> **Info**
>
> Bigger exports may take longer to be processed. Meanwhile, their status are presented as `pending` until the export is completed and the file is available for download.

#### Field mapping

This is how the fields between Monite and Xero are associated:

| Monite field                      | Xero field       |
| --------------------------------- | ---------------- |
| `counterpart.name`                | `*ContactName`   |
| `counterpart.email`               | `EmailAddress`   |
| `counterpart.address.line1`       | `POAddressLine1` |
| `counterpart.address.line2`       | `POAddressLine2` |
| `counterpart.address.city`        | `POCity`         |
| `counterpart.address.state`       | `PORegion`       |
| `counterpart.address.postal_code` | `POPostalCode`   |
| `counterpart.country`             | `POCountry`      |
| `document_id`                     | `*InvoiceNumber` |
| `issued_at`                       | `*InvoiceDate`   |
| `due_date`                        | `*DueDate`       |
| `line_items.description`          | `Description`    |
| `line_items.quantity`             | `*Quantity`      |
| `line_items.unit_price`           | `*UnitAmount`    |
| `line_items.account_code`         | `*AccountCode`   |
| `line_items.tax_type`             | `*TaxType`       |

All the fields are obtained from the `payables` object, except `tax_type` and `account_code`, which are obtained from the `/extra_data` [settings](#set-default-values).

#### Set default values

You can configure default values for specific fields in the exported data to streamline the CSV processing and reduce manual work.

Currently, it is possible to set default values for the account code (`default_account_code`) and tax rate code (`default_tax_rate_code`) fields, which are mapped to `*AccountCode` and `*TaxType` respectively on Xero.

Additionally, the `counterpart_id` obtained from exported payables is used to search for entries corresponding to this `counterpart_id` in the Monite system. If a corresponding register is found, i.e. this counterpart already exists in the Monite system, the exported data is enriched with the counterpart information.

To create a default value for a specific field, send a `POST` request to the [`/data_exports/extra_data`](/api/data-export-extra-data/post-data-exports-extra-data) endpoint specifying the :

```sh
curl -X POST 'https://api.sandbox.monite.com/v1/data_exports/extra_data' \
     -H 'X-Monite-Version: 2024-05-25' \
     -H 'X-Monite-Entity-Id: ENTITY_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN'
     -H 'Content-Type: application/json' \
     -d '{
       "object_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
       "object_type": "counterpart",
       "field_name": "default_account_code",
       "field_value": "100100"
     }'
```

The successful response contains information about the default value:

```json
{
  "id": "4a9053d5-4023-400e-ab00-47adf7737022",
  "object_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "object_type": "counterpart",
  "field_name": "default_account_code",
  "field_value": "100100",
  "created_at": "2023-10-05T07:29:17.332Z",
  "updated_at": "2023-10-05T07:29:17.332Z",
  "created_by": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

### List all default values

To get information about all default values, call [`GET /data_exports/extra_data`](/api/data-export-extra-data/get-data-exports-extra-data).

### Retrieve a default value

To get information about a specific default value, call [`GET /data_exports/extra_data/{extra_data_id}`](/api/data-export-extra-data/get-data-exports-extra-data-id) endpoint.

### Update a default value

To edit an existing default value, call [`PATCH /data_exports/extra_data/{extra_data_id}`](/api/data-export-extra-data/patch-data-exports-extra-data-id) endpoint.

### Delete a default value

To delete an existing default value, call [`DELETE /data_exports/extra_data/{extra_data_id}`](/api/data-export-extra-data/delete-data-exports-extra-data-id) endpoint.

## Check all data exports

To check all the requested data exports, call [`GET /data_exports`](/api/data-export/get-data-exports) endpoint:

```sh
curl -X GET 'https://api.sandbox.monite.com/v1/data_exports' \
     -H 'X-Monite-Version: 2024-05-25' \
     -H 'X-Monite-Entity-Id: ENTITY_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN'
```

The successful response contains a list of all data exports requested:

```json
{
  "data": [
    {
      "status": "done",
      "source_url": "https://monite-file-saver-zip-eu-central-1-sandbox.s3.amazonaws.com/1a65fd...22c4/02825c...ff04c.zip",
      "start_datetime": "2022-08-17T13:48:57.455932+00:00",
      "format": "csv_xero",
      "end_datetime": "2022-08-17T13:48:57.584375+00:00",
      "created_by_entity_user_id": null,
      "language": "pt-br,pt;q=0.9,en-us;q=0.8,en;q=0.7",
      "entity_id": "c23dd09c-077a-4afa-914f-f53fc2748ec4",
      "id": "edb064b2-af7f-4730-9b73-38c699c383d9",
      "count": 5
    }
  ],
  "prev_pagination_token": null,
  "next_pagination_token": null
}
```