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
.
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.
POST https://api.codat.io/companies/{companyId}/sync/expenses/syncs
A syncId
will be returned to the response payload.
Check sync status
There are three ways to check the status of the sync:
Using webhooks and the
sync completed
rulePolling the sync status endpoint
Using the Sync Health Site for Sync for Expenses
Sync status codes
Code | Reason |
---|---|
1000 | In Progress |
1010 | In Progress (Long running - over ten minutes) |
2000 | Success (Data pushed) |
2040 | Success (No data pushed) |
4000 | Configuration Error |
4040 | Company deleted/de-authorized |
4220 | Company deleted/de-authorized |
4260 | Accounting platform billing expiry |
5000 | Generic Server error |
5080 | Duplication protection |
5120 | Data processing error |
5130 | Data 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
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
POST https://api.codat.io/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}/attachments