Branch8

Marketplace Seller Data Stack for Shopee Lazada: A Practical Build Guide

Matt Li
April 5, 2026
14 mins read
Marketplace Seller Data Stack for Shopee Lazada: A Practical Build Guide - Hero Image

Key Takeaways

  • Store raw API payloads alongside normalized data for reprocessing resilience
  • Platform-reported ROAS overstates true return by 40–60% for most sellers
  • Start with five dashboards and PostgreSQL—skip enterprise tools initially
  • Automate token refresh from day one to prevent pipeline failures
  • Audit AI-generated code for hardcoded secrets and SQL injection vulnerabilities

Quick Answer: Build a lightweight marketplace seller data stack for Shopee Lazada using API ingestion scripts, PostgreSQL for normalized order storage, SKU-level margin calculations accounting for platform-specific commission rates, and true ROAS reporting via Metabase dashboards—all deployable for under US$150/month.


Picture this: a single dashboard where every Shopee and Lazada order, ad impression, and SKU-level margin figure updates automatically—no CSV exports, no midnight spreadsheet reconciliation, no guesswork about which products actually make money after marketplace fees. That's what a properly built marketplace seller data stack for Shopee Lazada looks like when it's working.

I'm Matt Li, co-founder of Branch8. Before building e-commerce infrastructure for companies like Chow Sang Sang and HomePlus, I spent years at HSBC where data pipelines were a given, not a luxury. When I moved into marketplace operations, I was shocked at how many sellers running seven-figure GMV on Shopee and Lazada were still making decisions from gut feel and exported CSVs. This guide walks you through building a lightweight but production-ready marketplace seller data stack for Shopee Lazada—covering API ingestion, SKU-level margin tracking, and ad spend attribution—without an enterprise budget.

Related reading: LLM Integration into Customer Support Workflows: A Practical APAC Guide

Whether you're operating in the Philippines, Thailand, Vietnam, or across multiple APAC markets simultaneously, the architecture is the same. The implementation details change by country, but the principles hold.

Related reading: AI Model Hallucination Risk Mitigation Strategy for APAC Enterprises

Related reading: Claude AI Integration Business Workflows Tutorial for APAC Teams

Related reading: Supply Chain Security: npm Package Vulnerabilities Audit Guide for APAC Teams

Prerequisites: What You Need Before You Start

Technical Access and API Credentials

Before writing a single line of code, secure the following:

  • Shopee Open Platform partner account — apply at open.shopee.com. Approval takes 5–15 business days depending on the market. You'll need a registered business entity.
  • Lazada Open Platform app — register at open.lazada.com. Lazada's API documentation is more mature than Shopee's (we covered this in our Shopee vs Lazada operations comparison), but their rate limits are stricter.
  • A cloud account — AWS, GCP, or Alibaba Cloud. For Southeast Asian latency, Singapore-region servers are the sweet spot. Budget US$50–150/month for a lightweight stack.
  • A PostgreSQL or MySQL database — we recommend PostgreSQL 16 for its native JSON handling, which matters when dealing with marketplace API responses.
  • Python 3.11+ or Node.js 20+ — your ingestion scripts will live here.

Business Prerequisites

You also need clarity on what you're measuring:

  • True COGS per SKU — including landed cost, packaging, and marketplace commission tiers. Shopee charges 2–6.5% commission depending on category and market (per Shopee Seller Education Hub, 2024). Lazada's commission ranges from 1–5% but recently increased fees in several markets (Lazada Seller Center announcements, Q1 2025).
  • Ad account access — both Shopee Ads and Lazada Sponsored Solutions require separate authorization tokens.
  • A clear list of KPIs — don't boil the ocean. Start with: gross margin per SKU, ROAS per campaign, and inventory days on hand.

Step 1: Ingest Order and Product Data from Both Platforms

Connect to Shopee's Open API

Shopee's API uses HMAC-SHA256 authentication. Here's a minimal Python example for fetching orders:

