Lazada Shopee Integration
Skill Profile
(Select at least one profile to enable specific modules)
Overview
Lazada and Shopee are major e-commerce marketplaces in Thailand and Southeast Asia. API integration enables sellers to manage products, orders, and inventory automatically from a central system, reducing manual work and improving operational efficiency.
Why This Matters
- Multi-channel: Sell across multiple platforms simultaneously
- Automation: Reduce manual order management tasks
- Inventory Sync: Prevent overselling and stockouts
- Analytics: Consolidate data from all channels
Core Concepts & Rules
1. Core Principles
- Follow established patterns and conventions
- Maintain consistency across codebase
- Document decisions and trade-offs
2. Implementation Guidelines
- Start with the simplest viable solution
- Iterate based on feedback and requirements
- Test thoroughly before deployment
Inputs / Outputs / Contracts
- Inputs:
- API credentials (appKey, appSecret, partnerId, partnerKey)
- OAuth access tokens for shop authorization
- Product data, inventory quantities, order details
- Entry Conditions:
- Developer account registered with Lazada and Shopee
- App created in respective developer portals
- Shop authorized via OAuth flow
- Outputs:
- Unified order data from both platforms
- Inventory sync status
- Shipping confirmation responses
- Artifacts Required (Deliverables):
- API client implementations
- Webhook handlers
- Database schema for orders and products
- Acceptance Evidence:
- Successful order sync test
- Inventory sync verification
- Webhook signature verification logs
- Success Criteria:
- Orders sync within 5 minutes of creation
- Inventory updates propagate to all channels
- Webhook events processed with signature validation
Skill Composition
- Depends on: Database setup, OAuth 2.0 implementation, webhook infrastructure
- Compatible with: Payment gateways, logistics providers, inventory management systems
- Conflicts with: Manual order management, direct platform uploads
- Related Skills: thai-logistics-integration, promptpay-integration
Quick Start / Implementation Example
- Review requirements and constraints
- Set up development environment
- Implement core functionality following patterns
- Write tests for critical paths
- Run tests and fix issues
- Document any deviations or decisions
# Example implementation following best practices
def example_function():
# Your implementation here
pass
Assumptions / Constraints / Non-goals
- Assumptions:
- Development environment is properly configured
- Required dependencies are available
- Team has basic understanding of domain
- Constraints:
- Must follow existing codebase conventions
- Time and resource limitations
- Compatibility requirements
- Non-goals:
- This skill does not cover edge cases outside scope
- Not a replacement for formal training
Compatibility & Prerequisites
- Supported Versions:
- Python 3.8+
- Node.js 16+
- Modern browsers (Chrome, Firefox, Safari, Edge)
- Required AI Tools:
- Code editor (VS Code recommended)
- Testing framework appropriate for language
- Version control (Git)
- Dependencies:
- Language-specific package manager
- Build tools
- Testing libraries
- Environment Setup:
.env.example keys: API_KEY, DATABASE_URL (no values)
Test Scenario Matrix (QA Strategy)
| Type |
Focus Area |
Required Scenarios / Mocks |
| Unit |
Core Logic |
Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
| Integration |
DB / API |
All external API calls or database connections must be mocked during unit tests |
| E2E |
User Journey |
Critical user flows to test |
| Performance |
Latency / Load |
Benchmark requirements |
| Security |
Vuln / Auth |
SAST/DAST or dependency audit |
| Frontend |
UX / A11y |
Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
Technical Guardrails & Security Threat Model
1. Security & Privacy (Threat Model)
- Top Threats: Injection attacks, authentication bypass, data exposure
2. Performance & Resources
3. Architecture & Scalability
4. Observability & Reliability
Agent Directives & Error Recovery
(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)
- Thinking Process: Analyze root cause before fixing. Do not brute-force.
- Fallback Strategy: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.
- Self-Review: Check against Guardrails & Anti-patterns before finalizing.
- Output Constraints: Output ONLY the modified code block. Do not explain unless asked.
Definition of Done (DoD) Checklist
Anti-patterns / Pitfalls
- ⛔ Don't: Log PII, catch-all exception, N+1 queries
- ⚠️ Watch out for: Common symptoms and quick fixes
- 💡 Instead: Use proper error handling, pagination, and logging
Reference Links & Examples
- Internal documentation and examples
- Official documentation and best practices
- Community resources and discussions
Versioning & Changelog
- Version: 1.0.0
- Changelog:
- 2026-02-22: Initial version with complete template structure
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: lazada-shopee-integration3description: Lazada and Shopee are major e-commerce marketplaces in Thailand and Southeast Use when this capability is needed.4---56# Lazada Shopee Integration78## Skill Profile9*(Select at least one profile to enable specific modules)*10- [ ] **DevOps**11- [x] **Backend**12- [ ] **Frontend**13- [ ] **AI-RAG**14- [ ] **Security Critical**1516## Overview17Lazada and Shopee are major e-commerce marketplaces in Thailand and Southeast Asia. API integration enables sellers to manage products, orders, and inventory automatically from a central system, reducing manual work and improving operational efficiency.1819## Why This Matters20- **Multi-channel**: Sell across multiple platforms simultaneously21- **Automation**: Reduce manual order management tasks22- **Inventory Sync**: Prevent overselling and stockouts23- **Analytics**: Consolidate data from all channels2425---2627## Core Concepts & Rules2829### 1. Core Principles30- Follow established patterns and conventions31- Maintain consistency across codebase32- Document decisions and trade-offs3334### 2. Implementation Guidelines35- Start with the simplest viable solution36- Iterate based on feedback and requirements37- Test thoroughly before deployment383940## Inputs / Outputs / Contracts41* **Inputs**:42 - API credentials (appKey, appSecret, partnerId, partnerKey)43 - OAuth access tokens for shop authorization44 - Product data, inventory quantities, order details45* **Entry Conditions**:46 - Developer account registered with Lazada and Shopee47 - App created in respective developer portals48 - Shop authorized via OAuth flow49* **Outputs**:50 - Unified order data from both platforms51 - Inventory sync status52 - Shipping confirmation responses53* **Artifacts Required (Deliverables)**:54 - API client implementations55 - Webhook handlers56 - Database schema for orders and products57* **Acceptance Evidence**:58 - Successful order sync test59 - Inventory sync verification60 - Webhook signature verification logs61* **Success Criteria**:62 - Orders sync within 5 minutes of creation63 - Inventory updates propagate to all channels64 - Webhook events processed with signature validation6566## Skill Composition67* **Depends on**: Database setup, OAuth 2.0 implementation, webhook infrastructure68* **Compatible with**: Payment gateways, logistics providers, inventory management systems69* **Conflicts with**: Manual order management, direct platform uploads70* **Related Skills**: [thai-logistics-integration](file://90-thai-integrations/thai-logistics-integration/SKILL.md), [promptpay-integration](file://90-thai-integrations/promptpay-integration/SKILL.md)7172---7374## Quick Start / Implementation Example75761. Review requirements and constraints772. Set up development environment783. Implement core functionality following patterns794. Write tests for critical paths805. Run tests and fix issues816. Document any deviations or decisions8283```python84# Example implementation following best practices85def example_function():86 # Your implementation here87 pass88```899091## Assumptions / Constraints / Non-goals9293* **Assumptions**:94 - Development environment is properly configured95 - Required dependencies are available96 - Team has basic understanding of domain97* **Constraints**:98 - Must follow existing codebase conventions99 - Time and resource limitations100 - Compatibility requirements101* **Non-goals**:102 - This skill does not cover edge cases outside scope103 - Not a replacement for formal training104105106## Compatibility & Prerequisites107108* **Supported Versions**:109 - Python 3.8+110 - Node.js 16+111 - Modern browsers (Chrome, Firefox, Safari, Edge)112* **Required AI Tools**:113 - Code editor (VS Code recommended)114 - Testing framework appropriate for language115 - Version control (Git)116* **Dependencies**:117 - Language-specific package manager118 - Build tools119 - Testing libraries120* **Environment Setup**:121 - `.env.example` keys: `API_KEY`, `DATABASE_URL` (no values)122123124## Test Scenario Matrix (QA Strategy)125126| Type | Focus Area | Required Scenarios / Mocks |127| :--- | :--- | :--- |128| **Unit** | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |129| **Integration** | DB / API | All external API calls or database connections must be mocked during unit tests |130| **E2E** | User Journey | Critical user flows to test |131| **Performance** | Latency / Load | Benchmark requirements |132| **Security** | Vuln / Auth | SAST/DAST or dependency audit |133| **Frontend** | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |134135136## Technical Guardrails & Security Threat Model137138### 1. Security & Privacy (Threat Model)139* **Top Threats**: Injection attacks, authentication bypass, data exposure140- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII141- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager142- [ ] **Authorization**: Validate user permissions before state changes143144### 2. Performance & Resources145- [ ] **Execution Efficiency**: Consider time complexity for algorithms146- [ ] **Memory Management**: Use streams/pagination for large data147- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks148149### 3. Architecture & Scalability150- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection151- [ ] **Modularity**: Decouple logic from UI/Frameworks152153### 4. Observability & Reliability154- [ ] **Logging Standards**: Structured JSON, include trace IDs `request_id`155- [ ] **Metrics**: Track `error_rate`, `latency`, `queue_depth`156- [ ] **Error Handling**: Standardized error codes, no bare except157- [ ] **Observability Artifacts**:158 - **Log Fields**: timestamp, level, message, request_id159 - **Metrics**: request_count, error_count, response_time160 - **Dashboards/Alerts**: High Error Rate > 5%161162163## Agent Directives & Error Recovery164*(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)*165166- **Thinking Process**: Analyze root cause before fixing. Do not brute-force.167- **Fallback Strategy**: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.168- **Self-Review**: Check against Guardrails & Anti-patterns before finalizing.169- **Output Constraints**: Output ONLY the modified code block. Do not explain unless asked.170171172## Definition of Done (DoD) Checklist173174- [ ] Tests passed + coverage met175- [ ] Lint/Typecheck passed176- [ ] Logging/Metrics/Trace implemented177- [ ] Security checks passed178- [ ] Documentation/Changelog updated179- [ ] Accessibility/Performance requirements met (if frontend)180181182## Anti-patterns / Pitfalls183184* ⛔ **Don't**: Log PII, catch-all exception, N+1 queries185* ⚠️ **Watch out for**: Common symptoms and quick fixes186* 💡 **Instead**: Use proper error handling, pagination, and logging187188189## Reference Links & Examples190191* Internal documentation and examples192* Official documentation and best practices193* Community resources and discussions194195196## Versioning & Changelog197198* **Version**: 1.0.0199* **Changelog**:200 - 2026-02-22: Initial version with complete template structure201202---203> Converted and distributed by [TomeVault](https://tomevault.io/claim/amnadtaowsoam) — claim your Tome and manage your conversions.204<!-- tomevault:4.0:skill_md:2026-04-13 -->