Enterprise Manufacturing

Lush Cosmetics: Cross-Instance Order Automation on ERPNext

How we built a custom Frappe app that automatically converts Purchase Orders in one ERPNext instance into Sales Orders in another — eliminating manual re-keying across Lush's multi-company supply chain.

About the Project

Lush Cosmetics operates multiple business entities — each running its own ERPNext instance. When one entity purchases from another, staff were manually re-entering Purchase Order details as Sales Orders in the supplier's system — a slow, error-prone process that didn't scale.

We built Lush Order Link — an open-source Frappe app that bridges two ERPNext instances. When a Purchase Order is submitted in one site, a corresponding Sales Order is automatically created in the other, with full field mapping, error tracking, and background retry logic.

Instances

2

Linked

Sync

Auto

On PO submit

Auth

API Key

Secure token-based

Source

Open

BSL-1.0 licensed

The Challenge

Manual Order Re-Entry

Every inter-company Purchase Order had to be manually re-keyed as a Sales Order in the supplier's ERPNext instance — duplicating work and introducing transcription errors across line items, quantities, and delivery dates.

Separate ERPNext Instances

Each business entity runs its own ERPNext site with independent item catalogues, company records, and user bases. There's no built-in mechanism to synchronise transactions across separate Frappe/ERPNext instances.

No Visibility on Failures

When orders were entered manually, mistakes only surfaced downstream — mismatched items, wrong quantities, or missing shipping details. There was no systematic way to catch and resolve errors at the point of entry.

The Solution

We built a custom Frappe app — installed on both ERPNext instances — that hooks into the Purchase Order workflow and automatically creates the corresponding Sales Order in the linked site via the Frappe API.

Automatic PO-to-SO Conversion

When a Purchase Order is submitted, the app maps all fields — items, quantities, delivery dates, shipping addresses, and contact details — into a Sales Order payload and pushes it to the linked ERPNext instance.

Company Link Setup

A configuration screen lets administrators link two sites by specifying the remote URL, API credentials, target company, and Sales Order prefix — with automatic validation on save to confirm connectivity.

API-Key Authentication

The integration authenticates via Frappe API key/secret pairs — no passwords stored, scoped to a specific user in the target instance, and straightforward to rotate or revoke.

Background Job Processing

Orders can be processed synchronously on submit or queued for background processing via a cron job that runs every 5 minutes — ensuring the PO submission isn't blocked by network latency or remote-site downtime.

Status Tracking & Error Logging

Every sync attempt is tracked via a dedicated Lush Purchase Order doctype with statuses (Pending, In-Progress, Completed, Failed) and direct links to detailed error logs when something goes wrong.

Cancellation Sync

When a Purchase Order is cancelled, the corresponding Sales Order in the linked instance is automatically cancelled or deleted — keeping both systems consistent without manual intervention.

The Results

Zero

Manual order re-entry

Instant

SO created on PO submit

Full

Error tracking & retry

Open

Source on GitHub

Need to Connect Multiple ERPNext Instances?

We build custom integrations between ERPNext sites and third-party systems — automating workflows that would otherwise require manual data entry.

Get a Free Consultation