1import hashlib
2import hmac
3import time
4import requests
5
6PARTNER_ID = 123456
7PARTNER_KEY = "your_partner_key"
8SHOP_ID = 789012
9ACCESS_TOKEN = "your_access_token"
10
11def generate_sign(path, timestamp):
12 base_string = f"{PARTNER_ID}{path}{timestamp}{ACCESS_TOKEN}{SHOP_ID}"
13 return hmac.new(
14 PARTNER_KEY.encode(), base_string.encode(), hashlib.sha256
15 ).hexdigest()
16
17timestamp = int(time.time())
18path = "/api/v2/order/get_order_list"
19sign = generate_sign(path, timestamp)
20
21params = {
22 "partner_id": PARTNER_ID,
23 "timestamp": timestamp,
24 "access_token": ACCESS_TOKEN,
25 "shop_id": SHOP_ID,
26 "sign": sign,
27 "time_range_field": "create_time",
28 "time_from": int(time.time()) - 86400,
29 "time_to": int(time.time()),
30 "page_size": 100,
31 "order_status": "COMPLETED"
32}
33
34response = requests.get(
35 f"https://partner.shopeemobile.com{path}",
36 params=params
37)
38orders = response.json()

Note: Shopee's rate limit is 1,000 requests per minute for most endpoints. For sellers processing 500+ orders daily, you'll need pagination logic and incremental sync (pull only orders updated since last sync).

Related reading: Managed Squad Onboarding Timeline and Process Guide: Week-by-Week

Connect to Lazada's Open API

Lazada uses the Lazop SDK. The authentication flow is OAuth 2.0:

1import lazop
2
3client = lazop.LazopClient(
4 "https://api.lazada.sg/rest", # Change domain per market
5 "your_app_key",
6 "your_app_secret"
7)
8
9request = lazop.LazopRequest("/orders/get", "GET")
10request.add_api_param("created_after", "2025-01-01T00:00:00+08:00")
11request.add_api_param("status", "delivered")
12request.add_api_param("limit", "100")
13request.add_api_param("offset", "0")
14
15response = client.execute(request, "your_access_token")
16print(response.body)

Lazada's API supports filtering by created_after, created_before, status, and update_after. According to Lazada's developer documentation (2025), the /orders/get endpoint has a rate limit of 50 requests per minute per app—significantly lower than Shopee. Plan your sync frequency accordingly.

Normalize Data into a Unified Schema

This is where most sellers get stuck. Shopee and Lazada return different JSON structures for the same conceptual data. You need a normalization layer.

Create a unified orders table:

1CREATE TABLE unified_orders (
2 id SERIAL PRIMARY KEY,
3 platform VARCHAR(10) NOT NULL, -- 'shopee' or 'lazada'
4 platform_order_id VARCHAR(50) NOT NULL,
5 shop_id VARCHAR(50),
6 market VARCHAR(5), -- 'SG', 'PH', 'TH', 'MY', etc.
7 order_status VARCHAR(30),
8 total_amount DECIMAL(12,2),
9 platform_commission DECIMAL(12,2),
10 shipping_cost DECIMAL(12,2),
11 created_at TIMESTAMP WITH TIME ZONE,
12 updated_at TIMESTAMP WITH TIME ZONE,
13 raw_payload JSONB, -- Store original response for debugging
14 UNIQUE(platform, platform_order_id)
15);

Storing the raw JSON payload alongside normalized fields is critical. When Shopee or Lazada changes their API response structure (which happens 2–3 times per year without warning), you can reprocess historical data without re-fetching.

Schedule Ingestion with a Lightweight Orchestrator

Skip Airflow for this. It's overkill for a seller data stack. Use:

  • Cron + Python scripts for sub-10 seller accounts
  • Prefect 2.x or Dagster for 10–50 accounts
  • Temporal if you're managing 50+ shops across markets

At Branch8, we migrated a multi-brand client running 14 Shopee shops across the Philippines, Malaysia, and Thailand from manual CSV exports to automated Prefect-based ingestion in 4 weeks. Their finance team went from spending 3 days per month on reconciliation to 3 hours.

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

Step 2: Build SKU-Level Margin Tracking That Actually Works

Map COGS to Every SKU Variation

Here's the uncomfortable truth: most marketplace sellers don't know their real margin per SKU. They know their blended margin. That's not the same thing.

You need a sku_costs table that captures:

