Integration With the OCR System and Client API

See how we automated the receipt verification system, reducing administrators' workload and ensuring smooth loyalty points crediting

Client

NDA

Industry

FMCG

Technologies

logo Drupal Drupal
Logo TypeScript Typescript
Logo Vue.js Vue.js

Main benefit

Automating the receipt verification system

Background element

Our goal was to integrate the external OCR system with Drupal. The main challenge was the lack of webhooks and an asynchronous API. This meant that the system, instead of returning results immediately, queued receipts for manual verification. As a result, users saw only a projected number, not the actual points earned.

We designed a mechanism that actively polls the server for status updates and synchronizes data with Drupal. As a result, administrators do not have to manually track each submission, and users immediately see the points they have earned. We used:

  • Vue3 – ensures a smooth interface without reloading the page,
  • TypeScript – enforces strict typing of API responses, facilitating code maintenance and future development,
  • Pinia – acts as a global store, ensuring immediate availability of submission status and user data,
  • Axios – handles stable uploading of large image files and network error management.

Data consistency is ensured by the CRON mechanism implemented in the backend (based on the Simple Cron module). We configured two independent tasks:

  • Quick (every few hours) – checks only new receipts with the “Pending verification” status so that the user receives points as quickly as possible,
  • Full (every 24 hours) – refreshes the statuses of all receipts from the recent period, detecting any manual corrections made by administrators in the OCR system.

Separating processes enabled us to optimize the number of API queries, providing users with fast response times while maintaining full data consistency with the client’s system.

The form became the centerpiece of the loyalty program. Since launch, it has automatically processed tens of thousands of receipts, significantly reducing administrators' burden by eliminating the need to manually enter data. Users also benefited from the implementation, gaining a seamless tool without the need to install additional apps.

drupal

Dominik Raducki

Drupal Developer

Thanks to the CRON mechanism, the system automatically detects manual point adjustments and updates the data. This ensures users' account balances are always up to date and accurate.

Background element
  1. When integrating with external systems that lack webhooks or instant status notifications.

  2. When the verification process involves a human element, making completion times variable and unpredictable.

  3. When ensuring full data consistency between systems is critical.

Need a custom Drupal integration?