Overview
When you create an expense, bill, or invoice, Sync2Books automatically queues it for sync to your connected accounting system. This guide shows you how to monitor the sync process and handle any issues.Sync Lifecycle
Getting Sync Batch Status
After creating expenses, you receive asyncBatchId. Use this to check the sync status:
Endpoint
Request
Response
Batch Status Values
Item Status Values
Listing Sync Batches
Get All Batches for a Company
Query Parameters
page(number, default: 1) - Page numberlimit(number, default: 20) - Items per pagestatus(string, optional) - Filter by status:pending,processing,completed,failedstartDate(string, optional) - Filter batches from this date (ISO 8601)endDate(string, optional) - Filter batches until this date (ISO 8601)
Example
Response
Handling Failed Syncs
Get Failed Items
Example
Response
Retry Failed Items
Request Body
itemIds is empty or omitted, all failed items will be retried.
Example
Response
Polling Strategy
For real-time status updates, poll the sync batch status:Recommended Approach
- Initial Poll: Wait 2 seconds after creating expense
- Poll Interval: Check every 2-3 seconds
- Timeout: Stop polling after 60 seconds (syncs typically complete in 5-15 seconds)
- Exponential Backoff: If status is
processing, increase interval slightly
Example Implementation (JavaScript)
Webhooks (Coming Soon)
Instead of polling, you can configure webhooks to receive real-time notifications when syncs complete. Contact support for early access.Common Error Messages
Best Practices
- Always check sync status - Don’t assume syncs succeed immediately
- Implement retry logic - Handle transient failures gracefully
- Log sync errors - Track failed syncs for debugging
- Monitor batch completion - Set up alerts for high failure rates
- Use webhooks when available - More efficient than polling
Next Steps
- Expense Management - Create and sync expenses
- Attachments - Upload files to synced transactions
- Link Integration - Connect accounting systems