← All cases

Integrations

Online store and ERP talking to the CRM — without duplicating a single order

Orders from Nuvemshop and Bling now automatically become deals in the CRM. The duplicate race that showed up during every sales spike was eliminated with a serial queue and a safety sweep.

0
duplicates after the serial queue
77
automated tests
2 sources
Nuvemshop + Bling → 1 CRM
Client
E-commerce (apparel), in-house sales operation
Period
2026, delivered and in production
Stack
Cloudflare Worker + KV · Nuvemshop API · Bling API v3 · Datacrazy CRM · TypeScript

The problem

Every sale needed to exist in the CRM for the sales team to work it. Done by hand, it lagged; done via direct webhook, it duplicated — two webhooks arriving together created two deals for the same order, and the team lost trust in the numbers.

What was built

An isolated Worker, on the client’s own domain, that receives the webhooks, queues them instead of processing on the spot, and a scheduled process that consumes the queue serially. A periodic sweep checks whether any order slipped through or got duplicated. The ERP refresh token — which rotates on every use — has a single source of truth, because that’s exactly the kind of detail that brings an integration down on a Saturday night.

What was measured

  • Live end-to-end validation on deployment day, with a rollback tag created and checked by diff beforehand.
  • 77 tests covering the queue, the sweep, and both APIs.
  • A later independent review found a real issue (an import cursor that advanced even on failure) — fixed and documented.

What the client didn’t have to do

Switch ERP, store, or CRM. The integration lives between all three.