Learn how to synchronize a single invoice between Monite and your accounting system.

Overview

This page aims to showcase how to synchronize a specific invoice, the possible issues during the synchronization, and how to troubleshoot them.

Before pushing an invoice, you are required to have a synchronized connection between Monite and your accounting system.

1. Before pushing an invoice

The following requirements must be fit before pushing an invoice to your accounting system:

  • Counterpart in Monite must be mapped to a counterpart in the accounting system
  • Product in Monite must be mapped to a product in accounting system
  • A corresponding tax rate with the same numerical value as the tax rate in Monite must exist in your accounting system

2. Run the synchronization

The synchronization automatically happens every 24 hours following the initial synchronization between Monite and the entity’s accounting system. This action maps all the related objects between Monite and the accounting system.

However, you can trigger the data synchronization on demand by calling 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' \
5 -d ''

The successful response confirms the synchronization was triggered. The processing time may vary according to the amount of data synchronized:

1{
2 "message": "Started connection data sync."
3}

Monite will automatically push all invoices when they are moved from the draft to issued status.

3. Check for a specific invoice

The synchronization time may vary according to the size of the invoice. You can check the status of the synchronization by calling GET /accounting_synced_records?object_type=receivable&object_id={object_id}.

The query parameter object_type is mandatory. You can sort and filter the results by other fields. For the full list of available sort and filter parameters, see the GET /accounting_synced_records endpoint:

1curl -X GET 'https://api.sandbox.monite.com/v1/accounting_synced_records?object_type=receivable&object_id={object_id}' \
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 record of the synced document, as well as the synced_record_id:

1{
2 "data": [
3 {
4 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
5 "created_at": "2024-08-26T17:40:28.012Z",
6 "updated_at": "2024-08-26T17:40:28.012Z",
7 "errors": {},
8 "last_pulled_at": "2024-08-26T17:40:28.012Z",
9 "object_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
10 "object_type": "product",
11 "object_updated_at": "2024-08-26T17:40:28.012Z",
12 "platform": "xero",
13 "platform_object_id": "string",
14 "platform_updated_at": "2024-08-26T17:40:28.012Z",
15 "provider": "codat",
16 "provider_object_id": "string",
17 "provider_updated_at": "2024-08-26T17:40:28.012Z",
18 "sync_status": "pending"
19 }
20 ],
21 "next_pagination_token": "eyJvcmRlciI6ImFzYyIsImxpbWl0IjoyLCJwYWdpbmF0aW9uX2ZpbHRlcnMiOnsiZW50aXR5X2lkIjoiOWQyYjRjOGYtMjA4Ny00NzM4LWJhOTEtNzM1OTY4M2M0OWE0In0sInBhZ2luYXRpb25fdG9rZW5fdHlwZSI6Im5leHQiLCJjdXJzb3JfZmllbGQiOm51bGwsImN1cnNvcl9maWVsZF92YWx1ZSI6bnVsbCwiY3VycmVudF9vaWQiOjR9",
22 "prev_pagination_token": "eyJvcmRlciI6ImFzYyIsImxpbWl0IjoyLCJwYWdpbmF0aW9uX2ZpbHRlcnMiOnsiZW50aXR5X2lkIjoiOWQyYjRjOGYtMjA4Ny00NzM4LWJhOTEtNzM1OTY4M2M0OWE0In0sInBhZ2luYXRpb25fdG9rZW5fdHlwZSI6Im5leHQiLCJjdXJzb3JfZmllbGQiOm51bGwsImN1cnNvcl9maWVsZF92YWx1ZSI6bnVsbCwiY3VycmVudF9vaWQiOjR9"
23}

Troubleshooting

Failed syncs return the errors field, which contains the error status with details:

1{
2 "data": [
3 {
4 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
5 "created_at": "2024-08-26T17:40:28.012Z",
6 "updated_at": "2024-08-26T17:40:28.012Z",
7 "errors": {},
8 "last_pulled_at": "2024-08-26T17:40:28.012Z",
9 "object_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
10 "object_type": "product",
11 "object_updated_at": "2024-08-26T17:40:28.012Z",
12 "platform": "xero",
13 "platform_object_id": "string",
14 "platform_updated_at": "2024-08-26T17:40:28.012Z",
15 "provider": "codat",
16 "provider_object_id": "string",
17 "provider_updated_at": "2024-08-26T17:40:28.012Z",
18 "sync_status": "pending"
19 }
20 ],
21 "next_pagination_token": "eyJvcmRlciI6ImFzYyIsImxpbWl0IjoyLCJwYWdpbmF0aW9uX2ZpbHRlcnMiOnsiZW50aXR5X2lkIjoiOWQyYjRjOGYtMjA4Ny00NzM4LWJhOTEtNzM1OTY4M2M0OWE0In0sInBhZ2luYXRpb25fdG9rZW5fdHlwZSI6Im5leHQiLCJjdXJzb3JfZmllbGQiOm51bGwsImN1cnNvcl9maWVsZF92YWx1ZSI6bnVsbCwiY3VycmVudF9vaWQiOjR9",
22 "prev_pagination_token": "eyJvcmRlciI6ImFzYyIsImxpbWl0IjoyLCJwYWdpbmF0aW9uX2ZpbHRlcnMiOnsiZW50aXR5X2lkIjoiOWQyYjRjOGYtMjA4Ny00NzM4LWJhOTEtNzM1OTY4M2M0OWE0In0sInBhZ2luYXRpb25fdG9rZW5fdHlwZSI6Im5leHQiLCJjdXJzb3JfZmllbGQiOm51bGwsImN1cnNvcl9maWVsZF92YWx1ZSI6bnVsbCwiY3VycmVudF9vaWQiOjR9"
23}

Here are some possible reasons for errors and the suggested approach:

You can re-try to push the invoice manually by calling POST /accounting_synced_records/{synced_record_id}/push. This action requires the synced_record_id of the related error entry.

If you continue to experience issues and need further assistance with the accounting integration, please contact our Support Team.