Tw ecom dtc shopline

From asgard-ai-platform/skills · View interactive version

Tw ecom dtc shopline is an AI agent skill from the GitHub repository asgard-ai-platform/skills. Integrate and operate Shopline in Taiwan e-commerce context via mcp-shopline. Use when the user needs to sync orders, manage products, run promotions, or reconcile inventory on Shopline stores; when comparing Shopline vs 91APP/Shopify for Taiwan DTC; or when debugging async write propagation. Do NOT

How to use this skill

Skill file

Shopline Integration Methodology

When to use this skill

Do NOT use when

Core concepts

Shopline is a SaaS commerce platform popular with Taiwan DTC and omnichannel brands. A single merchant account can own multiple shops (storefronts); each shop can sell through multiple channels (online + POS retail stores). mcp-shopline wraps Shopline Open API v1 into 143 tools (75 read, 68 write), all scoped to one API token = one merchant context.

Two axes matter when picking a tool:

Money is always TWD float. Dates are YYYY-MM-DD strings. Online orders use status confirmed; POS orders use completed — mixing them up silently drops half the data.

Decision tree

What is the user asking for?
│
├─ Aggregate metric (revenue, AOV, top products, trend)?
│    → Analytics / Orders summary tools
│      get_sales_summary · get_top_products · get_sales_trend
│      get_channel_comparison · get_rfm_analysis · get_promotion_roi
│
├─ Specific order / customer / product lookup?
│    → Read-detail tools
│      get_order_detail · get_customer_profile · get_product_variants
│
├─ Inventory question (stock, low-stock, warehouse)?
│    → Products & Inventory read tools
│      get_inventory_overview · get_low_stock_alerts ·
│      get_stock_by_warehouse · get_locked_inventory
│
├─ Promotion / coupon / flash sale?
│    ├─ Read  → list_promotions · get_promotion_detail ·
│    │          list_flash_price_campaigns · list_affiliate_campaigns
│    └─ Write → promotion write tools (12) — split into three sub-families:
│              flat promo · flash price · gift/add-on. See
│              references/tool-catalog.md for exact tool per family.
│
├─ Modify an order (status, tag, fulfill, cancel)?
│    → Order write tools (8) — require write scope
│
├─ Create/update customer, adjust store credits, group membership?
│    → Customer write tools (6)
│
└─ Configuration / debug (token scope, channels, payments, delivery)?
     → Store Settings read tools
       get_token_info (always start here when debugging permissions)
       list_channels · list_payments · list_delivery_options

Implementation guidance

Common multi-tool flows. For each, use the tool names below; see examples/sample_scenario.md for an end-to-end walkthrough.

Order sync (Shopline → internal ERP)

Promotion setup and measurement

Member / RFM sync

Inventory sync and replenishment

Gotchas

IRON LAW

Never filter orders on status or created_from alone. Online orders use confirmed, POS uses completed, and the store identity lives on order.channel.created_by_channel_name — not on created_from ("shop" / "pos"). Any order query that hard-codes one status or keys off created_from will silently drop POS revenue, misattribute store sales, or both. Always pass both statuses (or omit the filter) and always carry the channel name forward in downstream records.

Rationalization Table

| "但是…" | 為什麼錯 |

|---|---|

| 我只需要線上訂單,status=confirmed 就夠了 | POS 訂單用 completed,hard-code confirmed 會靜默丟失所有實體門市營收 |

| created_from 欄位明確標示 "shop" vs "pos",用它來分類就好 | created_from 不是通路身份的權威來源;門市名稱只在 order.channel.created_by_channel_name 中,跨店分析時用 created_from 會錯誤合併所有實體店 |

| 只拿 confirmed 是效能最佳化,不是資料遺失 | 範圍縮小不等於最佳化;用日期區間分頁才是正確的效能手段,不是靠省略 POS 訂單 |

| 這個報表只給線上部門,POS 不在範圍內 | 商業邏輯範圍不等於查詢範圍;即使報表只看線上,下游 ERP 或發票系統仍可能吃到這份 query 結果 |

Output Format

When completing a Shopline task, produce this structure:

# Shopline Task: {one-line summary}

## Context
- Merchant / shop: {name} (single-merchant token assumed)
- Scope of work: {read-only analysis | sync | write mutation | full integration}
- Date window / entity scope: {…}

## Tool Plan
| Step | Tool | Read/Write | Purpose |
|------|------|-----------|---------|
| 1 | get_token_info | R | Confirm scope covers the tools below |
| 2 | {tool} | R/W | {…} |
| … | … | … | … |

## Assumptions & Open Questions
- {assumption grounded in a Shopline constraint}
- TODO: {anything that needs verification against mcp-shopline or Open API docs}

## Execution Notes
- Both `confirmed` and `completed` statuses included: Y/N
- Channel name carried forward from `order.channel.created_by_channel_name`: Y/N
- Pagination strategy (date segmentation if >10k results): {…}
- Read-after-write handling (reconciliation loop, not immediate re-read): {…}

## Deliverable
{the actual answer, dataset, or change summary}

Related

_Last verified: 2026-04_

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.