Two-way sync · WooCommerce connector

Two systems that behave as one.

A middleware service that connects a webshop to the Pantheon ERP in both directions: orders, statuses, stock, prices and products stay aligned, and every sale ends as a fiscalized invoice in the customer's inbox. A platform-independent core, one connector per platform. First connector: WooCommerce.

Role
Backend architecture · integration build · delivery
Stack
NestJS · BullMQ · PostgreSQL · WooCommerce REST
Status
In development
Delivery
Docker image, on the client's infrastructure or as a managed service
Webshop ⇄ Pantheon ERP · two-way sync123456Webshoporder eventConnectorWooCommercePantheon ERPstored proceduresFiscalizationZKI · JIRInvoice PDFfiscal data and QRCustomer inboxemailed over SMTP← statuses · stock · prices · products, back to the webshopIn development: the WooCommerce connectorIntegration-tested against a live Pantheon instanceWebshop ⇄ Pantheon ERPWebshopPantheonorders← statuses, stock, prices, productsIn development · WooCommerce first
Orders travel forward to a fiscalized invoice; statuses, stock, prices and products travel back to the store.

What it needed to solve

Trade runs on the webshop, the business runs in the Pantheon ERP, and the two are separate worlds.

01Orders are re-keyed by hand.

02Statuses drift apart: paid in the store, still open in the ERP.

03Stock and prices disagree between the two.

04Croatian fiscalization happens, if at all, as a separate manual step.

What was needed was a service that makes the two systems behave as one.

What was needed was a service that makes the two systems behave as one.

How we built it

The core is shared. Only the connector changes per platform.

The service stands on the same foundations as our one-way Pantheon middleware, only it runs both ways. Everything specific to a store lives in a thin connector; everything beneath it is shared.

01

Orders in, from any store.

An order arrives through a platform connector, or directly as our canonical JSON on the published endpoint. It is written into Pantheon through stored procedures after the customer is ensured. A store that can send an HTTP request can send orders.

WooCommercewebhook, signature checkedAny storecanonical JSON, tokenReceivervalidates, enqueuesPantheon ERPstored proceduresRedis200 OKThe store never waits on the ERP.Customer ensured, then the order through stored procedures.

Swipe the diagram sideways.

02

Statuses mirrored both ways.

Store to ERP for paid and cancelled, ERP to store for confirmed, processing, shipped and completed. Transitions are idempotent, so they create neither loops nor duplicate events.

WebshopWooCommercePantheon ERPMS SQL Serverpaid · cancelledconfirmed · processing · shipped · completedEvery transition is idempotent:no loops, no duplicate events.

Swipe the diagram sideways.

03

Stock, prices and products, wherever they change.

A change that starts in the store reaches Pantheon, and a change that starts in Pantheon reaches the store, through the same connector.

WebshopWooCommerceConnectorREST · webhooksPantheon ERPMS SQL ServerstockpriceproductWhether the change starts in the store or in Pantheon.

Swipe the diagram sideways.

04

One connector per platform.

The connector is a tightly bounded interface with a handful of operations: fetch order, set status, update stock and price, upsert product. A new platform means implementing that interface, not building a new service.

Shared corequeue · ERP writes · fiscalization · PDF · email · auditfetch order · set status · update stock and price · upsert productWooCommerceintegration-testedShopifysame interfaceMagentosame interfacePrestaShopsame interfaceA new platform is a new connector, not a new service.

Swipe the diagram sideways.

05

Fiscalized and in the inbox.

Croatian fiscalization built in-house: ZKI, digitally signed XML, the exchange with FINA, the JIR and a QR code on the invoice. The PDF is emailed the moment the sale is fiscalized.

Invoice in Pantheonready to fiscalizeZKI generatedprotective codeSigned XMLXML-DSigFINAfiscalization serviceJIR returnedunique invoice IDQR on the invoiceprinted with the JIRNo intermediary, no third-party fiscalization service.The demo to production certificate cutover is a documented procedure.

Swipe the diagram sideways.

One service, two directions.

Like the one-way middleware, it runs as two independent processes from one codebase. The second one also pushes ERP changes back into the store.

