Case study · Industrial distribution

A store wired to P21, taken over and put back in sync

Who this is for For a distributor whose products, prices, stock and orders live in Epicor P21, whose store depends on a connection someone else built, and who hears it has stopped only when a customer or a rep notices.

We took over a Magento store as it launched, with a deep connection to Epicor P21 that another team had built. Checkout failed, the product sync had been switched off, and later orders stopped reaching the ERP. We found each cause, got products, prices and orders flowing again, and kept the connection running for about three years.

  • Industrial distribution
  • Survey and construction equipment
  • Magento Open Source
  • Epicor P21

Home / Case studies / A store wired to P21, taken over and put back in sync

The situation

  • A survey and construction equipment distributor, selling online from a Magento store to account customers and to buyers without an account.
  • Epicor P21 held the products, prices, stock and every customer account. Another team had connected the store to it through a middleware API and launched the store, and we took it over that month.
  • Within weeks, card payments started failing at checkout. Then products changed in P21 stopped changing on the site, and some never showed up at all.

What we connected

  1. 1Buyers to Magento Open Source: orders, account sign-ups
  2. 2Magento Open Source to Middleware API: orders, new accounts
  3. 3Between Middleware API and Epicor P21: orders in, account data out
  4. 4Epicor P21 to Our import jobs: product and stock data, through the API
  5. 5Our import jobs to Magento Open Source: catalog updated on every run

What changed

  • Product data from P21Names, descriptions, prices and web status from P21 updating on the site every 30 minutes again
  • Products missing from the siteEvery product P21 marks for the web reaching the site, hundreds of them, including ones with no unit price
  • Orders into P21Web orders reaching P21 again within days of the first report, once the failing export job was found
  • CheckoutCard payments working again within a week, once we found the handed-over code did not match the live store
  • New accountsNew accounts waiting for approval can no longer sign in before they get it: the sign-in pop-up had been skipping the check
  • The paid import extensionReplaced by our own scheduled jobs for P21 products and stock, and removed
  • Kept runningAbout three years, from the store's launch in January 2022 until the main site moved, around the turn of 2025
How we built it

Matching the code to the live store

When card payments started failing, the logs pointed at the payment and order export code. The repository we had been handed did not match what was running on the servers. We compared the two, merged the production code the repository was missing, and redeployed. Checkout worked again.

Reading the sync, field by field

The P21 product import had been switched off. We tested it, turned it back on every 30 minutes, and wrote down which P21 field feeds which store field: name, description, weight, price, tier prices, web status. The team then changed those in P21, where the next sync would not wipe them out.

Two web classes, one rule

P21 marked web products with one of two classes, and the sync only picked up one. It also skipped any product with no unit price. We added the second class and fell back to the list price, and the missing products came through.

Our own import jobs

In early 2024 the paid extension that imported the P21 files started rejecting rows, and new products would not link. We replaced it with two scheduled jobs of our own, products first and then stock, and took the extension out.

Watching the orders

When orders stopped arriving in P21, the export job was failing on a customer code it expected as a number and got as text. We fixed the type, and the orders went through.

The whole story

Where it started

The distributor's new Magento store was built by another team, connected to Epicor P21 through a middleware API, and launched at the start of 2022. We came in at the launch and took it over from there.

The connection did a lot. Orders went to P21, and their status and shipments came back. Product data came the other way. New customers could give their P21 account number when they signed up.

The first weeks

A few weeks in, card payments began failing at checkout, and no orders were coming through. The code we had been given did not match the code on the live servers. Once we merged what was missing and redeployed, checkout worked again.

Products that would not update

Next, the team changed product names and prices in P21, and the site did not follow. The product import had been switched off. We turned it back on every 30 minutes and wrote down which fields come from P21, so the team knew where to make each change.

Some products still never appeared. P21 used two classes to mark a product for the web, and the sync only read one of them. It also skipped any product without a unit price. With both fixed, the products P21 marks for the web came through.

Orders that did not arrive

In 2024, a week of orders had not reached P21, and subscription renewals stopped with them. The export job was failing on one field's type, and we had it fixed within days.

Three years on

We kept the connection running through each upgrade, and replaced the paid extension that imported the P21 files with jobs of our own. Around the turn of 2025 the company's main site moved to another platform. We moved the store to a subdomain, out of search, and kept it running for the team and for its subscription renewals.