Task breakdowns

Sync invoices between CRM and accounting system

To sync invoices between CRM and accounting, a service polls both APIs every 5 minutes and posts each invoice under its external ID, so retries never duplicate.

The problem

When invoices are issued in a CRM (KeyCRM, SalesDrive, OneBox, HubSpot) and management accounting lives in a separate system, a human keyboard sits between them. There is no way to sync invoices between CRM and accounting out of the box, so a bookkeeper or admin re-types 30–80 documents a day, reconciles totals and works out which location and cash register a payment belongs to. Across a 4–6 branch network that is 2–3 hours daily, or 40–60 hours a month spent moving numbers that already exist in the CRM.

The cost of an error is higher than those hours. The same invoice posted twice inflates revenue in the report; a partially paid invoice recorded as one amount breaks the receivables balance; an invoice cancelled in the CRM simply disappears from accounting — and the monthly reconciliation is off by tens of thousands, after which the owner recalculates totals by hand in a spreadsheet anyway.

What makes it hard

A head-on approach does not work for three reasons. There is no ready connector between niche CRMs and management accounting systems — not in Make or Zapier; even if one side is supported, mapping cash registers and locations and protecting against duplicates still has to be written by hand, while paying per operation. Integrating a CRM with external systems is always custom here, just like passing leads from a website. Accounting APIs are often in beta: behaviour on a repeated write has to be tested on a real key, and the key itself is issued only by support on request — without it the project cannot start.

The second limit is how changes are tracked. A webhook on a deal stage change does not always fire: it misses edits to the amount or details. So periodic API polling is needed, which means a delay of up to 5 minutes and an own mapping database “CRM document ↔ accounting record”. The third is organisational: locations and cash registers keep growing, so they cannot be hard-coded, and moving old payments from past periods is usually pointless — only open invoices are transferred so that future payments attach to them.

How we solve it

How such an integration is built:

  1. 1. Capture on screenshots what exactly counts as an invoice in the CRM (an order or a document inside it, whether one order can have several invoices) and how cash registers, bank accounts and locations are represented in accounting.
  2. 2. Get access: an accounting API key from their support, the CRM API app installed with a dedicated user and permissions, hosting for the service.
  3. 3. Stand up the sync service (Node.js + PostgreSQL on Railway or your own server). Every 5 minutes it polls the CRM API for new and changed invoices and payments; for a 4–6 branch network that is up to 100 documents a day, a few records per cycle.
  4. 4. Make the CRM document’s external ID the key of the scheme, so the service posts documents without duplicates: a repeated transfer updates the record instead of creating a new one. The service keeps its own mapping table.
  5. 5. Move “CRM wallet → cash register / bank account” and “location → location” mapping into editable reference tables for cash registers and locations: a new branch is one row, not a code change. If several legal entities share one database, each row also carries the company.
  6. 6. If accounting needs invoice line items, map the product catalogue: automatically by SKU first, and whatever is not found the bookkeeper matches once by hand in the mapping table — the service remembers the pair.
  7. 7. Cover the hard cases: partial payments (several payments per invoice, the total adds up), a payment that arrives before its invoice (queue), one system being unavailable (write retried after the failure).
  8. 8. Cancelled invoices are not deleted but marked “cancelled in CRM, date” — deletion stays a manual decision of the bookkeeper.
  9. 9. Transfer open invoices once, with a reconciliation report: count and total before and after match.
  10. 10. Write a change log into Google Sheets with a month filter and Excel export: the bookkeeper checks totals by cash register and period against their report without server access. The same data later feeds sales analytics by branch.
  11. 11. Hand the code over to your repository and record a video guide: how to add a cash register or location and what to do on failure. On top, set up escalation alerts for failed writes — by email or to a Telegram bot for the person in charge.

What drives the price and timeline

The market range for this kind of automation is €700 to €2,500. The low end is a one-way exchange of invoices only, one location, one cash register, no queue and no retry on failure. The high end is two-way sync with line-item breakdown, several legal entities and currencies, full audit and monitoring. The main price factor is not the number of systems but the level of detail: passing invoice lines as separate rows adds €400–700 compared with text in the description, because the product catalogues of two databases must be mapped.

Timing is 6–10 working days after the API keys are issued: roughly equal parts for invoices and for payments with transfer and log. Plan for running costs separately: hosting the service with a database from $5 a month, Google Sheets free, API access usually at no extra charge, though some CRM plans charge for the API app — this is checked before the start. Typical savings are 40–60 hours of manual entry a month and a reconciliation that matches the first time.

Frequently asked questions

How much does it cost to sync invoices between CRM and accounting?

Roughly €700 to €2,500 depending on depth: a simple invoice exchange costs less, line items, several currencies and legal entities cost more. Timing is 6–10 working days after the API keys are issued, plus hosting from $5 a month.

Can I do it without a developer, using Make or Zapier?

Only if both systems are in the service’s connector catalogue. Niche CRMs and accounting systems have no connectors there, and mapping cash registers, locations and duplicate protection still has to be written separately.

Is the data transferred in real time?

No. The service polls the APIs every 5 minutes, so the delay is up to 5 minutes. Webhooks would be instant, but they often fire only on a stage change and miss edits to the amount.

Is it safe to give the service access to the CRM and accounting?

The service gets a dedicated user with rights only to invoices, payments and reference tables, and API keys are stored in server environment variables, not in code. If one of the systems changes its API, the service stops writing and sends an alert instead of writing wrong data; adapting usually takes a few hours.

What happens to old and cancelled invoices?

Open invoices are transferred once so that future payments attach to them; payments from past periods are usually not moved. An invoice cancelled in the CRM does not disappear from accounting but gets a “cancelled, date” mark — the bookkeeper deletes it manually.

This breakdown is anonymised: no client names and no deal-specific prices. More breakdowns — Task breakdowns

Cases in this area

ACG AI AGENT

An AI agent for an outsourced accounting firm: a free-form order in Telegram → ready documents in BAS.

Claude AITelegram Bot APIBAS УТПPostgreSQL
Details →

CUSTOM ERP

A boxed CRM/ERP for a trading company: roles, end-to-end audit, tasks, directories, multi-company.

Next.jsTypeScriptDrizzle ORMPostgreSQL
Details →

Discuss your task

Describe your task in a conversation — by voice, text or files. You get a proposal with scope, price and timeline. Or just message us on Telegram or by email.

Discuss your project@soloveynikinfo@lambertain.site

Get in touch

GOT AN
IDEA?

Tell us about your task — we reply fast and propose a solution.

Start a project@soloveynikinfo@lambertain.sitegithub.com/Lambertain