Process 01Process 02WebshopstoreHTTP Receivervalidates, enqueuesRedis QueuebrokerWorkerERP, fiscal, PDF, emailPantheonERP, source of truthCustomerinvoice PDFPostgreSQL · idempotency keys, ID correlation, auditJSONenqueue200 OKjobstored procsconnector: status, stock, prices, productsfiscalized PDF, by email

Swipe the diagram sideways.

Process 01

Receives events from the store: a signature-checked webhook, or canonical JSON with token authentication. Validates, enqueues the job and returns 200 OK immediately. The store never waits on the ERP.

Process 02

Writes orders into Pantheon, mirrors statuses, syncs stock, prices and products, fiscalizes and emails the invoice, pushing ERP changes back into the store through the connector, with retries at every step.

Both connections, the store and the Pantheon ERP, reconnect automatically after a drop. Local state, idempotency keys and the audit record live in PostgreSQL, with Redis as the broker. The ERP and the store are the sources of truth.

Everything that drives a sale.

New order

Webshop → PantheonOne-way

Order status

Webshop ⇄ PantheonTwo-way

Stock, prices and products

Webshop ⇄ PantheonTwo-way

Fiscalization

ZKI / JIR · FINA

Invoice

PDF → customer emailOne-way

Three ways to connect.

WooCommerce

A full connector, REST API and webhooks. Integration-tested.

Any store, inbound

Orders are posted as canonical JSON to our published endpoint, against the OpenAPI spec. No connector needed.

Other platforms, both ways

Shopify, Magento, PrestaShop or a custom store, by implementing the same connector interface. The core stays untouched.

Two ways to host it.

Option 01

On the merchant's infrastructure

The service runs inside their network, next to Pantheon, without exposing the ERP outward. They get the image, the docker-compose configuration and runbooks for deploy, backup and rollback. Data never leaves their environment.

Option 02

On ours, as a managed service

We run, monitor and maintain it, with separate production and test environments. The merchant gets a URL and credentials and never thinks about servers, updates or certificates.

Either way it is the same code, documentation and behaviour. The only difference is who holds the server.

Least privilege, nothing in the clear.

  • Signature verification on incoming webhooks and token authentication on the canonical endpoint; anything that fails the schema is rejected.
  • No direct writes into ERP tables; a dedicated integration user instead of an admin account.
  • Secrets, API keys and certificates come from the environment only, never the repository or the image.
  • Source-free delivery: the app ships compiled to V8 bytecode, so readable source never reaches the client's infrastructure.

Chosen for reliability.

Store interface
Per-platform connector (WooCommerce REST and webhooks) · canonical REST endpoint
Runtime
Node.js 20+ · TypeScript 5, strict
Framework
NestJS 10
Job queue
BullMQ + Redis
State store
PostgreSQL + Prisma
ERP access
MS SQL Server, stored procedures
Invoice PDF
Headless Chromium + Handlebars
Fiscalization
XML-DSig · node-forge · QR codes
Observability
pino · OpenAPI · Bull Board
Delivery
Docker + Docker Compose

Where it stands today.

The project is in active development. The whole loop is built and integration-tested against a live Pantheon instance and a staging store: order in, customer ensured, ERP order, status mirroring, fiscalization, PDF, email.

It is containerized and observable. The production fiscalization-certificate cutover is documented as a runbook, the same procedure already carried out on our one-way Pantheon middleware, which is in production.

  • Order ingest, webhook and canonical endpoint
  • Customer ensure
  • ERP order and invoice
  • Status mirrored both ways
  • Stock, price and product sync
  • Fiscalization, ZKI and JIR
  • Invoice PDF emailed
  • Containerized and observable
  • WooCommerce connector
  • Production certificate cutover
  • Further connectors, Shopify and Magento

Running a store and an ERP side by side?

Tell us which platform your store runs on. We'll come back within one business day with a clear plan.

Next project · Platform

Zephz

A brand and catalog site for a performance-footwear company, its own CMS, and a B2B portal where dealers order wholesale by size run.