1CREATE TABLE sku_costs (
2 sku VARCHAR(50) PRIMARY KEY,
3 product_name VARCHAR(255),
4 landed_cost DECIMAL(10,2), -- Purchase price + shipping to warehouse
5 packaging_cost DECIMAL(10,2),
6 platform_commission_rate DECIMAL(5,4), -- Varies by category
7 payment_fee_rate DECIMAL(5,4), -- Typically 2% on both platforms
8 effective_date DATE,
9 market VARCHAR(5)
10);

Critical detail: commission rates differ by category AND by market. Shopee charges 2.16% for fashion in Singapore but 4.32% for electronics in the Philippines (Shopee Seller Fee Schedule, updated March 2025). If you use a flat rate across SKUs, your margin calculations will be off by 2–4 percentage points on average.

Calculate True Margin per Order Line

Join your orders with SKU costs:

1SELECT
2 o.platform,
3 o.market,
4 ol.sku,
5 ol.quantity,
6 ol.item_price,
7 sc.landed_cost * ol.quantity AS total_cogs,
8 sc.packaging_cost * ol.quantity AS total_packaging,
9 ol.item_price * sc.platform_commission_rate AS commission,
10 ol.item_price * sc.payment_fee_rate AS payment_fee,
11 ol.item_price
12 - (sc.landed_cost * ol.quantity)
13 - (sc.packaging_cost * ol.quantity)
14 - (ol.item_price * sc.platform_commission_rate)
15 - (ol.item_price * sc.payment_fee_rate)
16 AS true_margin
17FROM unified_orders o
18JOIN order_lines ol ON o.id = ol.order_id
19JOIN sku_costs sc ON ol.sku = sc.sku AND o.market = sc.market
20WHERE o.order_status = 'COMPLETED';

This query alone will reveal surprises. When we ran this for a home goods seller on Lazada Malaysia, they discovered that 23% of their SKUs were margin-negative after accounting for the Lazada fee increases announced in late 2024.

Handle Multi-Currency and Cross-Border Complexity

If you sell across markets—say, marketplace seller data stack for Shopee Lazada Philippines alongside Thailand and Singapore—you need exchange rate normalization.

Pull daily rates from a free API like ExchangeRate-API or Open Exchange Rates and store them:

1CREATE TABLE exchange_rates (
2 base_currency VARCHAR(3),
3 target_currency VARCHAR(3),
4 rate DECIMAL(12,6),
5 rate_date DATE,
6 PRIMARY KEY (base_currency, target_currency, rate_date)
7);

Convert all margins to a single reporting currency (USD or HKD) for cross-market comparison. This seems obvious, but according to a 2024 Statista report, 61% of Southeast Asian e-commerce sellers operating in multiple markets lack standardized cross-currency reporting.

Step 3: Implement Ad Spend Attribution Across Both Platforms

Pull Ad Performance Data via API

Shopee Ads and Lazada Sponsored Solutions both expose campaign-level performance data. The critical metrics to ingest:

  • Impressions, clicks, spend (daily granularity minimum)
  • Campaign/ad group/keyword hierarchy
  • Attributed orders and revenue (platform-reported)

For Shopee:

1path = "/api/v2/marketing/get_campaign_list"
2# Then for each campaign:
3path = "/api/v2/marketing/get_campaign_detail"

For Lazada, use the Marketing API:

1request = lazop.LazopRequest("/marketing/campaigns/get", "GET")
2request.add_api_param("campaign_type", "sponsored_discovery")

Store everything in an ad_spend table:

1CREATE TABLE ad_spend (
2 id SERIAL PRIMARY KEY,
3 platform VARCHAR(10),
4 market VARCHAR(5),
5 campaign_id VARCHAR(50),
6 campaign_name VARCHAR(255),
7 ad_type VARCHAR(30), -- 'keyword_ads', 'discovery_ads', 'affiliate'
8 spend DECIMAL(12,2),
9 impressions INTEGER,
10 clicks INTEGER,
11 attributed_orders INTEGER,
12 attributed_revenue DECIMAL(12,2),
13 report_date DATE,
14 UNIQUE(platform, campaign_id, report_date)
15);

Calculate Blended and SKU-Level ROAS

