Skip to content
LOCRAI
All articles

source: integrare-estrazione-nel-gestionale.md

category: integrations

published: May 5, 2026

read_time: 12m

How to connect document extraction to your business system

Export, webhook or API: three ways to get the data where it's needed, without copy-paste.

Extracting the data is half the work. The other half is getting it into the right system, in the right format, at the right time. Here the paths are essentially three, and you choose based on how much you want to automate — and how open your ERP is to the outside world.

Many projects fail not because the OCR is wrong, but because integration is an afterthought: files downloaded by hand, imports on Tuesday evening, exceptions handled in Excel. The right level of automation is the one that eliminates the last remaining copy-paste, without building a fragile middleware castle.

First question: push or pull?

Push: the extraction system notifies you when data is ready (webhook). Pull: your ERP periodically asks «is there anything new?» (API or scheduled export). Push is more reactive and suits event-driven processes; pull is simpler to debug and works well when ERP import is already a nightly batch.

1. File export

The simplest way: extracted data becomes a CSV, JSON, or XML file ready to import. One row per line item, formats designed for ERP and CRM. It works well when importing into the business system is a periodic, supervised operation.

Points to watch: encoding (UTF-8), decimal separators, mapping to required ERP fields, import error handling (reject files). Even with manual export, you gain a lot if the file is already clean and validated upstream — no more typing, just confirm the import.

2. Webhook

A step further: every time a document is processed, exported, or sent to review, your system receives a signed notification. No polling, no waiting: the data arrives the exact moment it's ready, with a delivery log and automatic retries if something goes wrong.

Webhooks work well with an intermediate microservice: receive the event, validate the HMAC signature, fetch the full payload via API, transform to your ERP format, call the internal endpoint. It's the typical pattern when the ERP doesn't expose public APIs but accepts import from your own connector.

  • Typical events: document.processed, document.exported, document.review_required
  • Retry with backoff if your endpoint is down
  • Idempotency: the same event must not create duplicate postings

3. API

Full control: you send the documents, query status, and retrieve data on demand, directly from your application. It's the right path when extraction is one cog in a larger process and you want to orchestrate it yourself — even with custom connectors.

With APIs you can integrate into an existing flow: the user uploads from a supplier portal, the backend sends to LOCRAI, waits or receives a webhook, writes to a queue for the ERP. Useful for legacy RPA too: the script doesn't «read» the PDF — it calls the API and gets structured JSON.

Mapping, idempotency, and error handling

Whatever the channel, three principles always apply. Explicit mapping between extracted fields and ERP fields — documented, versioned. Idempotency: the same document sent twice must not duplicate postings. Error handling: if import fails, the document stays in a «to reprocess» state with a clear message, not lost in the void.

The golden rule: choose the simplest level of integration that eliminates the last remaining copy-paste.

A typical maturity path

Phase 1 — Weekly CSV export, human review on exceptions. Phase 2 — Automated daily export + webhooks for notifications. Phase 3 — End-to-end API with ERP connector. Many customers stay happily in phase 2 for years; there's no obligation to reach phase 3 if volume and process allow it.

Often you start with export and move to webhooks as volumes grow. There's no wrong choice — there's only the one that fits where you are right now, and what your IT team can maintain.

Want to see it on your documents?

We'll show you LOCRAI at work on one of your real workflows, in a short, concrete demo.

Request a demo