This is a staging build of the docs
We've reorganized our products to make building with Codat easier than ever
Skip to main content

The sync process explained

The end to end sync process for pushing expenses to your customers accounting software

Create expense-transactions datasets

After the company has categorized their expenses using the mapping options, you can create expense-transaction datasets, in the response you will receive a datasetId.

Create expense dataset
POST https://api.codat.io/companies/{companyId}/sync/expenses/expense-transactions

Initiate sync

You can then initiate the sync process for multiple datasets by making an API request to the sync endpoint.

Initiate a sync of expense datasets
POST  https://api.codat.io/companies/{companyId}/sync/expenses/syncs

A syncId will be returned to the response payload.

You can initiate multiple syncs at once. Codat will manage the queueing of these syncs and push the data to the accounting platform.

Check sync status

There are three ways to check the status of the sync:

  1. Using webhooks and the sync completed rule

  2. Polling the sync status endpoint

  3. Using the Sync Health Site for Sync for Expenses

Sync status codes
CodeReason
1000In Progress
1010In Progress (Long running - over ten minutes)
2000Success (Data pushed)
2040Success (No data pushed)
4000Configuration Error
4040Company deleted/de-authorized
4220Company deleted/de-authorized
4260Accounting platform billing expiry
5000Generic Server error
5080Duplication protection
5120Data processing error
5130Data push error

Check transactions

Once the sync has completed, you should check whether the transactions were successfully synced to the accounting package. This can be done via the transaction metadata endpoint

Transaction status
GET https://api.codat.io/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions

Upload Receipts

To post the attachment for each transactionId with a status of Completed and integrationType of expense, call the attachment endpoint

Upload receipt
POST https://api.codat.io/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}/attachments

Was this page useful?
❤️
👍
🤔
👎
😭