In this guide
When the API says success but your totals are wrong
A business imports invoices from an accounting platform into a custom dashboard. The overnight job finishes without errors, but finance notices that some invoices are missing. The developer checks the HTTP responses: every request returned success. That does not prove the integration imported the full dataset.
Most business APIs return records in pages rather than sending an entire account's history in one response. If the synchronisation logic stops too early, repeats a page or changes its position while records are being added, the final report can be incomplete without a single failed HTTP call.
The first step is to distinguish missing-source data, filtering errors and pagination errors instead of immediately rerunning a full import.
Compare the same reporting period
Select a clear date range and compare the source accounting system's authorised report with the records in your destination database. Match by stable external document ID, not invoice number text alone if the source supports multiple companies, branches or document types.
Check whether the mismatch includes invoices, credit notes, drafts, voided documents or documents in a different status. A dashboard that excludes credit notes will differ from a finance report that includes them, even when the API import is technically complete.
Record which API endpoint, company, filters, sorting rule and timestamp were used. Without that context, a log entry reading Imported 500 records is almost impossible to reconcile.
Understand page numbers, offsets and cursors
Some APIs use page numbers, others use an offset and limit, and others provide an opaque cursor for the next batch. Your integration must follow the provider's current contract. Do not invent a page count by assuming there are always 100 records or that an empty page is the only valid end signal.
With cursor-based pagination, use the returned cursor until the provider indicates there is no next page. With offset pagination, understand whether the underlying dataset is stable during the process. If records are added or removed while the import runs, later offsets can shift and cause records to be skipped or repeated.
Where the API supports a consistent sort order and a snapshot or cursor mechanism, use it. A generic importer that treats every provider like the same SQL table can quietly fail when one API behaves differently.
Why sorting matters
Imagine an importer reading invoices sorted newest first, 100 at a time. It reads page one, then a new invoice arrives at the top. The records shift by one position before page two is requested. The integration may see a duplicate and miss another invoice later in the list.
Deduplicating by document ID prevents the duplicate from being stored twice, but it does not automatically recover the missed record. A complete strategy needs stable pagination, overlapping windows with deduplication, or a reconciliation pass suited to the source API.
For changing datasets, incrementally querying by reliable updated timestamps can help, provided the endpoint documents exactly what that timestamp means and how it handles ordering and timezone boundaries.
Make the checkpoint meaningful
A synchronisation job should only advance its durable checkpoint after processing the relevant batch successfully. If it sets last_sync to the current time before saving the imported records, a database crash can leave a gap that the next job will never revisit.
Use a safe overlap or high-water-mark approach where the provider allows it. Store the last successfully committed cursor or timestamp and enough context to resume after a failure. Handle timestamps consistently in UTC internally, and convert to South African local time only where the business report requires it.
Beware of invoices entered retrospectively or edited after their original date. An incremental importer filtered only by invoice issue date can miss changes to older documents. If the provider offers an updated-at field or change feed, examine whether it is suitable for reliable ongoing synchronisation.
Handle rate limits and temporary failure
A provider may restrict request frequency or return transient server errors. A resilient importer respects documented rate limits, backs off appropriately and resumes without losing its place. Repeating a failed batch is safe when destination records are upserted by a stable, properly scoped external ID.
Do not turn a partially imported day into a successful green dashboard indicator. Expose its state as incomplete, waiting for retry or needing review. Keep request identifiers, page markers and error details in secure operational logs.
A request that times out may have been processed by the provider even if the response was lost. For read-only requests, retrying is usually less risky than for create operations, but always follow the provider's requirements.
Reconcile rather than trusting the row count
A daily reconciliation can compare counts and totals per period, status or document type between the source and destination. Differences should trigger targeted investigation. Totals need sensible rules for rounding, tax and currency, and reconciliation should account for credits and reversals.
It is useful to keep a report of missing document IDs rather than relying only on an aggregate difference. Two errors can cancel each other out numerically, producing a matching total despite incorrect records.
Make the user interface honest about freshness
Finance users should see when the last successful complete sync finished, which company was synchronised and whether any periods are incomplete. A dashboard that simply says Updated today may conceal a failed last page.
Provide an authorised manual retry or reconciliation action that cannot create duplicate documents. If the integration also writes back to accounting, keep the write workflow separate from the importer and give it stronger approval and idempotency controls.
Never confuse creation order with business dates
An API may order documents by internal creation time while finance reports group them by invoice date or posting date. These are not the same field. An invoice entered today for a prior month can be missed if a synchronisation only asks for documents whose invoice date is newer than yesterday. The same issue can occur after a credit note corrects an older sale. Work out which timestamp drives incremental capture and which date drives reporting. Where the provider exposes no trustworthy updated timestamp, schedule periodic wider reconciliation windows. A slightly more expensive validation query is preferable to a polished dashboard that slowly drifts away from the source ledger.
When a custom integration is the right answer
Accounting APIs differ in their pagination, versioning, document models and permissions. A generic connector may suit simple exports, but an operations platform that drives decisions from financial data needs explicit completeness guarantees and monitoring.
Digital4Front develops integrations between existing business software and custom systems. If invoices or customer records intermittently disappear from a dashboard, we can trace the import contract, implement safe checkpoints and build reconciliation that flags incomplete data before staff rely on it. The objective is not just a successful API call; it is a complete and explainable dataset.