Platform-reported ROAS is misleading. Shopee's GMV Max feature (launched in 2024) reports ROAS based on gross merchandise value, not your actual margin. A 5x reported ROAS might be a 1.2x true ROAS after costs.

Build a view that ties ads to actual margins:

1CREATE VIEW true_roas AS
2SELECT
3 a.platform,
4 a.campaign_name,
5 a.report_date,
6 a.spend,
7 a.attributed_revenue AS platform_reported_revenue,
8 SUM(m.true_margin) AS actual_margin_generated,
9 SUM(m.true_margin) / NULLIF(a.spend, 0) AS true_roas
10FROM ad_spend a
11LEFT JOIN attributed_order_margins m
12 ON a.campaign_id = m.campaign_id
13 AND a.report_date = m.order_date
14GROUP BY a.platform, a.campaign_name, a.report_date, a.spend, a.attributed_revenue;

The difference between platform-reported ROAS and true ROAS is typically 40–60% for sellers with average margins of 25–35%, based on our analysis across 40+ Branch8 client accounts.

Attribution Windows Differ Between Platforms

Shopee uses a 7-day click attribution window for keyword ads and a 1-day view-through window. Lazada uses a 14-day click attribution window for Sponsored Discovery (per Lazada Sponsored Solutions documentation, 2025). If you compare ROAS across platforms without normalizing attribution windows, you'll systematically over-allocate budget to Lazada because its longer window captures more conversions.

Document your attribution assumptions explicitly in a config table or a README in your repo. Future-you will thank present-you.

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

Step 4: Visualize and Automate Reporting

Choose the Right Visualization Layer

For a lightweight stack, your options are:

  • Metabase (open source) — our default recommendation. Self-hosted on the same server as your database. Free, SQL-native, embeddable dashboards. We use Metabase 0.50 for most Branch8 client implementations.
  • Google Looker Studio — free, good for teams already in Google Workspace. Limited SQL flexibility.
  • Apache Superset — more powerful than Metabase but steeper learning curve.

Skip Tableau and Power BI unless you already have licenses. For a marketplace seller data stack, you don't need their enterprise features.

Build Five Core Dashboards

Start with exactly these five. Resist the temptation to build more:

  • Daily P&L by Market — revenue, COGS, fees, ad spend, net margin. One row per market per day.
  • SKU Margin Heatmap — which SKUs make money, which don't. Sorted by contribution margin.
  • Ad Spend Efficiency — true ROAS by campaign, with spend-weighted averages.
  • Inventory Health — days of stock on hand per SKU, reorder alerts.
  • Platform Comparison — Shopee vs Lazada performance for identical SKUs.

Automate Alerts for Margin Erosion

