Manage accounting integrations

Learn how to manage your accounting integrations.

Check for an active accounting connection

Before configuring a new accounting connection for an entity, make sure this entity has no other existing accounting connections that are active at the moment. For this purpose, call GET /accounting_connections with the X-Monite-Entity-Id header containing the entity ID:

1curl 'https://api.sandbox.monite.com/v1/accounting_connections' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: YOUR_PARTNER_TOKEN'

If there are no other active connections set up for this entity, you will receive a 200 OK response with an empty data array:

1{
2 "data": []
3}

Trigger accounting synchronization

By default, Monite automatically synchronizes the entity’s data in our database with the data in the entity’s accounting system every 24 hours. However, entities can also trigger an instant synchronization when needed. To do this, call POST /accounting_connections/{connection_id}/sync:

1curl -X POST 'https://api.sandbox.monite.com/v1/accounting_connections/{connection_id}/sync' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer YOUR_PARTNER_TOKEN'

The 202 Accepted response is returned if the request is successful.

Disconnect an accounting system

To disconnect an already established accounting connection, call POST /accounting_connections/{id}/disconnect:

1curl -X POST 'https://api.sandbox.monite.com/v1/accounting_connections/{id}/disconnect' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer YOUR_PARTNER_TOKEN'

The successful 200 OK response contains "status": "disconnected":

1{
2 "id": "3fa85f64-5717-4562-b3fc-2c963f76afa6",
3 "status": "disconnected",
4 "platform": "xero",
5 "created_at": "2023-04-02T13:11:53.250Z",
6 "updated_at": "2023-04-02T13:11:53.250Z",
7 "last_pull": "2023-04-02T13:11:53.250Z",
8 "errors": null
9}

Check synchronization logs

You can obtain an overview of all the synchronization events between Monite and the accounting system in a list. When the synchronization is successful, the status and IDs of records from both systems will be returned. If not, an error status with details will be returned instead.

To get a list with all the sync records, call GET /accounting_synced_records. Filtering the results by the object_type is mandatory. For example, GET /accounting_synced_records?object_type=bill will get all the sync records for bills (payables).

1curl -X GET 'https://api.sandbox.monite.com/v1/accounting_synced_records?object_type=bill' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer YOUR_PARTNER_TOKEN'

You can refine the request to get information about a specific object by adding the object_id query parameter to the request, for example:

GET /accounting_synced_records?object_type=bill&object_id=342d33a5-e89f-4a90-8c68-7da318ad4d88

For the full list of available sort and filter parameters, see the GET /accounting_synced_records endpoint.

This successful response returns a synchronization object that includes the sync_status and errors fields, representing the synchronization status and information about any errors, respectively.

1{
2 "data": [
3 {
4 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
5 "created_at": "2024-03-05T15:14:14.728Z",
6 "updated_at": "2024-03-05T15:14:14.728Z",
7 "errors": {},
8 "last_pulled_at": "2024-03-05T15:14:14.728Z",
9 "object_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
10 "object_type": "product",
11 "object_updated_at": "2024-03-05T15:14:14.728Z",
12 "platform": "xero",
13 "platform_object_id": "18cb53c4-3807-4a5a-8da9-303053a40002",
14 "platform_updated_at": "2024-03-05T15:14:14.728Z",
15 "provider": "railz",
16 "provider_object_id": "58e1d32f-a092-438a-bffb-3bf6af9ba8ec",
17 "provider_updated_at": "2024-03-05T15:14:14.728Z",
18 "sync_status": "pending"
19 }
20 ],
21 "next_pagination_token": "eyJvcmRlciI6ImFzYyIsImxpbWl0IjoyLCJwYWdpbmF0aW9uX2ZpbHRlcnMiOnsiZW50aXR5X2lkIjoiOWQyYjRjOGYtMjA4Ny00NzM4LWJhOTEtNzM1OTY4M2M0OWE0In0sInBhZ2luYXRpb25fdG9rZW5fdHlwZSI6Im5leHQiLCJjdXJzb3JfZmllbGQiOm51bGwsImN1cnNvcl9maWVsZF92YWx1ZSI6bnVsbCwiY3VycmVudF9vaWQiOjR9",
22 "prev_pagination_token": null
23}

You can get the details about a specific record by sending a GET request to the /accounting_synced_records/{synced_record_id} endpoint.

List documents in the accounting system

You can list all invoices and payables (bills) that exist in the entity’s connected accounting system without the need to pull those documents into Monite, so you can implement custom document comparison and synchronization logic:

Retrieve accounting tax rates

When pushing an invoice to an accounting system, Monite tries to map the applicable tax rates used in the invoice to the tax rates available in the entity’s accounting system. Entities can retrieve the available tax rates from the accounting system to ensure that they match either the tax_rate_value or vat_rate_id fields in the invoice line items. To do this, call GET /accounting_tax_rates:

1curl -X GET 'https://api.sandbox.monite.com/v1/accounting_tax_rates' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer YOUR_PARTNER_TOKEN'

The response returns the list of tax rates available in the entity’s accounting system. Any VAT rates that are used in the invoice line items and are missing from the entity’s accounting system must be created manually by the entity in their accounting system.

Retry pushing data

You can manually retry a failed sync to the accounting system in cases where errors occur during the attempt by calling POST /accounting_synced_records/{synced_record_id}/push. The synced_record_id of the failed sync can be obtained in the synchronization log:

1curl -X POST 'https://api.sandbox.monite.com/v1/accounting_synced_records/{synced_record_id}/push' \
2 -H 'X-Monite-Version: 2024-01-31' \
3 -H 'X-Monite-Entity-Id: ENTITY_ID' \
4 -H 'Authorization: Bearer YOUR_PARTNER_TOKEN'

The successful response returns the information of the retried sync:

1{
2 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
3 "created_at": "2024-03-05T16:20:57.066Z",
4 "updated_at": "2024-03-05T16:20:57.066Z",
5 "errors": {},
6 "last_pulled_at": "2024-03-05T16:20:57.066Z",
7 "object_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
8 "object_type": "product",
9 "object_updated_at": "2024-03-05T16:20:57.066Z",
10 "platform": "xero",
11 "platform_object_id": "18cb53c4-3807-4a5a-8da9-303053a40002",
12 "platform_updated_at": "2024-03-05T16:20:57.066Z",
13 "provider": "railz",
14 "provider_object_id": "58e1d32f-a092-438a-bffb-3bf6af9ba8ec",
15 "provider_updated_at": "2024-03-05T16:20:57.066Z",
16 "sync_status": "pending"
17}