HomeGuidesRecipesAPI ExplorerForumSupport
Partner Portal
Partner Portal

Accounting export

Learn how to export your accounting data from Monite, so you can use this data in an external accounting solutions.

Overview

Monite allows the entities to export all their accounts payable, 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.

Export the accounting data

Currently, Monite supports accounting data export to Xero. More export formats will be added in the future.

Xero

The Xero export contains just the essential data for Xero to execute the import. The data exported is not validated on the Monite side. To check Xero’s requirements and validations, check the Xero documentation.

πŸ“˜

The export is set in tax-exclusive format, which means that the prices in the exported data do not include taxes.

To export the accounting data of a specific entity, send a POST request to the /data_exports endpoint specifying the format (csv_xero), the object type name (payable) and status, and the date range:

curl -X POST 'https://api.sandbox.monite.com/v1/data_exports' \
     -H 'X-Monite-Version: 2023-09-01' \
     -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:

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

πŸ“˜

Counterpart-related data will be exported only for payables that have been submitted for approval as the information about the counterpart is inserted into the payables only at this status.

To get the link to download the exported files, send a GET request to the /data_exports/{data_export_id} endpoint passing the previously obtained data export ID in the URL:

curl -X GET 'https://api.sandbox.monite.com/v1/data_exports/{data_export_id}' \
     -H 'X-Monite-Version: 2023-09-01' \
     -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:

{
  "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 per payable.

πŸ“Œ

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.


Fields mapping

Fields mapping

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

Monite fieldXero field
counterpart.name*ContactName
counterpart.emailEmailAddress
counterpart.address.line1POAddressLine1
counterpart.address.line2POAddressLine2
counterpart.address.cityPOCity
counterpart.address.statePORegion
counterpart.address.postal_codePOPostalCode
counterpart.countryPOCountry
document_id*InvoiceNumber
issued_at*InvoiceDate
due_date*DueDate
line_items.descriptionDescription
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 endpoint specifying the :

curl -X POST 'https://api.sandbox.monite.com/v1/data_exports/extra_data' \
     -H 'X-Monite-Version: 2023-09-01' \
     -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:

{
  "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, send a GET request to the /data_exports/extra_data endpoint.

Retrieve a default value

To get information about a specific default value, send a GET request to the /data_exports/extra_data/{extra_data_id} endpoint.

Update a default value

To edit an existing default value, send a PATCH request to the /data_exports/extra_data/{extra_data_id} endpoint.

Delete a default value

To delete an existing default value, send a DELETE request to the /data_exports/extra_data/{extra_data_id} endpoint.


Check all data exports

To check all the requested data exports, send a GET request to the /data_exports endpoint:

curl -X GET 'https://api.sandbox.monite.com/v1/data_exports' \
     -H 'X-Monite-Version: 2023-09-01' \
     -H 'X-Monite-Entity-Id: ENTITY_ID' \
     -H 'Authorization: Bearer ACCESS_TOKEN'

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

{
  "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
}