Shopify and ERPNext, kept in step

A South African online retailerIn production

Two-way sync between a Shopify store and ERPNext, with each system owning the data it is best at.

The challenge

When a webshop and an ERP drift apart, stock, prices, orders and refunds get keyed in twice, and a naive sync overwrites one system's data with the other's.

What we built

  • Product sync where ERPNext owns SKU, cost, price, weight and tax, and Shopify owns titles, descriptions, images and tags
  • Shopify orders arrive as Sales Orders; only paid orders are submitted
  • Refunds become Credit Notes; a submitted Delivery Note fulfils the Shopify order and raises the invoice
  • Stock pushed every 5 minutes, prices every 15, with optional hiding of out-of-stock items
  • Item variants exported as grouped Shopify products, including families of more than 100 variants
  • Failed messages are kept and retried, with a sync log, dashboard and hourly reconciliation

How it works

Shopify drops a webhook if it isn't answered within 5 seconds. A Cloudflare Worker verifies each webhook's signature, answers in under 100 ms and hands it to ERPNext, which processes it in the background. Outbound changes come from ERPNext's own document events and schedules. Loops and duplicate events are detected and skipped.

  1. Shopify
  2. Cloudflare Worker
  3. ERPNext queue
  4. ERPNext

By the numbers

  • Webhooks answered in under 100 ms
  • Stock every 5 min, prices every 15 min, reconciliation hourly
  • Up to 5 retries with back-off

Request a licence for Shopify and ERPNext, kept in step

Have a system that doesn't quite fit?

Tell us what you need it to do. We'll scope it with you.

Start a project