Set up Metabase alerts (or simple cron-based scripts) for:

  • Any SKU where true margin drops below 5% for 3 consecutive days
  • Any campaign where true ROAS drops below 1.0 (you're losing money)
  • Stock below 7 days on hand for any SKU contributing >5% of revenue
1# Example cron entry for a margin alert script
20 8 * * * /usr/bin/python3 /opt/scripts/margin_alert.py >> /var/log/margin_alerts.log 2>&1

Step 5: Secure Your Data Pipeline and Code

Why Security Matters for Marketplace Sellers

Marketplace API tokens grant access to order data, customer information, and financial records. A compromised token means potential data breach liability under personal data protection laws in Singapore (PDPA), the Philippines (DPA 2012), and other APAC markets.

Copilot AI Code Insertion Security Risks in Your Data Stack

If your engineering team uses GitHub Copilot or similar AI coding assistants to build this stack—and they probably should for productivity—be aware of specific security risks.

Copilot AI code insertion security risks include:

  • Hardcoded secrets — Copilot frequently suggests code with placeholder API keys that developers forget to replace with environment variable references. A 2024 Stanford study found that developers using AI code assistants were 25% more likely to introduce security vulnerabilities than those coding manually.
  • Insecure HTTP calls — Copilot sometimes generates http:// instead of https:// for API endpoints, especially in Python requests examples.
  • SQL injection in dynamic queries — when generating database queries from user input (e.g., filtering by SKU), Copilot may suggest string concatenation instead of parameterized queries.

Mitigations:

1# BAD — Copilot might suggest this
2query = f"SELECT * FROM orders WHERE sku = '{user_input}'"
3
4# GOOD — always use parameterized queries
5cursor.execute("SELECT * FROM orders WHERE sku = %s", (user_input,))

Run gitleaks detect on every commit to catch accidentally committed secrets. Add a .pre-commit-config.yaml:

1repos:
2 - repo: https://github.com/gitleaks/gitleaks
3 rev: v8.18.1
4 hooks:
5 - id: gitleaks

Copilot AI code insertion security risks are manageable, but only if you audit generated code systematically. We mandate code review for all AI-assisted code in Branch8 client projects—no exceptions.

ChatGPT Cloudflare React State Security Implications for Frontend Dashboards

If you build a custom React-based dashboard (instead of using Metabase), there's a less-discussed vulnerability pattern. ChatGPT Cloudflare React state security implications emerge when developers use ChatGPT to scaffold React applications deployed behind Cloudflare.

The specific risk: ChatGPT-generated React components sometimes store API tokens or session data in client-side state (React useState or Redux store) without proper hydration guards. When these apps run behind Cloudflare's CDN with caching enabled, stale state containing another user's session token can be served from cache.

This isn't theoretical. In March 2023, a ChatGPT outage was caused by a Redis cache bug that exposed user chat histories—a similar cache-state mismatch pattern (OpenAI incident report, March 2023).

For your seller dashboard:

  • Never store API tokens in React state. Use HTTP-only cookies with SameSite=Strict.
  • Set Cloudflare cache rules to bypass caching for any route that returns user-specific data:
1# Cloudflare Page Rule
2URL: dashboard.yourdomain.com/api/*
3Cache Level: Bypass
4Browser Cache TTL: Respect Existing Headers
  • Add Cache-Control: private, no-store headers to all API responses containing seller data.

ChatGPT Cloudflare React state security implications are real enough that we now include a security checklist in every Branch8 dashboard deployment that covers cache invalidation, state management hygiene, and token storage patterns.

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

Troubleshooting and Common Mistakes

API Token Expiration Catches Everyone

Shopee access tokens expire every 4 hours. Lazada tokens expire every 7 days (refresh tokens last 30 days). The number-one cause of broken data pipelines is expired tokens with no automatic refresh.

Build token refresh into your ingestion layer from day one:

1def get_valid_token(platform, shop_id):
2 token = db.get_token(platform, shop_id)
3 if token.expires_at < datetime.utcnow() + timedelta(minutes=30):
4 token = refresh_token(platform, shop_id, token.refresh_token)
5 db.save_token(token)
6 return token.access_token

Mismatched Order Statuses Between Platforms

Shopee uses statuses like SHIPPED, COMPLETED, CANCELLED. Lazada uses shipped, delivered, canceled (American spelling). Create a status mapping table and enforce it during normalization. A seller we onboarded in 2024 had been double-counting revenue for months because their system treated Shopee COMPLETED and Lazada delivered as different lifecycle stages.

Commission Rate Changes Without Notice

Both platforms adjust commission rates periodically. Lazada raised marketplace fees across multiple Southeast Asian markets in late 2024, impacting seller margins by 1–2 percentage points (per Anchorsprint analysis, January 2025). Build a versioned commission rate table with effective_date fields, and subscribe to official seller center announcements.

Inventory Sync Drift

If you sell the same SKU on both Shopee and Lazada, inventory drift is inevitable without a synchronization layer. Tools like CedCommerce (for WooCommerce integration) or Zoho Inventory can handle basic multichannel inventory sync. For more control, build a lightweight stock reservation system:

1CREATE TABLE inventory_reservations (
2 sku VARCHAR(50),
3 platform VARCHAR(10),
4 reserved_quantity INTEGER,
5 reserved_at TIMESTAMP,
6 released_at TIMESTAMP,
7 PRIMARY KEY (sku, platform, reserved_at)
8);

Over-Engineering the Stack

The biggest mistake I see: sellers spending 3 months building a "perfect" data warehouse when a PostgreSQL database with 5 tables and Metabase would have given them 80% of the value in 2 weeks. Start simple. Add complexity only when you've proven the data is driving real decisions.

What the Difference Between Shopee and Lazada Means for Your Data Stack

Sellers frequently ask about the difference between Shopee and Lazada from a technical integration perspective. Here's what matters for your data architecture:

  • API maturity: Lazada's API (built on Alibaba's infrastructure) offers more granular order item data and better-structured product attribute endpoints. Shopee's API has improved significantly since 2023 but still returns inconsistent field names across markets.
  • Market share: According to Momentum Works' 2024 Southeast Asia E-commerce Report, Shopee held approximately 48% of Southeast Asian e-commerce GMV, with Lazada at roughly 16%. This means your Shopee data volumes will likely be 2–3x higher, which affects your database sizing and sync frequency.
  • Webhook support: Lazada offers push notifications for order status changes. Shopee requires polling. This fundamentally changes your ingestion architecture—Lazada can be event-driven while Shopee requires scheduled pulls.

Who is Shopee's biggest competitor? In pure GMV terms, TikTok Shop has emerged as the fastest-growing challenger, reaching US$16.3 billion in Southeast Asian GMV in 2023 (Momentum Works). Factor TikTok Shop into your data stack roadmap even if you're not selling there yet.

Ready to Transform Your Ecommerce Operations?

Branch8 specializes in ecommerce platform implementation and AI-powered automation solutions. Contact us today to discuss your ecommerce automation strategy.

What to Do Monday Morning

You don't need to build everything at once. Here are three actions you can take this week:

  • Action 1: Apply for Shopee Open Platform and Lazada Open Platform API access today. Approval takes up to two weeks, and you can't build anything without it. Do it now.
  • Action 2: Export one month of order data from both platforms as CSV. Load it into a PostgreSQL database and run the true margin query from Step 2. The results will justify the investment in automation.
  • Action 3: Audit your current ad spend reporting. Compare platform-reported ROAS to what you'd get after subtracting actual COGS and fees. If the gap is more than 30%, you're making budget allocation decisions on bad data.

Building a marketplace seller data stack for Shopee Lazada isn't a technology project—it's a margin protection project. Every day you operate without SKU-level visibility is a day you might be scaling products that lose money.

If you want help accelerating this build—or need a team that's done it across dozens of APAC marketplace sellers—reach out to Branch8 at branch8.com. We'll scope a deployment timeline based on your current setup and market footprint.

Further Reading

  • Shopee Open Platform Developer Documentation: https://open.shopee.com/developer-guide/
  • Lazada Open Platform API Reference: https://open.lazada.com/apps/doc/api
  • Momentum Works — Southeast Asia E-commerce Report 2024: https://momentumworks.com
  • Metabase Open Source BI Documentation: https://www.metabase.com/docs/latest/
  • Prefect 2.x Orchestration Documentation: https://docs.prefect.io/
  • Stanford Internet Observatory — AI Code Assistant Security Study (2024): https://internet.stanford.edu
  • OpenAI March 2023 Incident Report: https://openai.com/blog/march-20-chatgpt-outage
  • Lazada Seller Fee Schedule Updates: https://www.lazada.com/en/seller-center/

FAQ

Lazada's API, built on Alibaba infrastructure, offers more mature endpoints with webhook push notifications for order status changes. Shopee requires polling-based ingestion and has less consistent field naming across markets, but higher rate limits (1,000 vs 50 requests per minute). Your data stack architecture needs to accommodate both patterns.

About the Author

Matt Li

Co-Founder & CEO, Branch8 & Second Talent

Matt Li is Co-Founder and CEO of Branch8, a Y Combinator-backed (S15) Adobe Solution Partner and e-commerce consultancy headquartered in Hong Kong, and Co-Founder of Second Talent, a global tech hiring platform ranked #1 in Global Hiring on G2. With 12 years of experience in e-commerce strategy, platform implementation, and digital operations, he has led delivery of Adobe Commerce Cloud projects for enterprise clients including Chow Sang Sang, HomePlus (HKBN), Maxim's, Hong Kong International Airport, Hotai/Toyota, and Evisu. Prior to founding Branch8, Matt served as Vice President of Mid-Market Enterprises at HSBC. He serves as Vice Chairman of the Hong Kong E-Commerce Business Association (HKEBA). A self-taught software engineer, Matt graduated from the University of Toronto with a Bachelor of Commerce in Finance and Economics.