Business Context
A rapidly growing e-commerce business was struggling to keep up with order volume across multiple marketplaces (Shopee, TikTok Shop, and direct WhatsApp sales). The manual effort required to sync inventory and fulfill orders was capping their daily capacity and leading to "out-of-stock" errors that hurt platform ratings.
Problem
The primary bottleneck was the human-in-the-loop. Every order had to be manually recorded into a master spreadsheet from varied sources (Shopee, TikTok, WhatsApp), stock updated across all sites, and a delivery confirmation sent to the customer. At peak volume, this system was processing over 20,000 transactions, which made manual handling mathematically impossible without significant error.
Constraints
- Must handle bursts of 2,000+ orders during flash sales.
- Zero tolerance for double-selling inventory.
- Must integrate with closed-ecosystem marketplace APIs.
Architecture Design
I designed a distributed event-driven system. Instead of polling for updates, we used Webhooks and an API Gateway to capture events in real-time. A centralized "Fulfillment Orchestrator" handled the state machine for every order.
Implementation
The system was built using Python for the core logic due to its rich library support for market APIs. PostgreSQL was chosen for ACID compliance in inventory management. For the messaging layer, I implemented a custom WhatsApp API wrapper to send real-time delivery tracking to customers immediately upon order confirmation.
Business Impact
Throughput
Successfully processed 20,000+ automated transactions with zero human staff for fulfillment.
Accuracy
Order processing error rate dropped from 15% to near-zero (0.01%).
Latency
Inventory sync across multi-platforms (Shopee/TikTok) achieved 0.1s latency.
Revenue
30% month-over-month growth enabled by absolute operational scalability.
Technical Stack
- Python
- Supabase (PostgreSQL)
- Redis
- n8n Automation
- Docker Containerization
- Marketplace APIs