Play video
Pause video

PFL

Gift & Packaging E-Commerce + ERP Integration

2024

PFL Website Screenshot
Scroll
Project TypeE-Commerce Platform
Timeline2024
Core TechLaravel, Filament, ERP
Websitepflpfl.com

Project Overview

PFL is a Taiwanese gift and packaging supplier, offering sealing bags, gift boxes, packaging materials, decorations, holiday supplies, combo sets, and more, with nearly two thousand product listings.

The client's existing ERP system managed all product and customer data. They wanted to build an e-commerce platform that supports both B2B (distributors) and B2C (consumers), with bi-directional ERP synchronization to eliminate redundant manual data entry.

The entire system is built on Laravel + Filament, integrating ERP modules for products, inventory, customers, and orders, paired with ECPay payment services for online transactions, achieving a fully automated workflow from order placement to ERP accounting.

1963+
Products (ERP Synced)
B2B+B2C
Dual Business Model
3
ERP Sync Modules

The customer checks out, the order walks itself into the ERP

It used to work like this: the customer ordered on the website, an operator printed the order out and re-keyed the same data into the ERP. Nearly two thousand products and dozens of orders a day — one mistyped quantity is one shipping dispute. Now, the moment the customer checks out, that same order is already sitting in the ERP.

StorefrontWhat the customer sees
pflpfl.com/checkout/done

✓ Order placed

Order no. PFL-24090873

  • Matte zip bags, 100 pc× 12
  • Foil gift box, M× 5

TotalNT$ 8,640

Credit card · paid

ERPWhat the back office sees
KTNET TMS/Orders
OrderCustomerAmountStatus
24090871Dealer A12,400Created
24090872Dealer B3,280Created
24090873Web order · B2C8,640Created

+00:02 — created straight from the storefront, nobody typed it in

* Illustrative mock-up, not an actual screenshot

One order, two different screens, but the data is entered only once. All the operator has left to do is confirm the shipment — no more opening two systems and typing from one into the other.

Core Features

01

Bi-Directional ERP Integration

Bi-directional sync with KTNET TMS ERP system, covering product data (pricing, inventory, descriptions), customer data (B2B/B2C), and orders (creation + status write-back), using HMAC-SHA512 signature authentication

02

Filament Admin Panel

A full-featured e-commerce admin panel built with Filament, managing products, orders, customers, sales reps, and more, with manual ERP sync interface and flowchart visualization

03

ECPay Payment Integration

Integrated with ECPay payment services, supporting credit card, ATM transfer, convenience store payment, and more. B2B orders are pushed directly to ERP, while B2C orders sync automatically after payment

04

Multi-Tier Pricing & Inventory

Five-tier pricing synced from ERP, automatically matching prices based on customer level. Inventory quantities are updated in real-time from ERP to ensure frontend display matches actual stock

Order life cycle × two-way ERP sync

Once a customer checks out on the storefront, the data has to walk itself into the ERP — that is the problem this build actually solves. The swimlane below opens up a single order: products coming down from the ERP, the customer browsing and ordering, ECPay taking payment, the order pushed back up to the ERP, and the ERP order number written back. Not one column requires an operator to re-key anything.

Customer (B2B / B2C)Platform (automated)ERP (KTNET TMS)ECPayMain flowCross-system handoff
CustomerB2B · B2C storefrontPlatformLaravel, automatedERPKTNET TMSPaymentECPay01Product sync02Browse03Place order04Payment05Push to ERP06Write back07TrackingSee own price tierPlace orderPay onlineTrack order statusWrite productsand stock levelsResolve B2B / B2Cprice tierCreate order headerand line itemsReceive paymentresultEvent-driven pushof order to ERPWrite back ERP no.and order statusTrack sync in adminProducts · stock· customersCreate order,deduct stockReturn order numberCard / ATM / CVSe-invoice issued

The only non-automated steps in the diagram are an operator ticking which products may sync, and re-sending a single record when a sync fails. Every other cross-system exchange is event-triggered and verified with an HMAC-SHA512 signature.

Two-way, not a one-way import

Products, stock and customer master data flow down from the ERP to the storefront, while orders and customers created on the storefront are pushed back up. With a one-way import, anything created on the e-commerce side would never reach the ERP, and the manual re-keying would still be there.

B2B and B2C push at different moments

B2B orders are settled on account terms and are pushed to the ERP the moment they are created; B2C orders wait for ECPay to confirm payment. One order model, with events deciding when to push, so unpaid orders never reserve ERP stock.

Failed syncs stay visible

Batch syncs across nearly two thousand products run in the background on Laravel Queue without blocking the storefront. The Filament admin shows live progress and a failure list, so a single record can be re-sent instead of replaying the whole batch.

Technical Details

ERP Product Sync

Syncs product names, multi-tier pricing (five tiers), EAN barcodes, inventory quantities, listing status, and more via the ERP vendor API's /product/QueryList and /Stock/QueryList endpoints. Supports manual sync by specifying product codes, or one-click sync for all products marked as syncable.

ERP Customer Sync

Customer data supports bi-directional sync: pulling customer lists from ERP (automatically distinguishing B2B Client / B2C Customer by code prefix), and pushing locally created customers back to ERP. Synced data covers basic info, company details, invoice settings, shipping thresholds, bonus points, and more.

ERP Order Sync

Orders use an event-driven architecture: B2B orders are pushed to ERP immediately upon creation, while B2C orders are automatically triggered after ECPay payment completion. Order pushes include master data (customer, address, invoice), line items (product SKU, quantity, unit price), and bonus point deductions. The order number and status returned by ERP are written back in real-time.

Background Jobs & Queues

Bulk sync operations run in the background via Laravel Queue to prevent blocking frontend operations. The Filament admin panel provides real-time progress tracking, and CLI commands support scheduled automation and manual triggers.

Tech Stack

Backend

  • Laravel 11
  • Filament Admin Panel
  • Laravel Queue

ERP Integration

  • KTNET TMS API
  • HMAC-SHA512 Signature
  • Products / Inventory / Customers / Orders
  • Bi-Directional Sync

Payment

  • ECPay
  • Credit Card / ATM / Convenience Store
  • E-Invoice

Frontend

  • TailwindCSS
  • Vite Build Tool
  • Responsive Design

FAQ

Why build "bi-directional" ERP sync instead of one-way import?

PFL's existing ERP already managed nearly 2,000 products and all customer data. A one-way import alone would mean new customers or orders couldn't be written back to the ERP, leaving staff to manually re-enter data. So we designed bi-directional sync: products and inventory flow from ERP to the e-commerce platform, and orders flow back to ERP once created, with HMAC-SHA512 signatures ensuring the security and authenticity of data in both directions.

How long does a project integrating e-commerce with bi-directional ERP sync usually take?

This project was completed in 2024, covering three sync modules — products, customers, and orders — plus ECPay payment integration and a Filament admin panel. A project of this scope typically takes 2–3 months, with the timeline varying based on how complete the ERP vendor's API is and the complexity of the data fields, such as PFL's five-tier pricing mechanism.

How are B2B and B2C orders each connected to the ERP — do they interfere with each other?

No — we used an event-driven architecture to keep the two flows independent: B2B (distributor) orders are pushed to ERP immediately upon creation, while B2C (consumer) orders sync automatically only after ECPay payment completes. Each path triggers independently and maps to its own pricing tier within the five-tier pricing structure, so neither interferes with the other.

CONTACT US

Have a similar project? Let's talk

Whether it's an e-commerce platform, ERP integration, or payment processing, we can build a tailored solution for you.

Contact Us
Visit Website