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
    • The product in the accounting system must have a GL account assigned
  • Tax-rate in Monite must be mapped to a tax-rate in accounting system (right now this is done numerically)

2. Run the synchronization

The synchronization automatically happens every 24 hours following the initial synchronization between the entity’s accounting system and Monite.

However, you can trigger the data synchronization between Railz and the accounting system 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: 2023-09-01' \
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}

[Add how to sync a single invoice]

Monite automatically pushes 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=invoice&object_id={object_id}:

1curl -X GET 'https://api.sandbox.monite.com/v1/accounting_synced_records?object_type=invoice&object_id={object_id}' \
2 -H 'X-Monite-Version: 2023-09-01' \
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": "provider_name",
16 "provider_object_id": "e802714c-4218-4775-a569-3e6a10281a5f",
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

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). If the synchronization fails, an error status with details will be returned.

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:

To push an invoice manually, call POST /accounting_synced_records/{synced_record_id}/push endpoint.
This action requires the synced_record_id obtained on the previous step.

when you need to create an object in Accounting (and then sync it back into Monite) before being able to push an invoice

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