Skip to content

Case 07 · Automation · Operations · Products

Connect a local ERP to the web without exposing it, and without writing to it until authorized.

Camsmark sells electrical and industrial supplies with one store for Panama and another for Venezuela. Each site runs SAINT on a local Windows machine with SQL Server. We built an agent that reads each site's inventory and publishes it online through an outbound connection, with retries, a local queue and duplicate protection.

Project
SAINT ERP integration agents
Context
Camsmark · e-commerce with stores in Panama and Venezuela
By Antonio Duque
Reviewed against the code and documentation on

01

Context and need

Without an integration, website prices and stock depended on manual uploads. The two sites run different SAINT editions, price lists ordered differently and different currencies.

In Venezuela the link is satellite and behind shared network address translation: no port can be opened and there is no public IP to rely on. The website should never reach into the client's network.

02

My responsibility

  • I designed the agent and its contract with the platform, fixed the read schema by verifying it on site, built the double-posting defenses, the diagnostics and the install package, and took part in the Panama installation.
  • On the web side I co-built the importer, endpoints, heartbeat and health alerts.

Teamwork

A team project with Noe Rivas, co-developer and reviewer, who led the Venezuela pilot, hardened the Windows service and reviewed changes. The business owner decides the catalog and the client's technicians run tasks on site. The store interface is shared work.

03

Strategy and decisions

  1. Outbound agent: every connection leaves the client's machine over HTTPS; no open ports, no inbound access.
  2. Go: a single binary, cross-compiled for Windows without C dependencies, running as a native service.
  3. A local SQLite queue to survive link outages without losing data or duplicating operations.
  4. A swappable reader: direct SQL Server (in use at both sites), SAINT's REST service (dropped because it wasn't available on site) or a CSV file as a fallback.
  5. Read first; write to the ERP only with complete configuration and written authorization.

04

What I built

  • An agent with diagnostic, pilot and one-off inventory modes, and three cycles: inventory every 15 minutes (nothing is resent if nothing changed), sales every 5 minutes and a heartbeat every 5 minutes.
  • Reads from only two ERP tables (products and stock per warehouse), with the price column chosen from a closed list to prevent SQL injection. In Panama, through a dedicated read-only database user.
  • Batched sends with a separate token per site; the server rejects prices that don't belong to the token's site.
  • Exponential backoff retries, timeouts, delayed start, restart on failure and a rotating log in Spanish.
  • Web-side protections: the agent never sends images or sale prices, never sends empty batches, and stops if the server reports a partial load.
  • An agents-and-syncs panel with a “no signal” warning and an alignment command with backup and rollback.

Real screenshots

Screens from the real system. ZoDesk ones come from its demo mode, with an invented dealership; those marked “Live” are public pages captured on November 14, 2026.

Panama store: the price and stock on the page come from the SAINT read.

Panama store: the price and stock on the page come from the SAINT read.

Product page in the Camsmark Panama store with a price in dollars and an In stock label showing sixteen available.

05

How it works

  1. SAINT on site

    Local SQL Server with products and stock per warehouse.

  2. Go agent

    A Windows service that reads, hashes the batch and stores it in its local queue.

  3. Outbound HTTPS

    Batched sends with the site's token, retries and exponential backoff.

  4. Importer

    Applies each row in a transaction and stores the batch reference.

  5. Price and stock per store

    Panama in US dollars and Venezuela in bolívars, each with its own list and warehouse.

  6. Heartbeat and alerts

    The panel shows each agent's status and warns when it stops reporting.

Demo

The integration map

Four flows, four different states

Diagram

Client site (Windows)

SAINT + SQL Server · Go agent as a service · SQLite queue

Outbound HTTPS only →
token per site · retries

Web platform

Laravel · importer · agents panel · alerts

  • ERP readsSAINT · SQL Server → Go agent (SELECT only)In production
  • Catalog publishingGo agent → Price and stock per storeIn production
  • Order intakeWeb store → Agent order queueBuilt and tested
  • Inventory postingsGo agent → SAINT (needs authorization)Pending

Panama: US dollars, its own price list and warehouse. Venezuela: bolívars, its own list and warehouse. The web never connects into the client's network.

06

Tools and what they do

Go
Cross-platform agent with ERP reads, queue, retries and Windows service.
SQL Server
SAINT's database at each site, read with minimal permissions.
SQLite
Local queue and log so nothing is lost or duplicated.
Laravel 10 and Filament 3
Importer, endpoints, agents panel and alerts.
PowerShell
Installation, pilot and diagnostics on the client's machine.

Available evidence

  • 157 automated tests for the Go agent, run green on November 14, 2026, including a simulated power cut during an inventory posting.
  • Web-side integration tests for the importer, orders, heartbeat and the contract with the agent.
  • Technical and operational close-out documents, and an incident report with its follow-up.

07

Current status

  • 1. ERP reads

    Running at both sites: Venezuela as a service since August 2026 and Panama installed on August 10, 2026.

    In production
  • 2. Catalog publishing

    Price and stock per store update from the agent. Reconciliation of missing products exists but is off until validated.

    In production
  • 3. Order intake

    Endpoints built and tested. Not live: online payment is disabled and sales close over WhatsApp.

    Built and tested
  • 4. Writing inventory postings to SAINT

    Built and tested with three defenses against double posting. Pending configuration and the client's written authorization; nothing has ever been written to SAINT.

    Pending
  • Continuous monitoring

    The November 5, 2026 audit recorded heartbeat gaps and one disconnected agent; follow-up is under way.

    In progress

“In production” is only used when the project’s documentation confirms it. “Built and tested” means automated tests exist, not that it is in use. “Proposal” is a documented idea, not something built.

Next steps

  • Reconnect the Panama agent and pin the deployed binary version.
  • Separate global product data (name and URL) so the two sites' agents don't overwrite each other.
  • Confirm with the client the currency of one Venezuelan price list.
  • Validate and enable reconciliation; obtain configuration and authorization before enabling postings.

08

Lessons learned

Verify the schema on site: three assumptions about the ERP turned out false on connection.
Price lists can be ordered in reverse between sites: copying one configuration would have sold cheaper without a single visible error.
Administrative items show up in an ERP as if they were products; they have to be filtered.
You don't write to an ERP's tables without explicit authorization, even when the code is ready.

Related services

Connected cases