{"id":"f403e833-eb60-4283-ae53-7c707a97004c","entityType":"agent","slug":"clawhub-linkfox-ai-linkfox-shopee-store-auth","name":"Shopee-店铺授权","canonicalUrl":"https://www.xpersona.co/agent/clawhub-linkfox-ai-linkfox-shopee-store-auth","canonicalPath":"/agent/clawhub-linkfox-ai-linkfox-shopee-store-auth","generatedAt":"2026-10-12T11:03:14.398Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T23:57:10.108Z","emptyReason":null},"description":"Shopee（虾皮）店铺授权与管理技能，支持 ERP 与广告（AD）双应用分开授权。提供授权流程、已授权店铺查询以及授权状态读取。授权时可填写店铺名 shopName，region 支持 cn / global / br，appType 支持 erp / ad。当用户提到 Shopee 店铺授权、虾皮店铺绑定、ERP 授权、广告授权、appType、查询已授权 Shopee 店铺、Shopee seller authorization, bind Shopee shop, Shopee Ads authorization 时触发。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、ERP/广告应用授权或店铺列表查询，也应触发。 Skill: Shopee-店铺授权 Owner: linkfox-ai Summary: Shopee（虾皮）店铺授权与管理技能，支持 ERP 与广告（AD）双应用分开授权。提供授权流程、已授权店铺查询以及授权状态读取。授权时可填写店铺名 shopName，region 支持 cn / global / br，appType 支持 erp / ad。当用户提到 Shopee 店铺授权、虾皮店铺绑定、ERP 授权、广告授权、appType、查询已授权 Shopee 店铺、Shopee seller authorization, bind Shopee shop, Shopee Ads authorization 时触发。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、ERP/广告应用授权或店铺列表查询，也应触发。 Tags: latest:1.0.5 Version history: v1.0.5 | 202","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 972 downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s171g8b6m2khwdy9ye8bxj0wx183vd4z:linkfox-shopee-store-auth","sourceUrl":"https://clawhub.ai/linkfox-ai/linkfox-shopee-store-auth","homepage":"https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-auth","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/linkfox-ai/linkfox-shopee-store-auth","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-auth","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Shopee（虾皮）店铺授权与管理技能，支持 ERP 与广告（AD）双应用分开授权。提供授权流程、已授权店铺查询以及授权状态读取。授权时可填写店铺名 shopName，region 支持 cn / global / br，appType 支持 erp / ad。当用户提到 Shopee 店铺授权、虾皮店铺绑定、ERP "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T23:57:10.108Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T23:57:10.108Z","emptyReason":null},"stars":null,"forks":null,"downloads":972,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"1.0.5","tractionLabel":"972 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T23:57:10.101Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T23:57:10.108Z","lastCrawledAt":"2026-10-11T23:57:10.101Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T23:57:10.101Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.5","createdAt":"2026-08-14T15:02:28.868Z","changelog":"Update from 1.0.4 to 1.0.5","fileCount":11,"zipByteSize":28319},{"version":"1.0.4","createdAt":"2026-08-07T10:59:27.427Z","changelog":"Update from 1.0.3 to 1.0.4","fileCount":11,"zipByteSize":28311},{"version":"1.0.3","createdAt":"2026-07-13T12:19:52.342Z","changelog":"Update from 1.0.2 to 1.0.3","fileCount":8,"zipByteSize":16090},{"version":"1.0.2","createdAt":"2026-07-06T11:28:22.624Z","changelog":"Update from 1.0.1 to 1.0.2","fileCount":8,"zipByteSize":15198},{"version":"1.0.1","createdAt":"2026-07-03T08:27:44.543Z","changelog":"Update from 1.0.0 to 1.0.1","fileCount":7,"zipByteSize":13955},{"version":"1.0.0","createdAt":"2026-07-02T13:22:46.786Z","changelog":"Initial release","fileCount":8,"zipByteSize":15277}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s171g8b6m2khwdy9ye8bxj0wx183vd4z:linkfox-shopee-store-auth","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-auth/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-auth/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-auth/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-auth/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-auth/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-auth/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-12T11:03:14.395Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-auth/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-auth/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-auth/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-auth/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T23:57:10.108Z","emptyReason":null},"readme":"Skill: Shopee-店铺授权\n\nOwner: linkfox-ai\n\nSummary: Shopee（虾皮）店铺授权与管理技能，支持 ERP 与广告（AD）双应用分开授权。提供授权流程、已授权店铺查询以及授权状态读取。授权时可填写店铺名 shopName，region 支持 cn / global / br，appType 支持 erp / ad。当用户提到 Shopee 店铺授权、虾皮店铺绑定、ERP 授权、广告授权、appType、查询已授权 Shopee 店铺、Shopee seller authorization, bind Shopee shop, Shopee Ads authorization 时触发。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、ERP/广告应用授权或店铺列表查询，也应触发。\n\nTags: latest:1.0.5\n\nVersion history:\n\nv1.0.5 | 2026-08-14T15:02:28.868Z | user\n\nUpdate from 1.0.4 to 1.0.5\n\nv1.0.4 | 2026-08-07T10:59:27.427Z | user\n\nUpdate from 1.0.3 to 1.0.4\n\nv1.0.3 | 2026-07-13T12:19:52.342Z | user\n\nUpdate from 1.0.2 to 1.0.3\n\nv1.0.2 | 2026-07-06T11:28:22.624Z | user\n\nUpdate from 1.0.1 to 1.0.2\n\nv1.0.1 | 2026-07-03T08:27:44.543Z | user\n\nUpdate from 1.0.0 to 1.0.1\n\nv1.0.0 | 2026-07-02T13:22:46.786Z | user\n\nInitial release\n\nArchive index:\n\nArchive v1.0.5: 11 files, 28319 bytes\n\nFiles: references/api.md (6365b), references/onboarding.md (2046b), scripts/_lf_output.py (6404b), scripts/_token_status_output.py (1106b), scripts/authorize_url.py (6829b), scripts/authorized_stores.py (2700b), scripts/onboarding.py (24089b), scripts/store_tokens.py (3239b), skill-card.md (2620b), SKILL.md (11611b), _meta.json (144b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: linkfox-shopee-store-auth\ndescription: Shopee（虾皮）店铺授权与管理技能，支持 ERP 与广告（AD）双应用分开授权。提供授权流程、已授权店铺查询以及授权状态读取。授权时可填写店铺名 shopName，region 支持 cn / global / br，appType 支持 erp / ad。当用户提到 Shopee 店铺授权、虾皮店铺绑定、ERP 授权、广告授权、appType、查询已授权 Shopee 店铺、Shopee seller authorization, bind Shopee shop, Shopee Ads authorization 时触发。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、ERP/广告应用授权或店铺列表查询，也应触发。\n---\n\n# Shopee 店铺授权与管理\n\nShopee Open Platform 的 OAuth 授权、已授权店铺列表、授权状态读取。**下游业务的前置依赖**（经 `/shopee/developerProxy` 调用开放接口）。\n\nShopee **ERP** 与 **广告（AD）** 使用不同应用与 Token，必须按能力分开授权。\n\n## Core Concepts\n\n- **双应用**：`appType=erp`（商品/订单/物流等，默认）与 `appType=ad`（站内广告）彼此独立；同店可同时有两条授权\n- **授权流程**：生成 URL → 用户浏览器授权 → Shopee 推送 Token → 系统按 `state` 落库\n- **店铺标识**：`shopId` 与 `merchantId` 二选一即可定位；判断是否已授权须同时匹配 **`shopId/merchantId + appType`**\n- **shopName 建议填写**：调 `authorize_url.py` 前建议问用户要一个便于识别的店铺名（API 非必填）\n- **授权 URL 1 小时有效**：每次授权重新调用 `authorize_url.py`，不要缓存旧地址\n- **下游选店**：业务 skill 经 `developerProxy` 只传 **`shopId`/`merchantId` + path**；**勿**传 `accessToken`，也**勿**在 proxy 里传 `appType`（服务端按 path 自动路由：`api/v2/ads/**` → AD，其它 `api/v2/**` → ERP）\n- **accessToken 约 4 小时有效**（`expireIn` 通常 14400）；过期需按对应 `appType` 重新授权\n\n## Shopee authorization routing\n\n- Use `appType=erp` for product, order, logistics, and other ERP authorization.\n- Use `appType=ad` for Shopee Ads authorization.\n- Treat a missing or blank `appType` as `erp`.\n- Check authorization by both store identity and `appType`; one store may have separate ERP and AD records.\n- If the user needs both capabilities, obtain two fresh authorization URLs and explain that both authorizations must be completed.\n- Authorization URLs expire after one hour, so obtain a new URL for every authorization attempt.\n\nWhen calling `developerProxy`, pass the Shopee API path plus `shopId` or `merchantId`. Do not pass `appType` or an access token. The service routes `api/v2/ads/**` through the AD application and all other `api/v2/**` paths through the ERP application.\n\n## 可用脚本\n\n| 脚本 | 作用 |\n|------|------|\n| `authorize_url.py` | 生成授权 URL（可选 `shopName` / `region` / **`appType`**） |\n| `authorized_stores.py` | 列出已授权店铺（含 **`appType`**；同店可能两条） |\n| `store_tokens.py` | 查指定应用的授权/令牌**状态**（非下游 token 来源；须带 `appType` 区分） |\n\n入参、响应字段、错误码见 `references/api.md`。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/{authorizeUrl|storeTokens|authorizedStores}`（完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 解决认证和积分问题\n发生以下异常情况时，采用 references/onboarding.md 引导解决问题：\n\n### 异常情况\n- **未配置API Key**：环境变量未配置 `LINKFOX_AGENT_API_KEY`，也未配置 `LINKFOXAGENT_API_KEY`。\n- **响应401或402状态码**\n- **响应提示积分或余额不足**：消息含\"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值\"，或类似含义的内容。\n\n## 支持区域\n\n`cn`（中国跨境，默认） / `global`（全球授权页） / `br`（巴西）。默认 `cn`。\n\n## Usage Scenarios\n\n### 1. 新授权店铺（ERP，默认）\n\n1. 建议问用户要 `shopName`（便于后续识别；API 非必填）\n2. 确认 `region`（默认 `cn`；全球站 `global`，巴西 `br`）\n3. 调 `authorize_url.py`，传 **`appType=erp`**（或不传，服务端默认 erp）→ 给用户在浏览器打开（安全警告：为保障店铺安全，请务必在日常运营该店铺的安全网络环境中打开此链接。强烈建议使用紫鸟浏览器等专业的防关联浏览器进行授权，切勿在陌生或公共网络下操作。）\n4. 授权完成后系统自动存 token；浏览器跳转成功/失败页\n5. 调 `authorized_stores.py`，确认存在 **`appType=erp`**（或空，历史记录视为 erp）的记录\n\n### 2. 广告应用授权（AD）\n\n1. 调 `authorized_stores.py`，检查目标店是否已有 **`appType=ad`**\n2. 未授权时调 `authorize_url.py`，传 **`appType=ad`**，并明确告知用户这是**广告应用**授权（与 ERP 无关）\n3. 授权完成后再次检查 `appType=ad`\n4. **禁止**用 ERP 授权代替广告授权\n\n### 3. 同时需要 ERP 与广告\n\n1. 分别检查 `appType=erp` 与 `appType=ad`\n2. 仅为缺失的应用生成授权地址；两项都缺则生成**两个** URL，并标注用途\n3. 提示用户需分别打开并完成两次授权；一次授权不会覆盖另一项能力\n\n### 4. 列已授权店铺\n\n调 `authorized_stores.py`，展示 `shopName / shopId / merchantId / region / **appType**`。同店可能出现 ERP、AD 两条。\n\n### 5. 给下游准备店铺选店信息（高频）\n\n用户只说自然语言（\"我的虾皮店\"、\"67890 那家店\"），**不要让用户报冗长 token**。\n\n| 用户上下文 | Agent 动作 |\n|---|---|\n| 只授权 1 家店铺（且目标能力已授权） | 直接取该店铺 `shopId`（或 `merchantId`），不问 |\n| 授权 ≥ 2 家 + 只说店名 | 按 `shopName` 向用户澄清 |\n| 同时给出 shopName 或 shopId | 直接定位 |\n| 显式给出 shopId / merchantId | 直接用 |\n| 店铺在列表中存在但缺少目标 `appType` | 按能力发起对应授权，**不要**调用业务接口 |\n\n**静默原则**：定位成功时只确认店铺标识与应用类型，不向用户索要 token。\n\n**推荐流程**：`authorized_stores.py` 按 **`shopId + appType`** 确认已授权 → 下游 skill 直接 `POST /shopee/developerProxy` 传入 `shopId`（或 `merchantId`），由服务端按 path 解析对应应用 token。\n\n`store_tokens.py` **仅用于**确认授权/令牌状态（须传 `appType`），**不要**为 proxy 调用先取 `accessToken`。\n\n## 调用原则\n\n- 授权前建议确认 `shopName`、`region`、**`appType`**\n- 不假设 `storeTokens` 响应含 raw `accessToken`；展示状态与过期元数据即可\n- 授权失败按错误码解释原因；不擅自重试\n- 令牌过期须按对应 `appType` 重新走授权流程\n- 历史空 `app_type` 视为 ERP，不是 AD\n\n## 常见问题\n\n### 授权完成但查不到店铺\n\n原因：Token 推送回调（`/shopee/oauth/tokenCallback`）未成功落库，或 `state` 不匹配。\n解决：查看服务日志；重新调 `authorize_url.py`（勿复用过期 URL）完成授权。\n\n### 查令牌 / 业务调用返回 1004\n\n原因：`shopId` / `merchantId` 错误，或**目标应用**未授权（例如只有 ERP、没有 AD）。\n解决：先调 `authorized_stores.py` 核对 `shopId + appType`；缺则按能力重新授权。\n\n### 店铺已授权但广告 API 失败\n\n原因：有 ERP 记录 ≠ 有 AD 记录；广告不能使用 ERP Token。\n解决：发起 `appType=ad` 授权后再调 `linkfox-shopee-store-ads`。\n\n## Not Applicable\n\n- **Shopee 订单查询与处理** → `linkfox-shopee-store-orders`\n- **Shopee 店铺信息与设置** → `linkfox-shopee-store-shop`\n- **Shopee 店铺商品 listing** → `linkfox-shopee-store-product`\n- **Shopee 跨境全球商品 GlobalProduct** → `linkfox-shopee-store-global-product`\n- **Shopee 跨境商户信息 Merchant** → `linkfox-shopee-store-merchant`\n- **Shopee 物流发货 Logistics** → `linkfox-shopee-store-logistics`\n- **Shopee 退货退款 Returns** → `linkfox-shopee-store-returns`\n- **Shopee 站内广告 Ads** → `linkfox-shopee-store-ads`（业务调用；授权仍用本 skill 的 `appType=ad`）\n- **Shopee 支付结算 Payment** → `linkfox-shopee-store-payment`\n- **Shopee 联盟营销 AMS** → `linkfox-shopee-store-ams`\n- **Shopee 店铺视频 Video** → `linkfox-shopee-store-video`\n- **Shopee 媒体上传 MediaSpace** → `linkfox-shopee-store-media-space`\n- **Shopee 媒体上传 Media** → `linkfox-shopee-store-media`（`api/v2/media/...`，module=130）\n- **Shopee 头程物流 FirstMile** → `linkfox-shopee-store-first-mile`\n- **Shopee 折扣促销 Discount** → `linkfox-shopee-store-discount`\n- **Shopee 套装优惠 Bundle Deal** → `linkfox-shopee-store-bundle-deal`\n- **Shopee 加购优惠 Add-On Deal** → `linkfox-shopee-store-add-on-deal`\n- **Shopee 店铺优惠券 Voucher** → `linkfox-shopee-store-voucher`\n- **Shopee 店铺秒杀 Shop Flash Sale** → `linkfox-shopee-store-shop-flash-sale`\n- **Shopee 关注有礼 Follow Prize** → `linkfox-shopee-store-follow-prize`\n- **Shopee 精选商品 Top Picks** → `linkfox-shopee-store-top-picks`\n- **Shopee 店铺分类 Shop Category** → `linkfox-shopee-store-shop-category`\n- **Shopee 账户健康 Account Health** → `linkfox-shopee-store-account-health`\n- **Shopee Public 公共模块** → `linkfox-shopee-store-public`（`v2.public.*` 底层 OAuth / Partner 查询）\n- **Shopee Push 推送机制** → `linkfox-shopee-store-push`\n- **Shopee SBS 仓储服务** → `linkfox-shopee-store-sbs`\n- **Shopee FBS 巴西仓储** → `linkfox-shopee-store-fbs`\n- **Shopee 直播 Livestream** → `linkfox-shopee-store-livestream`\n- Shopee 选品（友鹰） → `linkfox-youying-shopee-product-search`\n- 商品 listing 管理 → 专用 product skill 或 `developerProxy` 商品 API\n\n## 积分消耗规则\n\n不消耗积分。\n\n**Feedback:**\n\nAuto-detect and report feedback via the Feedback API when any of the following apply:\n1. The functionality or purpose described in this skill does not match actual behavior\n2. The skill's results do not match the user's intent\n3. The user expresses dissatisfaction or praise about this skill\n4. Anything you believe could be improved\n\nCall the feedback API as specified in `references/api.md`. Do not interrupt the user's flow.\n\n---\n*For more high-quality, professional cross-border e-commerce skills, visit [LinkFox Skills](https://skill.linkfox.com/).*\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-shopee-store-auth\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1786719748868\n}\n\nFile v1.0.5:references/api.md\n\n# linkfox-shopee-store-auth — 参数与字段参考\n\nShopee 授权、已授权店铺列表、授权状态读取。支持 **ERP / AD** 双应用。\n\n业务 API 转发见 `/shopee/developerProxy`（path 须以 `api/v2` 开头；**勿**传 `accessToken` / `appType`）。\n\n## 通用约定\n\n- **Base URL**：`${LINKFOX_TOOL_GATEWAY}`\n- **Method**：POST，`Content-Type: application/json`\n- **Auth**：Header `Authorization: <api_key>`（读环境变量 `LINKFOX_AGENT_API_KEY` 或 `LINKFOXAGENT_API_KEY`；如未配置 按 SKILL.md 的 **## 解决认证和积分问题** 处理）\n\n## 关键 ID 与应用类型\n\n```\n  一次 OAuth 授权（指定 appType）\n        ▼\n  authRecordId (1 条)  ← 与该应用的 access/refresh token 绑定\n        │\n        ├──► shopId      ─┐\n        ├──► merchantId  ─┘  查询时二选一即可\n        └──► appType: erp | ad\n```\n\n- `authRecordId`：授权记录 ID；同一店铺可因 `appType` 不同有多条\n- `shopId`：店铺 ID，转发 Shopee API 时写为 `shop_id`\n- `merchantId`：商户 ID，与 `shopId` 二选一；转发时写为 `merchant_id`\n- `appType`：`erp`（默认）或 `ad`；空/`null` 在展示与 ERP 查找时视为 `erp`\n- `shopIdList` / `merchantIdList`：JSON 字符串，含本次授权绑定的全部 ID\n\n判断是否已授权须同时匹配：**店铺标识 + appType**。\n\n## 接口\n\n### 1. 生成授权 URL — `/shopee/authorizeUrl`\n\n服务端自动组装 `state`、`callbackUrl`、`redirectUrl`。授权地址约 **1 小时**有效，每次重新获取。\n\n**Request**：\n| 参数 | 类型 | 必填 | 默认 | 说明 |\n|------|------|------|------|------|\n| `shopName` | string | 否 | - | 店铺展示名，便于在列表识别 |\n| `region` | string | 否 | `cn` | `cn` / `global` / `br` |\n| `appType` | string | 否 | `erp` | 只允许 `erp` 或 `ad` |\n\n**Response**：\n```json\n{\"sourceType\": \"shopee\", \"authorizeUrl\": \"https://open.shopee.cn/auth?...&state=abc123\"}\n```\n\n授权完成后 Token 由 Shopee POST 到 `/shopee/oauth/tokenCallback`（系统内部）；浏览器跳转 `/shopee/oauth/redirect`，不作为公开接口。\n\nERP 示例：\n```json\n{\"shopName\": \"Example Shop\", \"region\": \"cn\", \"appType\": \"erp\"}\n```\n\n广告示例：\n```json\n{\"shopName\": \"Example Shop\", \"region\": \"cn\", \"appType\": \"ad\"}\n```\n\n---\n\n### 2. 列已授权店铺 — `/shopee/authorizedStores`\n\n**Request**：无（用当前用户上下文）\n\n**Response**：\n```json\n{\n  \"total\": 2,\n  \"stores\": [\n    {\n      \"authRecordId\": 1,\n      \"shopId\": \"67890\",\n      \"merchantId\": \"12345\",\n      \"shopIdList\": \"[67890]\",\n      \"merchantIdList\": \"[12345]\",\n      \"shopName\": \"Test Shopee Shop\",\n      \"region\": \"cn\",\n      \"appType\": \"erp\"\n    },\n    {\n      \"authRecordId\": 2,\n      \"shopId\": \"67890\",\n      \"merchantId\": \"12345\",\n      \"shopName\": \"Test Shopee Shop\",\n      \"region\": \"cn\",\n      \"appType\": \"ad\"\n    }\n  ]\n}\n```\n\n同一个店铺可能返回 ERP、AD 两条。缺 `appType` 的历史记录按 **erp** 理解。\n\n---\n\n### 3. 查询授权状态 — `/shopee/storeTokens`\n\n只返回授权状态/元数据，**不返回**原始 access token 或 refresh token（脚本侧也会剥离）。\n\n**Request**（`shopId` 与 `merchantId` 二选一）：\n| 参数 | 类型 | 必填 | 默认 | 说明 |\n|------|------|------|------|------|\n| `shopId` | string | 与 merchantId 二选一 | - | 店铺 ID |\n| `merchantId` | string | 与 shopId 二选一 | - | 商户 ID |\n| `appType` | string | 否 | `erp` | `erp` 或 `ad` |\n\n**Response（状态示例）**：\n```json\n{\n  \"authRecordId\": 1,\n  \"shopId\": \"67890\",\n  \"merchantId\": \"12345\",\n  \"appType\": \"ad\",\n  \"tokenType\": \"Bearer\",\n  \"expireIn\": 14400,\n  \"status\": \"ok\"\n}\n```\n\n本接口**不触发刷新**，仅读 DB。`expireIn` 为 access_token 剩余有效秒数（通常 14400）。\n\n**不要**用本接口取 token 再传给 `/shopee/developerProxy`；proxy 由服务端按 path 注入对应应用 Token。\n\n---\n\n### 4. 业务转发（下游，非本 skill 脚本）— `/shopee/developerProxy`\n\n```json\n{\n  \"path\": \"api/v2/product/get_item_list\",\n  \"method\": \"GET\",\n  \"shopId\": \"67890\",\n  \"queryString\": \"offset=0&page_size=20&item_status=NORMAL\"\n}\n```\n\n广告路径示例（自动走 AD Token）：\n```json\n{\n  \"path\": \"api/v2/ads/get_total_balance\",\n  \"method\": \"GET\",\n  \"shopId\": \"67890\"\n}\n```\n\n- `path` 必须以 `api/v2` 开头\n- `shopId` 与 `merchantId` 至少传一个\n- `accessToken` 已废弃，传入也会被忽略\n- **不要**传 `appType`；`api/v2/ads/**` → AD，其它 → ERP\n\n---\n\n## 错误码\n\n| errcode | 含义 | 建议 |\n|---------|------|------|\n| 200 | 成功 | — |\n| 1002 | 参数错误、`appType` 非 erp/ad、未登录 | 修正参数，不要重试相同请求 |\n| 1003 | 授权服务异常或网络失败 | 稍后重试；授权时重新获取 URL |\n| 1004 | 找不到目标应用的店铺授权 | 按能力发起 ERP 或 AD 授权 |\n| 1005 | Token 失效或转发路径未白名单 | Token 失效则重新授权；path 须以 `api/v2` 开头 |\n\n错误响应：\n```json\n{\"errcode\": 1004, \"errmsg\": \"未找到授权记录\"}\n```\n\n---\n\n## curl 示例\n\n```bash\nexport KEY=$LINKFOXAGENT_API_KEY\nBASE=https://tool-gateway.linkfox.com\n\n# 1. ERP 授权 URL\ncurl -X POST $BASE/shopee/authorizeUrl -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"shopName\":\"我的虾皮店铺\",\"region\":\"cn\",\"appType\":\"erp\"}'\n\n# 1b. 广告授权 URL\ncurl -X POST $BASE/shopee/authorizeUrl -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"shopName\":\"我的虾皮店铺\",\"region\":\"cn\",\"appType\":\"ad\"}'\n\n# 2. 列已授权（含 appType）\ncurl -X POST $BASE/shopee/authorizedStores -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" -d '{}'\n\n# 3. 查 AD 授权状态\ncurl -X POST $BASE/shopee/storeTokens -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"shopId\":\"67890\",\"appType\":\"ad\"}'\n```\n\n---\n\n## Feedback API\n\n与上面的工具 API **base URL 不同**：\n\n```bash\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"skillName\":\"linkfox-shopee-store-auth\",\"sentiment\":\"POSITIVE\",\n       \"category\":\"OTHER\",\"content\":\"授权流程顺畅\"}'\n```\n\n- `sentiment`: `POSITIVE` / `NEUTRAL` / `NEGATIVE`\n- `category`: `BUG` / `COMPLAINT` / `SUGGESTION` / `OTHER`\n\nFile v1.0.5:references/onboarding.md\n\n# 解决认证和积分问题\n\n调用本 skill 时若网关返回 **auth** 或 **billing** 错误，走本 skill 自带的 `scripts/onboarding.py` 完成引导。\n\n**auth 场景**：`errcode=401` 或消息含 `authorized error`/`鉴权失败`/`未授权`/`unauthorized`；或 `LINKFOX_AGENT_API_KEY` 与 `LINKFOXAGENT_API_KEY` 均为空。\n1. 若已配置 key → 先让用户重启会话（最常见误判），仍失败让用户重新取 key 或换手机号重注册\n2. 未配置 → 询问：自助去 https://agent.linkfox.com/ 取 key，或提供手机号让脚本注册\n3. 手机号路径：\n   - `python scripts/onboarding.py send-code <phone>` → 展示 JSON 里的 phone/agreements\n   - 收到验证码后：`python scripts/onboarding.py login <phone> <code>`（workbuddy 宿主加 `--channel workbuddy`）\n   - 拿到 `api_key` 后把下面三平台配置转发给用户，提示重启会话生效：\n     - Windows PowerShell（永久）：`setx LINKFOX_AGENT_API_KEY \"<key>\"`\n     - macOS zsh：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.zshrc && source ~/.zshrc`\n     - Linux bash：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.bashrc && source ~/.bashrc`\n     - 变量名 `LINKFOX_AGENT_API_KEY`（主推）或 `LINKFOXAGENT_API_KEY`（老规范）任一即可\n\n**billing 场景**：`errcode=402` 或消息含 `积分/余额/quota/insufficient/充值/套餐到期`。\n- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单，否则输出编号清单让用户选\n- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`（通常 `wechat/alipay`）\n- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG > `pay_url` > `ascii_qr`（标注兜底）\n- 已付款可选调 `python scripts/onboarding.py query <order_id>`，不主动轮询\n\n排除 `errcode=403`（无权限，不归入这两类）。所有子命令输出 stdout JSON，`error` 字段已含阶段前缀，透传给用户即可。完整用法：`python scripts/onboarding.py --help`。\n\nFile v1.0.5:skill-card.md\n\n## Description:\n\nSupports Shopee store authorization and management for separate ERP and Ads applications, including OAuth URL generation, authorized-store lookup, and authorization-status checks.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal sellers, operators, and developers use this skill to bind Shopee stores to LinkFox, distinguish ERP and Ads authorization records, and confirm which store identity and application type are ready for downstream Shopee workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill uses LinkFox account access and sends credential-bearing requests to configurable LinkFox endpoints.\n\nMitigation: Install only after reviewing the publisher, and run it in a clean environment with trusted LINKFOX_* URL variables.\n\nRisk: OAuth authorization URLs and API responses may be copied to the clipboard or retained in local linkfox output directories.\n\nMitigation: Avoid shared machines, avoid exposing terminal output, and inspect or delete generated linkfox cache files after use.\n\nRisk: The onboarding flow can request phone verification codes and create paid billing orders.\n\nMitigation: Provide phone codes or payment confirmation only when you explicitly intend to set up or purchase LinkFox service access.\n\nRisk: Automatic feedback reporting may send skill feedback to LinkFox.\n\nMitigation: Do not include secrets, authorization URLs, shop identifiers, or other sensitive business data in feedback content.\n\n## Reference(s):\n\n- [API Reference](references/api.md)\n- [Authentication and Billing Onboarding](references/onboarding.md)\n- [ClawHub Skill Page](https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-auth)\n- [Publisher Profile](https://clawhub.ai/user/linkfox-ai)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with JSON API responses and shell command examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Scripts persist full API responses under a local linkfox session directory and may print full or summarized JSON depending on response size.]\n\n## Skill Version(s):\n\n1.0.5 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.4: 11 files, 28311 bytes\n\nFiles: references/api.md (6365b), references/onboarding.md (2046b), scripts/_lf_output.py (6404b), scripts/_token_status_output.py (1106b), scripts/authorize_url.py (6828b), scripts/authorized_stores.py (2699b), scripts/onboarding.py (24089b), scripts/store_tokens.py (3238b), skill-card.md (2712b), SKILL.md (11611b), _meta.json (144b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: linkfox-shopee-store-auth\ndescription: Shopee（虾皮）店铺授权与管理技能，支持 ERP 与广告（AD）双应用分开授权。提供授权流程、已授权店铺查询以及授权状态读取。授权时可填写店铺名 shopName，region 支持 cn / global / br，appType 支持 erp / ad。当用户提到 Shopee 店铺授权、虾皮店铺绑定、ERP 授权、广告授权、appType、查询已授权 Shopee 店铺、Shopee seller authorization, bind Shopee shop, Shopee Ads authorization 时触发。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、ERP/广告应用授权或店铺列表查询，也应触发。\n---\n\n# Shopee 店铺授权与管理\n\nShopee Open Platform 的 OAuth 授权、已授权店铺列表、授权状态读取。**下游业务的前置依赖**（经 `/shopee/developerProxy` 调用开放接口）。\n\nShopee **ERP** 与 **广告（AD）** 使用不同应用与 Token，必须按能力分开授权。\n\n## Core Concepts\n\n- **双应用**：`appType=erp`（商品/订单/物流等，默认）与 `appType=ad`（站内广告）彼此独立；同店可同时有两条授权\n- **授权流程**：生成 URL → 用户浏览器授权 → Shopee 推送 Token → 系统按 `state` 落库\n- **店铺标识**：`shopId` 与 `merchantId` 二选一即可定位；判断是否已授权须同时匹配 **`shopId/merchantId + appType`**\n- **shopName 建议填写**：调 `authorize_url.py` 前建议问用户要一个便于识别的店铺名（API 非必填）\n- **授权 URL 1 小时有效**：每次授权重新调用 `authorize_url.py`，不要缓存旧地址\n- **下游选店**：业务 skill 经 `developerProxy` 只传 **`shopId`/`merchantId` + path**；**勿**传 `accessToken`，也**勿**在 proxy 里传 `appType`（服务端按 path 自动路由：`api/v2/ads/**` → AD，其它 `api/v2/**` → ERP）\n- **accessToken 约 4 小时有效**（`expireIn` 通常 14400）；过期需按对应 `appType` 重新授权\n\n## Shopee authorization routing\n\n- Use `appType=erp` for product, order, logistics, and other ERP authorization.\n- Use `appType=ad` for Shopee Ads authorization.\n- Treat a missing or blank `appType` as `erp`.\n- Check authorization by both store identity and `appType`; one store may have separate ERP and AD records.\n- If the user needs both capabilities, obtain two fresh authorization URLs and explain that both authorizations must be completed.\n- Authorization URLs expire after one hour, so obtain a new URL for every authorization attempt.\n\nWhen calling `developerProxy`, pass the Shopee API path plus `shopId` or `merchantId`. Do not pass `appType` or an access token. The service routes `api/v2/ads/**` through the AD application and all other `api/v2/**` paths through the ERP application.\n\n## 可用脚本\n\n| 脚本 | 作用 |\n|------|------|\n| `authorize_url.py` | 生成授权 URL（可选 `shopName` / `region` / **`appType`**） |\n| `authorized_stores.py` | 列出已授权店铺（含 **`appType`**；同店可能两条） |\n| `store_tokens.py` | 查指定应用的授权/令牌**状态**（非下游 token 来源；须带 `appType` 区分） |\n\n入参、响应字段、错误码见 `references/api.md`。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/{authorizeUrl|storeTokens|authorizedStores}`（完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 解决认证和积分问题\n发生以下异常情况时，采用 references/onboarding.md 引导解决问题：\n\n### 异常情况\n- **未配置API Key**：环境变量未配置 `LINKFOX_AGENT_API_KEY`，也未配置 `LINKFOXAGENT_API_KEY`。\n- **响应401或402状态码**\n- **响应提示积分或余额不足**：消息含\"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值\"，或类似含义的内容。\n\n## 支持区域\n\n`cn`（中国跨境，默认） / `global`（全球授权页） / `br`（巴西）。默认 `cn`。\n\n## Usage Scenarios\n\n### 1. 新授权店铺（ERP，默认）\n\n1. 建议问用户要 `shopName`（便于后续识别；API 非必填）\n2. 确认 `region`（默认 `cn`；全球站 `global`，巴西 `br`）\n3. 调 `authorize_url.py`，传 **`appType=erp`**（或不传，服务端默认 erp）→ 给用户在浏览器打开（安全警告：为保障店铺安全，请务必在日常运营该店铺的安全网络环境中打开此链接。强烈建议使用紫鸟浏览器等专业的防关联浏览器进行授权，切勿在陌生或公共网络下操作。）\n4. 授权完成后系统自动存 token；浏览器跳转成功/失败页\n5. 调 `authorized_stores.py`，确认存在 **`appType=erp`**（或空，历史记录视为 erp）的记录\n\n### 2. 广告应用授权（AD）\n\n1. 调 `authorized_stores.py`，检查目标店是否已有 **`appType=ad`**\n2. 未授权时调 `authorize_url.py`，传 **`appType=ad`**，并明确告知用户这是**广告应用**授权（与 ERP 无关）\n3. 授权完成后再次检查 `appType=ad`\n4. **禁止**用 ERP 授权代替广告授权\n\n### 3. 同时需要 ERP 与广告\n\n1. 分别检查 `appType=erp` 与 `appType=ad`\n2. 仅为缺失的应用生成授权地址；两项都缺则生成**两个** URL，并标注用途\n3. 提示用户需分别打开并完成两次授权；一次授权不会覆盖另一项能力\n\n### 4. 列已授权店铺\n\n调 `authorized_stores.py`，展示 `shopName / shopId / merchantId / region / **appType**`。同店可能出现 ERP、AD 两条。\n\n### 5. 给下游准备店铺选店信息（高频）\n\n用户只说自然语言（\"我的虾皮店\"、\"67890 那家店\"），**不要让用户报冗长 token**。\n\n| 用户上下文 | Agent 动作 |\n|---|---|\n| 只授权 1 家店铺（且目标能力已授权） | 直接取该店铺 `shopId`（或 `merchantId`），不问 |\n| 授权 ≥ 2 家 + 只说店名 | 按 `shopName` 向用户澄清 |\n| 同时给出 shopName 或 shopId | 直接定位 |\n| 显式给出 shopId / merchantId | 直接用 |\n| 店铺在列表中存在但缺少目标 `appType` | 按能力发起对应授权，**不要**调用业务接口 |\n\n**静默原则**：定位成功时只确认店铺标识与应用类型，不向用户索要 token。\n\n**推荐流程**：`authorized_stores.py` 按 **`shopId + appType`** 确认已授权 → 下游 skill 直接 `POST /shopee/developerProxy` 传入 `shopId`（或 `merchantId`），由服务端按 path 解析对应应用 token。\n\n`store_tokens.py` **仅用于**确认授权/令牌状态（须传 `appType`），**不要**为 proxy 调用先取 `accessToken`。\n\n## 调用原则\n\n- 授权前建议确认 `shopName`、`region`、**`appType`**\n- 不假设 `storeTokens` 响应含 raw `accessToken`；展示状态与过期元数据即可\n- 授权失败按错误码解释原因；不擅自重试\n- 令牌过期须按对应 `appType` 重新走授权流程\n- 历史空 `app_type` 视为 ERP，不是 AD\n\n## 常见问题\n\n### 授权完成但查不到店铺\n\n原因：Token 推送回调（`/shopee/oauth/tokenCallback`）未成功落库，或 `state` 不匹配。\n解决：查看服务日志；重新调 `authorize_url.py`（勿复用过期 URL）完成授权。\n\n### 查令牌 / 业务调用返回 1004\n\n原因：`shopId` / `merchantId` 错误，或**目标应用**未授权（例如只有 ERP、没有 AD）。\n解决：先调 `authorized_stores.py` 核对 `shopId + appType`；缺则按能力重新授权。\n\n### 店铺已授权但广告 API 失败\n\n原因：有 ERP 记录 ≠ 有 AD 记录；广告不能使用 ERP Token。\n解决：发起 `appType=ad` 授权后再调 `linkfox-shopee-store-ads`。\n\n## Not Applicable\n\n- **Shopee 订单查询与处理** → `linkfox-shopee-store-orders`\n- **Shopee 店铺信息与设置** → `linkfox-shopee-store-shop`\n- **Shopee 店铺商品 listing** → `linkfox-shopee-store-product`\n- **Shopee 跨境全球商品 GlobalProduct** → `linkfox-shopee-store-global-product`\n- **Shopee 跨境商户信息 Merchant** → `linkfox-shopee-store-merchant`\n- **Shopee 物流发货 Logistics** → `linkfox-shopee-store-logistics`\n- **Shopee 退货退款 Returns** → `linkfox-shopee-store-returns`\n- **Shopee 站内广告 Ads** → `linkfox-shopee-store-ads`（业务调用；授权仍用本 skill 的 `appType=ad`）\n- **Shopee 支付结算 Payment** → `linkfox-shopee-store-payment`\n- **Shopee 联盟营销 AMS** → `linkfox-shopee-store-ams`\n- **Shopee 店铺视频 Video** → `linkfox-shopee-store-video`\n- **Shopee 媒体上传 MediaSpace** → `linkfox-shopee-store-media-space`\n- **Shopee 媒体上传 Media** → `linkfox-shopee-store-media`（`api/v2/media/...`，module=130）\n- **Shopee 头程物流 FirstMile** → `linkfox-shopee-store-first-mile`\n- **Shopee 折扣促销 Discount** → `linkfox-shopee-store-discount`\n- **Shopee 套装优惠 Bundle Deal** → `linkfox-shopee-store-bundle-deal`\n- **Shopee 加购优惠 Add-On Deal** → `linkfox-shopee-store-add-on-deal`\n- **Shopee 店铺优惠券 Voucher** → `linkfox-shopee-store-voucher`\n- **Shopee 店铺秒杀 Shop Flash Sale** → `linkfox-shopee-store-shop-flash-sale`\n- **Shopee 关注有礼 Follow Prize** → `linkfox-shopee-store-follow-prize`\n- **Shopee 精选商品 Top Picks** → `linkfox-shopee-store-top-picks`\n- **Shopee 店铺分类 Shop Category** → `linkfox-shopee-store-shop-category`\n- **Shopee 账户健康 Account Health** → `linkfox-shopee-store-account-health`\n- **Shopee Public 公共模块** → `linkfox-shopee-store-public`（`v2.public.*` 底层 OAuth / Partner 查询）\n- **Shopee Push 推送机制** → `linkfox-shopee-store-push`\n- **Shopee SBS 仓储服务** → `linkfox-shopee-store-sbs`\n- **Shopee FBS 巴西仓储** → `linkfox-shopee-store-fbs`\n- **Shopee 直播 Livestream** → `linkfox-shopee-store-livestream`\n- Shopee 选品（友鹰） → `linkfox-youying-shopee-product-search`\n- 商品 listing 管理 → 专用 product skill 或 `developerProxy` 商品 API\n\n## 积分消耗规则\n\n不消耗积分。\n\n**Feedback:**\n\nAuto-detect and report feedback via the Feedback API when any of the following apply:\n1. The functionality or purpose described in this skill does not match actual behavior\n2. The skill's results do not match the user's intent\n3. The user expresses dissatisfaction or praise about this skill\n4. Anything you believe could be improved\n\nCall the feedback API as specified in `references/api.md`. Do not interrupt the user's flow.\n\n---\n*For more high-quality, professional cross-border e-commerce skills, visit [LinkFox Skills](https://skill.linkfox.com/).*\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-shopee-store-auth\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1786100367427\n}\n\nFile v1.0.4:references/api.md\n\n# linkfox-shopee-store-auth — 参数与字段参考\n\nShopee 授权、已授权店铺列表、授权状态读取。支持 **ERP / AD** 双应用。\n\n业务 API 转发见 `/shopee/developerProxy`（path 须以 `api/v2` 开头；**勿**传 `accessToken` / `appType`）。\n\n## 通用约定\n\n- **Base URL**：`${LINKFOX_TOOL_GATEWAY}`\n- **Method**：POST，`Content-Type: application/json`\n- **Auth**：Header `Authorization: <api_key>`（读环境变量 `LINKFOX_AGENT_API_KEY` 或 `LINKFOXAGENT_API_KEY`；如未配置 按 SKILL.md 的 **## 解决认证和积分问题** 处理）\n\n## 关键 ID 与应用类型\n\n```\n  一次 OAuth 授权（指定 appType）\n        ▼\n  authRecordId (1 条)  ← 与该应用的 access/refresh token 绑定\n        │\n        ├──► shopId      ─┐\n        ├──► merchantId  ─┘  查询时二选一即可\n        └──► appType: erp | ad\n```\n\n- `authRecordId`：授权记录 ID；同一店铺可因 `appType` 不同有多条\n- `shopId`：店铺 ID，转发 Shopee API 时写为 `shop_id`\n- `merchantId`：商户 ID，与 `shopId` 二选一；转发时写为 `merchant_id`\n- `appType`：`erp`（默认）或 `ad`；空/`null` 在展示与 ERP 查找时视为 `erp`\n- `shopIdList` / `merchantIdList`：JSON 字符串，含本次授权绑定的全部 ID\n\n判断是否已授权须同时匹配：**店铺标识 + appType**。\n\n## 接口\n\n### 1. 生成授权 URL — `/shopee/authorizeUrl`\n\n服务端自动组装 `state`、`callbackUrl`、`redirectUrl`。授权地址约 **1 小时**有效，每次重新获取。\n\n**Request**：\n| 参数 | 类型 | 必填 | 默认 | 说明 |\n|------|------|------|------|------|\n| `shopName` | string | 否 | - | 店铺展示名，便于在列表识别 |\n| `region` | string | 否 | `cn` | `cn` / `global` / `br` |\n| `appType` | string | 否 | `erp` | 只允许 `erp` 或 `ad` |\n\n**Response**：\n```json\n{\"sourceType\": \"shopee\", \"authorizeUrl\": \"https://open.shopee.cn/auth?...&state=abc123\"}\n```\n\n授权完成后 Token 由 Shopee POST 到 `/shopee/oauth/tokenCallback`（系统内部）；浏览器跳转 `/shopee/oauth/redirect`，不作为公开接口。\n\nERP 示例：\n```json\n{\"shopName\": \"Example Shop\", \"region\": \"cn\", \"appType\": \"erp\"}\n```\n\n广告示例：\n```json\n{\"shopName\": \"Example Shop\", \"region\": \"cn\", \"appType\": \"ad\"}\n```\n\n---\n\n### 2. 列已授权店铺 — `/shopee/authorizedStores`\n\n**Request**：无（用当前用户上下文）\n\n**Response**：\n```json\n{\n  \"total\": 2,\n  \"stores\": [\n    {\n      \"authRecordId\": 1,\n      \"shopId\": \"67890\",\n      \"merchantId\": \"12345\",\n      \"shopIdList\": \"[67890]\",\n      \"merchantIdList\": \"[12345]\",\n      \"shopName\": \"Test Shopee Shop\",\n      \"region\": \"cn\",\n      \"appType\": \"erp\"\n    },\n    {\n      \"authRecordId\": 2,\n      \"shopId\": \"67890\",\n      \"merchantId\": \"12345\",\n      \"shopName\": \"Test Shopee Shop\",\n      \"region\": \"cn\",\n      \"appType\": \"ad\"\n    }\n  ]\n}\n```\n\n同一个店铺可能返回 ERP、AD 两条。缺 `appType` 的历史记录按 **erp** 理解。\n\n---\n\n### 3. 查询授权状态 — `/shopee/storeTokens`\n\n只返回授权状态/元数据，**不返回**原始 access token 或 refresh token（脚本侧也会剥离）。\n\n**Request**（`shopId` 与 `merchantId` 二选一）：\n| 参数 | 类型 | 必填 | 默认 | 说明 |\n|------|------|------|------|------|\n| `shopId` | string | 与 merchantId 二选一 | - | 店铺 ID |\n| `merchantId` | string | 与 shopId 二选一 | - | 商户 ID |\n| `appType` | string | 否 | `erp` | `erp` 或 `ad` |\n\n**Response（状态示例）**：\n```json\n{\n  \"authRecordId\": 1,\n  \"shopId\": \"67890\",\n  \"merchantId\": \"12345\",\n  \"appType\": \"ad\",\n  \"tokenType\": \"Bearer\",\n  \"expireIn\": 14400,\n  \"status\": \"ok\"\n}\n```\n\n本接口**不触发刷新**，仅读 DB。`expireIn` 为 access_token 剩余有效秒数（通常 14400）。\n\n**不要**用本接口取 token 再传给 `/shopee/developerProxy`；proxy 由服务端按 path 注入对应应用 Token。\n\n---\n\n### 4. 业务转发（下游，非本 skill 脚本）— `/shopee/developerProxy`\n\n```json\n{\n  \"path\": \"api/v2/product/get_item_list\",\n  \"method\": \"GET\",\n  \"shopId\": \"67890\",\n  \"queryString\": \"offset=0&page_size=20&item_status=NORMAL\"\n}\n```\n\n广告路径示例（自动走 AD Token）：\n```json\n{\n  \"path\": \"api/v2/ads/get_total_balance\",\n  \"method\": \"GET\",\n  \"shopId\": \"67890\"\n}\n```\n\n- `path` 必须以 `api/v2` 开头\n- `shopId` 与 `merchantId` 至少传一个\n- `accessToken` 已废弃，传入也会被忽略\n- **不要**传 `appType`；`api/v2/ads/**` → AD，其它 → ERP\n\n---\n\n## 错误码\n\n| errcode | 含义 | 建议 |\n|---------|------|------|\n| 200 | 成功 | — |\n| 1002 | 参数错误、`appType` 非 erp/ad、未登录 | 修正参数，不要重试相同请求 |\n| 1003 | 授权服务异常或网络失败 | 稍后重试；授权时重新获取 URL |\n| 1004 | 找不到目标应用的店铺授权 | 按能力发起 ERP 或 AD 授权 |\n| 1005 | Token 失效或转发路径未白名单 | Token 失效则重新授权；path 须以 `api/v2` 开头 |\n\n错误响应：\n```json\n{\"errcode\": 1004, \"errmsg\": \"未找到授权记录\"}\n```\n\n---\n\n## curl 示例\n\n```bash\nexport KEY=$LINKFOXAGENT_API_KEY\nBASE=https://tool-gateway.linkfox.com\n\n# 1. ERP 授权 URL\ncurl -X POST $BASE/shopee/authorizeUrl -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"shopName\":\"我的虾皮店铺\",\"region\":\"cn\",\"appType\":\"erp\"}'\n\n# 1b. 广告授权 URL\ncurl -X POST $BASE/shopee/authorizeUrl -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"shopName\":\"我的虾皮店铺\",\"region\":\"cn\",\"appType\":\"ad\"}'\n\n# 2. 列已授权（含 appType）\ncurl -X POST $BASE/shopee/authorizedStores -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" -d '{}'\n\n# 3. 查 AD 授权状态\ncurl -X POST $BASE/shopee/storeTokens -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"shopId\":\"67890\",\"appType\":\"ad\"}'\n```\n\n---\n\n## Feedback API\n\n与上面的工具 API **base URL 不同**：\n\n```bash\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"skillName\":\"linkfox-shopee-store-auth\",\"sentiment\":\"POSITIVE\",\n       \"category\":\"OTHER\",\"content\":\"授权流程顺畅\"}'\n```\n\n- `sentiment`: `POSITIVE` / `NEUTRAL` / `NEGATIVE`\n- `category`: `BUG` / `COMPLAINT` / `SUGGESTION` / `OTHER`\n\nFile v1.0.4:references/onboarding.md\n\n# 解决认证和积分问题\n\n调用本 skill 时若网关返回 **auth** 或 **billing** 错误，走本 skill 自带的 `scripts/onboarding.py` 完成引导。\n\n**auth 场景**：`errcode=401` 或消息含 `authorized error`/`鉴权失败`/`未授权`/`unauthorized`；或 `LINKFOX_AGENT_API_KEY` 与 `LINKFOXAGENT_API_KEY` 均为空。\n1. 若已配置 key → 先让用户重启会话（最常见误判），仍失败让用户重新取 key 或换手机号重注册\n2. 未配置 → 询问：自助去 https://agent.linkfox.com/ 取 key，或提供手机号让脚本注册\n3. 手机号路径：\n   - `python scripts/onboarding.py send-code <phone>` → 展示 JSON 里的 phone/agreements\n   - 收到验证码后：`python scripts/onboarding.py login <phone> <code>`（workbuddy 宿主加 `--channel workbuddy`）\n   - 拿到 `api_key` 后把下面三平台配置转发给用户，提示重启会话生效：\n     - Windows PowerShell（永久）：`setx LINKFOX_AGENT_API_KEY \"<key>\"`\n     - macOS zsh：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.zshrc && source ~/.zshrc`\n     - Linux bash：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.bashrc && source ~/.bashrc`\n     - 变量名 `LINKFOX_AGENT_API_KEY`（主推）或 `LINKFOXAGENT_API_KEY`（老规范）任一即可\n\n**billing 场景**：`errcode=402` 或消息含 `积分/余额/quota/insufficient/充值/套餐到期`。\n- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单，否则输出编号清单让用户选\n- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`（通常 `wechat/alipay`）\n- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG > `pay_url` > `ascii_qr`（标注兜底）\n- 已付款可选调 `python scripts/onboarding.py query <order_id>`，不主动轮询\n\n排除 `errcode=403`（无权限，不归入这两类）。所有子命令输出 stdout JSON，`error` 字段已含阶段前缀，透传给用户即可。完整用法：`python scripts/onboarding.py --help`。\n\nFile v1.0.4:skill-card.md\n\n## Description:\n\nHelps agents generate Shopee ERP or Ads OAuth authorization URLs, list authorized stores, and check authorization status through LinkFox.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal sellers, e-commerce operators, and agents use this skill to prepare Shopee ERP or Ads authorization, inspect authorized stores, and provide store identifiers for downstream Shopee workflows without exposing raw access tokens.\n\n### Deployment Geography for Use:\n\nGlobal, with documented Shopee authorization regions cn, global, and br.\n\n## Known Risks and Mitigations:\n\nRisk: The skill requires LinkFox API-key access and can guide account onboarding and paid billing recovery.\n\nMitigation: Install and run it only in trusted workspaces, keep API keys private, and review any onboarding or payment action before proceeding.\n\nRisk: Generated Shopee authorization URLs and saved response JSON files can expose sensitive account or store context.\n\nMitigation: Treat authorization URLs and saved LinkFox outputs as sensitive, avoid sharing them, and review or delete local linkfox/cache outputs after use.\n\nRisk: Endpoint environment variables can redirect requests away from official LinkFox hosts.\n\nMitigation: Keep LinkFox endpoint environment variables pinned to official hosts unless intentionally testing in a controlled environment.\n\nRisk: Shopee ERP and Ads authorizations are separate, so using the wrong app type can cause failed or incorrect downstream workflows.\n\nMitigation: Confirm appType and match shopId or merchantId with the intended ERP or Ads authorization before downstream calls.\n\n## Reference(s):\n\n- [API parameter and field reference](artifact/references/api.md)\n- [Authentication and billing onboarding guide](artifact/references/onboarding.md)\n- [ClawHub skill page](https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-auth)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, shell commands, JSON, files, configuration]\n\n**Output Format:** [Markdown guidance with JSON API responses and shell command snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Scripts save full API responses under a LinkFox session data directory; large responses are summarized unless inline output is requested.]\n\n## Skill Version(s):\n\n1.0.4 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.3: 8 files, 16090 bytes\n\nFiles: references/api.md (4238b), scripts/_lf_output.py (6404b), scripts/authorize_url.py (5696b), scripts/authorized_stores.py (2290b), scripts/store_tokens.py (3128b), skill-card.md (2526b), SKILL.md (9137b), _meta.json (144b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: linkfox-shopee-store-auth\ndescription: Shopee（虾皮）店铺授权与管理技能，提供完整的授权流程、已授权店铺查询以及访问令牌读取能力。授权时可填写店铺名 shopName 便于识别，region 支持 cn / global / br。当用户提到 Shopee 店铺授权、虾皮店铺绑定、授权虾皮店铺、查询已授权 Shopee 店铺、获取 Shopee 店铺令牌、Shopee seller authorization, bind Shopee shop, authorized Shopee stores, query Shopee store tokens 时触发此技能。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、访问令牌管理或店铺列表查询，也应触发。\n---\n\n# Shopee 店铺授权与管理\n\nShopee Open Platform 的 OAuth 授权、已授权店铺列表、访问令牌读取。**下游业务的前置依赖**（经 `/shopee/developerProxy` 调用开放接口）。\n\n## Core Concepts\n\n- **授权流程**：生成 URL → 用户浏览器授权 → Shopee 推送 Token → 系统按 `state` 落库\n- **店铺标识**：`shopId` 与 `merchantId` 二选一即可定位授权；一次授权可含多个 shop（见 `shopIdList`）\n- **shopName 建议填写**：调 `authorize_url.py` 前建议问用户要一个便于识别的店铺名（API 非必填）\n- **accessToken 约 4 小时有效**（`expireIn` 通常 14400）；当前网关无独立刷新接口，过期需重新授权\n\n## 可用脚本\n\n| 脚本 | 作用 |\n|------|------|\n| `authorize_url.py` | 生成授权 URL（可选 `shopName` / `region`） |\n| `authorized_stores.py` | 列出已授权店铺 |\n| `store_tokens.py` | 查 token（供下游使用） |\n\n入参、响应字段、错误码见 `references/api.md`。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/{authorizeUrl|storeTokens|authorizedStores}`（完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 解决认证和积分问题\n发生以下异常情况时，采用以下措施来处理：\n\n### 异常情况\n- **未配置API Key**：环境变量未配置 `LINKFOX_AGENT_API_KEY`，也未配置 `LINKFOXAGENT_API_KEY`。\n- **响应401或402状态码**\n- **响应提示积分或余额不足**：消息含\"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值\"，或类似含义的内容。\n\n### 措施\n- 优先采用skill内的 onboarding.md 引导解决问题。\n- 如找不到 onboarding.md 文件，则加载 /linkfox-onboarding 这个skill并根据它的引导来处理。如未安装请先安装：\n    - 下载 https://agent-files.linkfox.com/skills/linkfox-onboarding/release.zip，解压后安装这个skill。如需用户授权才可下载，要询问用户获得授权，你不能自己放弃下载。\n- 兜底措施：仅当前面两个措施经过所有努力都走不通时，才提示用户依据 https://skill.linkfox.com/linkfoxskills/guide.htm 指引获取API Key，或去 https://os.linkfox.com/ 补充积分。\n\n## 支持区域\n\n`cn`（中国跨境，默认） / `global`（全球授权页） / `br`（巴西）。默认 `cn`。\n\n## Usage Scenarios\n\n### 1. 新授权店铺\n1. 建议问用户要 `shopName`（便于后续识别；API 非必填）\n2. 确认 `region`（默认 `cn`；全球站 `global`，巴西 `br`）\n3. 调 `authorize_url.py` 拿 URL → 给用户在浏览器打开（安全警告：为保障店铺安全，请务必在日常运营该店铺的安全网络环境中打开此链接。强烈建议使用紫鸟浏览器等专业的防关联浏览器进行授权，切勿在陌生或公共网络下操作。）\n4. 授权完成后系统自动存 token；浏览器跳转成功/失败页\n5. 可选：调 `authorized_stores.py` 确认\n\n### 2. 列已授权店铺\n调 `authorized_stores.py`，展示 `shopName / shopId / merchantId / region`。\n\n### 3. 给下游准备 accessToken（高频）\n\n用户只说自然语言（\"我的虾皮店\"、\"67890 那家店\"），**不要让用户报冗长 token**。\n\n| 用户上下文 | Agent 动作 |\n|---|---|\n| 只授权 1 家店铺 | 直接取该店铺 `shopId`，不问 |\n| 授权 ≥ 2 家 + 只说店名 | 按 `shopName` 向用户澄清 |\n| 同时给出 shopName 或 shopId | 直接定位 |\n| 显式给出 shopId / merchantId | 直接用 |\n\n**静默原则**：定位成功时不播报完整 accessToken；脚本已做掩码，不要在摘要里还原。\n\n流程：先 `authorized_stores.py` 选店 → 再 `store_tokens.py`（传 `shopId` 或 `merchantId`）→ 将 `accessToken` 交给 `/shopee/developerProxy`。\n\n## 调用原则\n\n- 授权前建议确认 `shopName` 与 `region`\n- 不输出完整 accessToken / refreshToken；脚本已做掩码，不要在摘要里还原\n- 授权失败按错误码解释原因；不擅自重试\n- 令牌过期须重新走授权流程（无 `refreshToken` 公开接口）\n\n## 常见问题\n\n### 授权完成但查不到店铺\n\n原因：Token 推送回调（`/shopee/oauth/tokenCallback`）未成功落库，或 `state` 不匹配。\n解决：查看服务日志；重新调 `authorize_url.py` 完成授权。\n\n### 查令牌返回 1004\n\n原因：`shopId` / `merchantId` 错误，或授权不属于当前用户。\n解决：先调 `authorized_stores.py` 核对店铺信息。\n\n## Not Applicable\n\n- **Shopee 订单查询与处理** → `linkfox-shopee-store-orders`\n- **Shopee 店铺信息与设置** → `linkfox-shopee-store-shop`\n- **Shopee 店铺商品 listing** → `linkfox-shopee-store-product`\n- **Shopee 跨境全球商品 GlobalProduct** → `linkfox-shopee-store-global-product`\n- **Shopee 跨境商户信息 Merchant** → `linkfox-shopee-store-merchant`\n- **Shopee 物流发货 Logistics** → `linkfox-shopee-store-logistics`\n- **Shopee 退货退款 Returns** → `linkfox-shopee-store-returns`\n- **Shopee 站内广告 Ads** → `linkfox-shopee-store-ads`\n- **Shopee 支付结算 Payment** → `linkfox-shopee-store-payment`\n- **Shopee 联盟营销 AMS** → `linkfox-shopee-store-ams`\n- **Shopee 店铺视频 Video** → `linkfox-shopee-store-video`\n- **Shopee 媒体上传 MediaSpace** → `linkfox-shopee-store-media-space`\n- **Shopee 媒体上传 Media** → `linkfox-shopee-store-media`（`api/v2/media/...`，module=130）\n- **Shopee 头程物流 FirstMile** → `linkfox-shopee-store-first-mile`\n- **Shopee 折扣促销 Discount** → `linkfox-shopee-store-discount`\n- **Shopee 套装优惠 Bundle Deal** → `linkfox-shopee-store-bundle-deal`\n- **Shopee 加购优惠 Add-On Deal** → `linkfox-shopee-store-add-on-deal`\n- **Shopee 店铺优惠券 Voucher** → `linkfox-shopee-store-voucher`\n- **Shopee 店铺秒杀 Shop Flash Sale** → `linkfox-shopee-store-shop-flash-sale`\n- **Shopee 关注有礼 Follow Prize** → `linkfox-shopee-store-follow-prize`\n- **Shopee 精选商品 Top Picks** → `linkfox-shopee-store-top-picks`\n- **Shopee 店铺分类 Shop Category** → `linkfox-shopee-store-shop-category`\n- **Shopee 账户健康 Account Health** → `linkfox-shopee-store-account-health`\n- **Shopee Public 公共模块** → `linkfox-shopee-store-public`（`v2.public.*` 底层 OAuth / Partner 查询）\n- **Shopee Push 推送机制** → `linkfox-shopee-store-push`\n- **Shopee SBS 仓储服务** → `linkfox-shopee-store-sbs`\n- **Shopee FBS 巴西仓储** → `linkfox-shopee-store-fbs`\n- **Shopee 直播 Livestream** → `linkfox-shopee-store-livestream`\n- Shopee 选品（友鹰） → `linkfox-youying-shopee-product-search`\n- 商品 listing 管理 → 专用 product skill 或 `developerProxy` 商品 API\n\n## 积分消耗规则\n\n不消耗积分。\n\n**Feedback:**\n\nAuto-detect and report feedback via the Feedback API when any of the following apply:\n1. The functionality or purpose described in this skill does not match actual behavior\n2. The skill's results do not match the user's intent\n3. The user expresses dissatisfaction or praise about this skill\n4. Anything you believe could be improved\n\nCall the feedback API as specified in `references/api.md`. Do not interrupt the user's flow.\n\n---\n*For more high-quality, professional cross-border e-commerce skills, visit [LinkFox Skills](https://skill.linkfox.com/).*\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-shopee-store-auth\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783945192342\n}\n\nFile v1.0.3:references/api.md\n\n# linkfox-shopee-store-auth — 参数与字段参考\n\nShopee 授权、已授权店铺列表、令牌读取。\n\n业务 API 转发见 `/shopee/developerProxy`（path 须以 `api/v2` 开头）。\n\n## 通用约定\n\n- **Base URL**：`${LINKFOX_TOOL_GATEWAY}`\n- **Method**：POST，`Content-Type: application/json`\n- **Auth**：Header `Authorization: <api_key>`（读环境变量 `LINKFOX_AGENT_API_KEY` 或 `LINKFOXAGENT_API_KEY`；如未配置 按 SKILL.md 的 **## 解决认证和积分问题** 处理）\n\n## 关键 ID 关系\n\n```\n  一次 OAuth 授权\n        ▼\n  authRecordId (1 条)  ← 与 accessToken/refreshToken 绑定\n        │\n        ├──► shopId      ─┐\n        └──► merchantId  ─┘  查询令牌时二选一即可\n```\n\n- `authRecordId`：授权记录 ID，一次 OAuth 对应一个\n- `shopId`：店铺 ID，转发 Shopee API 时写为 `shop_id`\n- `merchantId`：商户 ID，与 `shopId` 二选一；转发时写为 `merchant_id`\n- `shopIdList` / `merchantIdList`：JSON 字符串，含本次授权绑定的全部 ID\n\n## 接口\n\n### 1. 生成授权 URL — `/shopee/authorizeUrl`\n\n服务端自动组装 `state`、`callbackUrl`、`redirectUrl`。\n\n**Request**：\n| 参数 | 类型 | 必填 | 默认 | 说明 |\n|------|------|------|------|------|\n| `shopName` | string | 否 | - | 店铺展示名，便于在列表识别 |\n| `region` | string | 否 | `cn` | `cn` / `global` / `br` |\n\n**Response**：\n```json\n{\"sourceType\": \"shopee\", \"authorizeUrl\": \"https://open.shopee.cn/auth?...&state=abc123\"}\n```\n\n授权完成后 Token 由 Shopee POST 到 `/shopee/oauth/tokenCallback`（系统内部）；浏览器跳转 `/shopee/oauth/redirect`，不作为公开接口。\n\n---\n\n### 2. 列已授权店铺 — `/shopee/authorizedStores`\n\n**Request**：无（用当前用户上下文）\n\n**Response**：\n```json\n{\n  \"total\": 1,\n  \"stores\": [{\n    \"authRecordId\": 1,\n    \"shopId\": \"67890\",\n    \"merchantId\": \"12345\",\n    \"shopIdList\": \"[67890]\",\n    \"merchantIdList\": \"[12345]\",\n    \"shopName\": \"Test Shopee Shop\",\n    \"region\": \"cn\"\n  }]\n}\n```\n\n---\n\n### 3. 查询令牌 — `/shopee/storeTokens`\n\n**Request**（`shopId` 与 `merchantId` 二选一）：\n| 参数 | 类型 | 说明 |\n|------|------|------|\n| `shopId` | string | 店铺 ID |\n| `merchantId` | string | 商户 ID |\n\n**Response**：\n```json\n{\n  \"authRecordId\": 1,\n  \"shopId\": \"67890\",\n  \"merchantId\": \"12345\",\n  \"shopIdList\": \"[67890]\",\n  \"merchantIdList\": \"[12345]\",\n  \"tokenType\": \"Bearer\",\n  \"accessToken\": \"xxx\",\n  \"expireIn\": 14400,\n  \"refreshToken\": \"xxx\"\n}\n```\n\n本接口**不触发刷新**，仅读 DB。`expireIn` 为 access_token 剩余有效秒数（通常 14400）。\n\n返回的 `accessToken` 可交给 `/shopee/developerProxy` 调用 Shopee 开放接口。\n\n---\n\n## 错误码\n\n| errcode | 含义 | 建议 |\n|---------|------|------|\n| 200 | 成功 | — |\n| 1002 | 参数错误或未登录 | 检查必填参数与 API Key |\n| 1003 | 授权服务异常或网络失败 | 稍后重试 |\n| 1004 | 授权记录不存在或不属于当前用户 | 核对 shopId / merchantId |\n| 1005 | 转发路径未在白名单内（developerProxy） | path 须以 `api/v2` 开头 |\n\n错误响应：\n```json\n{\"errcode\": 1004, \"errmsg\": \"未找到授权记录\"}\n```\n\n---\n\n## curl 示例\n\n```bash\nexport KEY=$LINKFOXAGENT_API_KEY\nBASE=https://tool-gateway.linkfox.com\n\n# 1. 生成授权 URL\ncurl -X POST $BASE/shopee/authorizeUrl -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"shopName\":\"我的虾皮店铺\",\"region\":\"cn\"}'\n\n# 2. 列已授权\ncurl -X POST $BASE/shopee/authorizedStores -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" -d '{}'\n\n# 3. 查令牌\ncurl -X POST $BASE/shopee/storeTokens -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" -d '{\"shopId\":\"67890\"}'\n```\n\n---\n\n## Feedback API\n\n与上面的工具 API **base URL 不同**：\n\n```bash\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"skillName\":\"linkfox-shopee-store-auth\",\"sentiment\":\"POSITIVE\",\n       \"category\":\"OTHER\",\"content\":\"授权流程顺畅\"}'\n```\n\n- `sentiment`: `POSITIVE` / `NEUTRAL` / `NEGATIVE`\n- `category`: `BUG` / `COMPLAINT` / `SUGGESTION` / `OTHER`\n\nFile v1.0.3:skill-card.md\n\n## Description: <br>\nShopee store authorization and management skill for generating OAuth authorization URLs, listing authorized stores, and reading masked store token data for downstream Shopee API use. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal sellers, operators, and agent developers use this skill to bind Shopee shops, inspect authorized shop identifiers, and obtain masked token data needed for downstream Shopee Open Platform calls. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill handles Shopee authorization data and LinkFox API credentials through credentialed network calls. <br>\nMitigation: Install only if the publisher is trusted, keep LINKFOX_TOOL_GATEWAY and SHOPEE_API_BASE_URL pinned to the intended LinkFox host, and review behavior before use with real credentials. <br>\nRisk: Authorization URLs and API responses may be written to local files or copied to the clipboard. <br>\nMitigation: Use on a trusted workstation, protect the generated linkfox data directory, avoid shared clipboards, and clear local artifacts when they are no longer needed. <br>\nRisk: The onboarding guidance includes a remote package installation path. <br>\nMitigation: Avoid the remote onboarding install path unless the package and source can be verified. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-auth) <br>\n- [linkfox-ai Publisher Profile](https://clawhub.ai/user/linkfox-ai) <br>\n- [API Reference](references/api.md) <br>\n- [LinkFox Skills](https://skill.linkfox.com/) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [JSON, Shell commands, Guidance] <br>\n**Output Format:** [Markdown guidance with JSON API responses and shell command examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Writes full responses to local JSON files; large responses are summarized; store token output masks accessToken and refreshToken values.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: server-resolved release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.2: 8 files, 15198 bytes\n\nFiles: references/api.md (4251b), scripts/_lf_output.py (6404b), scripts/authorize_url.py (5651b), scripts/authorized_stores.py (2245b), scripts/store_tokens.py (3083b), skill-card.md (2375b), SKILL.md (8003b), _meta.json (144b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: linkfox-shopee-store-auth\ndescription: Shopee（虾皮）店铺授权与管理技能，提供完整的授权流程、已授权店铺查询以及访问令牌读取能力。授权时可填写店铺名 shopName 便于识别，region 支持 cn / global / br。当用户提到 Shopee 店铺授权、虾皮店铺绑定、授权虾皮店铺、查询已授权 Shopee 店铺、获取 Shopee 店铺令牌、Shopee seller authorization, bind Shopee shop, authorized Shopee stores, query Shopee store tokens 时触发此技能。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、访问令牌管理或店铺列表查询，也应触发。\n---\n\n# Shopee 店铺授权与管理\n\nShopee Open Platform 的 OAuth 授权、已授权店铺列表、访问令牌读取。**下游业务的前置依赖**（经 `/shopee/developerProxy` 调用开放接口）。\n\n## Core Concepts\n\n- **授权流程**：生成 URL → 用户浏览器授权 → Shopee 推送 Token → 系统按 `state` 落库\n- **店铺标识**：`shopId` 与 `merchantId` 二选一即可定位授权；一次授权可含多个 shop（见 `shopIdList`）\n- **shopName 建议填写**：调 `authorize_url.py` 前建议问用户要一个便于识别的店铺名（API 非必填）\n- **accessToken 约 4 小时有效**（`expireIn` 通常 14400）；当前网关无独立刷新接口，过期需重新授权\n\n## 可用脚本\n\n| 脚本 | 作用 |\n|------|------|\n| `authorize_url.py` | 生成授权 URL（可选 `shopName` / `region`） |\n| `authorized_stores.py` | 列出已授权店铺 |\n| `store_tokens.py` | 查 token（供下游使用） |\n\n入参、响应字段、错误码见 `references/api.md`。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/{authorizeUrl|storeTokens|authorizedStores}`（完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 支持区域\n\n`cn`（中国跨境，默认） / `global`（全球授权页） / `br`（巴西）。默认 `cn`。\n\n## Usage Scenarios\n\n### 1. 新授权店铺\n1. 建议问用户要 `shopName`（便于后续识别；API 非必填）\n2. 确认 `region`（默认 `cn`；全球站 `global`，巴西 `br`）\n3. 调 `authorize_url.py` 拿 URL → 给用户在浏览器打开（安全警告：为保障店铺安全，请务必在日常运营该店铺的安全网络环境中打开此链接。强烈建议使用紫鸟浏览器等专业的防关联浏览器进行授权，切勿在陌生或公共网络下操作。）\n4. 授权完成后系统自动存 token；浏览器跳转成功/失败页\n5. 可选：调 `authorized_stores.py` 确认\n\n### 2. 列已授权店铺\n调 `authorized_stores.py`，展示 `shopName / shopId / merchantId / region`。\n\n### 3. 给下游准备 accessToken（高频）\n\n用户只说自然语言（\"我的虾皮店\"、\"67890 那家店\"），**不要让用户报冗长 token**。\n\n| 用户上下文 | Agent 动作 |\n|---|---|\n| 只授权 1 家店铺 | 直接取该店铺 `shopId`，不问 |\n| 授权 ≥ 2 家 + 只说店名 | 按 `shopName` 向用户澄清 |\n| 同时给出 shopName 或 shopId | 直接定位 |\n| 显式给出 shopId / merchantId | 直接用 |\n\n**静默原则**：定位成功时不播报完整 accessToken；脚本已做掩码，不要在摘要里还原。\n\n流程：先 `authorized_stores.py` 选店 → 再 `store_tokens.py`（传 `shopId` 或 `merchantId`）→ 将 `accessToken` 交给 `/shopee/developerProxy`。\n\n## 调用原则\n\n- 授权前建议确认 `shopName` 与 `region`\n- 不输出完整 accessToken / refreshToken；脚本已做掩码，不要在摘要里还原\n- 授权失败按错误码解释原因；不擅自重试\n- 令牌过期须重新走授权流程（无 `refreshToken` 公开接口）\n\n## 常见问题\n\n### 授权完成但查不到店铺\n\n原因：Token 推送回调（`/shopee/oauth/tokenCallback`）未成功落库，或 `state` 不匹配。\n解决：查看服务日志；重新调 `authorize_url.py` 完成授权。\n\n### 查令牌返回 1004\n\n原因：`shopId` / `merchantId` 错误，或授权不属于当前用户。\n解决：先调 `authorized_stores.py` 核对店铺信息。\n\n## Not Applicable\n\n- **Shopee 订单查询与处理** → `linkfox-shopee-store-orders`\n- **Shopee 店铺信息与设置** → `linkfox-shopee-store-shop`\n- **Shopee 店铺商品 listing** → `linkfox-shopee-store-product`\n- **Shopee 跨境全球商品 GlobalProduct** → `linkfox-shopee-store-global-product`\n- **Shopee 跨境商户信息 Merchant** → `linkfox-shopee-store-merchant`\n- **Shopee 物流发货 Logistics** → `linkfox-shopee-store-logistics`\n- **Shopee 退货退款 Returns** → `linkfox-shopee-store-returns`\n- **Shopee 站内广告 Ads** → `linkfox-shopee-store-ads`\n- **Shopee 支付结算 Payment** → `linkfox-shopee-store-payment`\n- **Shopee 联盟营销 AMS** → `linkfox-shopee-store-ams`\n- **Shopee 店铺视频 Video** → `linkfox-shopee-store-video`\n- **Shopee 媒体上传 MediaSpace** → `linkfox-shopee-store-media-space`\n- **Shopee 媒体上传 Media** → `linkfox-shopee-store-media`（`api/v2/media/...`，module=130）\n- **Shopee 头程物流 FirstMile** → `linkfox-shopee-store-first-mile`\n- **Shopee 折扣促销 Discount** → `linkfox-shopee-store-discount`\n- **Shopee 套装优惠 Bundle Deal** → `linkfox-shopee-store-bundle-deal`\n- **Shopee 加购优惠 Add-On Deal** → `linkfox-shopee-store-add-on-deal`\n- **Shopee 店铺优惠券 Voucher** → `linkfox-shopee-store-voucher`\n- **Shopee 店铺秒杀 Shop Flash Sale** → `linkfox-shopee-store-shop-flash-sale`\n- **Shopee 关注有礼 Follow Prize** → `linkfox-shopee-store-follow-prize`\n- **Shopee 精选商品 Top Picks** → `linkfox-shopee-store-top-picks`\n- **Shopee 店铺分类 Shop Category** → `linkfox-shopee-store-shop-category`\n- **Shopee 账户健康 Account Health** → `linkfox-shopee-store-account-health`\n- **Shopee Public 公共模块** → `linkfox-shopee-store-public`（`v2.public.*` 底层 OAuth / Partner 查询）\n- **Shopee Push 推送机制** → `linkfox-shopee-store-push`\n- **Shopee SBS 仓储服务** → `linkfox-shopee-store-sbs`\n- **Shopee FBS 巴西仓储** → `linkfox-shopee-store-fbs`\n- **Shopee 直播 Livestream** → `linkfox-shopee-store-livestream`\n- Shopee 选品（友鹰） → `linkfox-youying-shopee-product-search`\n- 商品 listing 管理 → 专用 product skill 或 `developerProxy` 商品 API\n\n**Feedback:**\n\nAuto-detect and report feedback via the Feedback API when any of the following apply:\n1. The functionality or purpose described in this skill does not match actual behavior\n2. The skill's results do not match the user's intent\n3. The user expresses dissatisfaction or praise about this skill\n4. Anything you believe could be improved\n\nCall the feedback API as specified in `references/api.md`. Do not interrupt the user's flow.\n\n---\n*For more high-quality, professional cross-border e-commerce skills, visit [LinkFox Skills](https://skill.linkfox.com/).*\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-shopee-store-auth\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1783337302624\n}\n\nFile v1.0.2:references/api.md\n\n# linkfox-shopee-store-auth — 参数与字段参考\n\nShopee 授权、已授权店铺列表、令牌读取。\n\n业务 API 转发见 `/shopee/developerProxy`（path 须以 `api/v2` 开头）。\n\n## 通用约定\n\n- **Base URL**：`${LINKFOX_TOOL_GATEWAY}`\n- **Method**：POST，`Content-Type: application/json`\n- **Auth**：Header `Authorization: <api_key>`（读环境变量 `LINKFOX_AGENT_API_KEY` 或 `LINKFOXAGENT_API_KEY`；未配置时引导用户到 https://skill.linkfox.com/linkfoxskills/guide.htm 申请）\n\n## 关键 ID 关系\n\n```\n  一次 OAuth 授权\n        ▼\n  authRecordId (1 条)  ← 与 accessToken/refreshToken 绑定\n        │\n        ├──► shopId      ─┐\n        └──► merchantId  ─┘  查询令牌时二选一即可\n```\n\n- `authRecordId`：授权记录 ID，一次 OAuth 对应一个\n- `shopId`：店铺 ID，转发 Shopee API 时写为 `shop_id`\n- `merchantId`：商户 ID，与 `shopId` 二选一；转发时写为 `merchant_id`\n- `shopIdList` / `merchantIdList`：JSON 字符串，含本次授权绑定的全部 ID\n\n## 接口\n\n### 1. 生成授权 URL — `/shopee/authorizeUrl`\n\n服务端自动组装 `state`、`callbackUrl`、`redirectUrl`。\n\n**Request**：\n| 参数 | 类型 | 必填 | 默认 | 说明 |\n|------|------|------|------|------|\n| `shopName` | string | 否 | - | 店铺展示名，便于在列表识别 |\n| `region` | string | 否 | `cn` | `cn` / `global` / `br` |\n\n**Response**：\n```json\n{\"sourceType\": \"shopee\", \"authorizeUrl\": \"https://open.shopee.cn/auth?...&state=abc123\"}\n```\n\n授权完成后 Token 由 Shopee POST 到 `/shopee/oauth/tokenCallback`（系统内部）；浏览器跳转 `/shopee/oauth/redirect`，不作为公开接口。\n\n---\n\n### 2. 列已授权店铺 — `/shopee/authorizedStores`\n\n**Request**：无（用当前用户上下文）\n\n**Response**：\n```json\n{\n  \"total\": 1,\n  \"stores\": [{\n    \"authRecordId\": 1,\n    \"shopId\": \"67890\",\n    \"merchantId\": \"12345\",\n    \"shopIdList\": \"[67890]\",\n    \"merchantIdList\": \"[12345]\",\n    \"shopName\": \"Test Shopee Shop\",\n    \"region\": \"cn\"\n  }]\n}\n```\n\n---\n\n### 3. 查询令牌 — `/shopee/storeTokens`\n\n**Request**（`shopId` 与 `merchantId` 二选一）：\n| 参数 | 类型 | 说明 |\n|------|------|------|\n| `shopId` | string | 店铺 ID |\n| `merchantId` | string | 商户 ID |\n\n**Response**：\n```json\n{\n  \"authRecordId\": 1,\n  \"shopId\": \"67890\",\n  \"merchantId\": \"12345\",\n  \"shopIdList\": \"[67890]\",\n  \"merchantIdList\": \"[12345]\",\n  \"tokenType\": \"Bearer\",\n  \"accessToken\": \"xxx\",\n  \"expireIn\": 14400,\n  \"refreshToken\": \"xxx\"\n}\n```\n\n本接口**不触发刷新**，仅读 DB。`expireIn` 为 access_token 剩余有效秒数（通常 14400）。\n\n返回的 `accessToken` 可交给 `/shopee/developerProxy` 调用 Shopee 开放接口。\n\n---\n\n## 错误码\n\n| errcode | 含义 | 建议 |\n|---------|------|------|\n| 200 | 成功 | — |\n| 1002 | 参数错误或未登录 | 检查必填参数与 API Key |\n| 1003 | 授权服务异常或网络失败 | 稍后重试 |\n| 1004 | 授权记录不存在或不属于当前用户 | 核对 shopId / merchantId |\n| 1005 | 转发路径未在白名单内（developerProxy） | path 须以 `api/v2` 开头 |\n\n错误响应：\n```json\n{\"errcode\": 1004, \"errmsg\": \"未找到授权记录\"}\n```\n\n---\n\n## curl 示例\n\n```bash\nexport KEY=$LINKFOXAGENT_API_KEY\nBASE=https://tool-gateway.linkfox.com\n\n# 1. 生成授权 URL\ncurl -X POST $BASE/shopee/authorizeUrl -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"shopName\":\"我的虾皮店铺\",\"region\":\"cn\"}'\n\n# 2. 列已授权\ncurl -X POST $BASE/shopee/authorizedStores -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" -d '{}'\n\n# 3. 查令牌\ncurl -X POST $BASE/shopee/storeTokens -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" -d '{\"shopId\":\"67890\"}'\n```\n\n---\n\n## Feedback API\n\n与上面的工具 API **base URL 不同**：\n\n```bash\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"skillName\":\"linkfox-shopee-store-auth\",\"sentiment\":\"POSITIVE\",\n       \"category\":\"OTHER\",\"content\":\"授权流程顺畅\"}'\n```\n\n- `sentiment`: `POSITIVE` / `NEUTRAL` / `NEGATIVE`\n- `category`: `BUG` / `COMPLAINT` / `SUGGESTION` / `OTHER`\n\nFile v1.0.2:skill-card.md\n\n## Description: <br>\nThis skill helps agents generate Shopee store authorization URLs, list authorized stores, and retrieve store token details through LinkFox APIs. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal e-commerce operators and developers use this skill to authorize Shopee seller stores, identify authorized shop or merchant records, and prepare access-token details for downstream Shopee API workflows. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill handles LinkFox API keys, Shopee authorization URLs, and merchant token records. <br>\nMitigation: Use it only in trusted environments, treat saved LinkFox outputs and cached authorization URLs as sensitive, and clear local copies after authorization when they are no longer needed. <br>\nRisk: Endpoint override variables can route requests away from the expected LinkFox gateway. <br>\nMitigation: Avoid custom gateway or base URL environment variables unless the endpoint is controlled and expected. <br>\nRisk: Automatic feedback reporting may send user or business details outside the current workflow. <br>\nMitigation: Review feedback content before allowing user, merchant, or operational details to be reported externally. <br>\n\n\n## Reference(s): <br>\n- [Shopee Authorization API Reference](references/api.md) <br>\n- [ClawHub Skill Page](https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-auth) <br>\n- [LinkFox API Key Guide](https://skill.linkfox.com/linkfoxskills/guide.htm) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, JSON, shell commands, guidance] <br>\n**Output Format:** [Markdown guidance with JSON API and script outputs] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Scripts save full API responses to local JSON files and may print summaries for larger responses.] <br>\n\n## Skill Version(s): <br>\n1.0.2 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.1: 7 files, 13955 bytes\n\nFiles: references/api.md (4251b), scripts/_lf_output.py (6404b), scripts/authorize_url.py (5651b), scripts/authorized_stores.py (2245b), scripts/store_tokens.py (3083b), SKILL.md (8003b), _meta.json (144b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: linkfox-shopee-store-auth\ndescription: Shopee（虾皮）店铺授权与管理技能，提供完整的授权流程、已授权店铺查询以及访问令牌读取能力。授权时可填写店铺名 shopName 便于识别，region 支持 cn / global / br。当用户提到 Shopee 店铺授权、虾皮店铺绑定、授权虾皮店铺、查询已授权 Shopee 店铺、获取 Shopee 店铺令牌、Shopee seller authorization, bind Shopee shop, authorized Shopee stores, query Shopee store tokens 时触发此技能。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、访问令牌管理或店铺列表查询，也应触发。\n---\n\n# Shopee 店铺授权与管理\n\nShopee Open Platform 的 OAuth 授权、已授权店铺列表、访问令牌读取。**下游业务的前置依赖**（经 `/shopee/developerProxy` 调用开放接口）。\n\n## Core Concepts\n\n- **授权流程**：生成 URL → 用户浏览器授权 → Shopee 推送 Token → 系统按 `state` 落库\n- **店铺标识**：`shopId` 与 `merchantId` 二选一即可定位授权；一次授权可含多个 shop（见 `shopIdList`）\n- **shopName 建议填写**：调 `authorize_url.py` 前建议问用户要一个便于识别的店铺名（API 非必填）\n- **accessToken 约 4 小时有效**（`expireIn` 通常 14400）；当前网关无独立刷新接口，过期需重新授权\n\n## 可用脚本\n\n| 脚本 | 作用 |\n|------|------|\n| `authorize_url.py` | 生成授权 URL（可选 `shopName` / `region`） |\n| `authorized_stores.py` | 列出已授权店铺 |\n| `store_tokens.py` | 查 token（供下游使用） |\n\n入参、响应字段、错误码见 `references/api.md`。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/{authorizeUrl|storeTokens|authorizedStores}`（完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 支持区域\n\n`cn`（中国跨境，默认） / `global`（全球授权页） / `br`（巴西）。默认 `cn`。\n\n## Usage Scenarios\n\n### 1. 新授权店铺\n1. 建议问用户要 `shopName`（便于后续识别；API 非必填）\n2. 确认 `region`（默认 `cn`；全球站 `global`，巴西 `br`）\n3. 调 `authorize_url.py` 拿 URL → 给用户在浏览器打开（安全警告：为保障店铺安全，请务必在日常运营该店铺的安全网络环境中打开此链接。强烈建议使用紫鸟浏览器等专业的防关联浏览器进行授权，切勿在陌生或公共网络下操作。）\n4. 授权完成后系统自动存 token；浏览器跳转成功/失败页\n5. 可选：调 `authorized_stores.py` 确认\n\n### 2. 列已授权店铺\n调 `authorized_stores.py`，展示 `shopName / shopId / merchantId / region`。\n\n### 3. 给下游准备 accessToken（高频）\n\n用户只说自然语言（\"我的虾皮店\"、\"67890 那家店\"），**不要让用户报冗长 token**。\n\n| 用户上下文 | Agent 动作 |\n|---|---|\n| 只授权 1 家店铺 | 直接取该店铺 `shopId`，不问 |\n| 授权 ≥ 2 家 + 只说店名 | 按 `shopName` 向用户澄清 |\n| 同时给出 shopName 或 shopId | 直接定位 |\n| 显式给出 shopId / merchantId | 直接用 |\n\n**静默原则**：定位成功时不播报完整 accessToken；脚本已做掩码，不要在摘要里还原。\n\n流程：先 `authorized_stores.py` 选店 → 再 `store_tokens.py`（传 `shopId` 或 `merchantId`）→ 将 `accessToken` 交给 `/shopee/developerProxy`。\n\n## 调用原则\n\n- 授权前建议确认 `shopName` 与 `region`\n- 不输出完整 accessToken / refreshToken；脚本已做掩码，不要在摘要里还原\n- 授权失败按错误码解释原因；不擅自重试\n- 令牌过期须重新走授权流程（无 `refreshToken` 公开接口）\n\n## 常见问题\n\n### 授权完成但查不到店铺\n\n原因：Token 推送回调（`/shopee/oauth/tokenCallback`）未成功落库，或 `state` 不匹配。\n解决：查看服务日志；重新调 `authorize_url.py` 完成授权。\n\n### 查令牌返回 1004\n\n原因：`shopId` / `merchantId` 错误，或授权不属于当前用户。\n解决：先调 `authorized_stores.py` 核对店铺信息。\n\n## Not Applicable\n\n- **Shopee 订单查询与处理** → `linkfox-shopee-store-orders`\n- **Shopee 店铺信息与设置** → `linkfox-shopee-store-shop`\n- **Shopee 店铺商品 listing** → `linkfox-shopee-store-product`\n- **Shopee 跨境全球商品 GlobalProduct** → `linkfox-shopee-store-global-product`\n- **Shopee 跨境商户信息 Merchant** → `linkfox-shopee-store-merchant`\n- **Shopee 物流发货 Logistics** → `linkfox-shopee-store-logistics`\n- **Shopee 退货退款 Returns** → `linkfox-shopee-store-returns`\n- **Shopee 站内广告 Ads** → `linkfox-shopee-store-ads`\n- **Shopee 支付结算 Payment** → `linkfox-shopee-store-payment`\n- **Shopee 联盟营销 AMS** → `linkfox-shopee-store-ams`\n- **Shopee 店铺视频 Video** → `linkfox-shopee-store-video`\n- **Shopee 媒体上传 MediaSpace** → `linkfox-shopee-store-media-space`\n- **Shopee 媒体上传 Media** → `linkfox-shopee-store-media`（`api/v2/media/...`，module=130）\n- **Shopee 头程物流 FirstMile** → `linkfox-shopee-store-first-mile`\n- **Shopee 折扣促销 Discount** → `linkfox-shopee-store-discount`\n- **Shopee 套装优惠 Bundle Deal** → `linkfox-shopee-store-bundle-deal`\n- **Shopee 加购优惠 Add-On Deal** → `linkfox-shopee-store-add-on-deal`\n- **Shopee 店铺优惠券 Voucher** → `linkfox-shopee-store-voucher`\n- **Shopee 店铺秒杀 Shop Flash Sale** → `linkfox-shopee-store-shop-flash-sale`\n- **Shopee 关注有礼 Follow Prize** → `linkfox-shopee-store-follow-prize`\n- **Shopee 精选商品 Top Picks** → `linkfox-shopee-store-top-picks`\n- **Shopee 店铺分类 Shop Category** → `linkfox-shopee-store-shop-category`\n- **Shopee 账户健康 Account Health** → `linkfox-shopee-store-account-health`\n- **Shopee Public 公共模块** → `linkfox-shopee-store-public`（`v2.public.*` 底层 OAuth / Partner 查询）\n- **Shopee Push 推送机制** → `linkfox-shopee-store-push`\n- **Shopee SBS 仓储服务** → `linkfox-shopee-store-sbs`\n- **Shopee FBS 巴西仓储** → `linkfox-shopee-store-fbs`\n- **Shopee 直播 Livestream** → `linkfox-shopee-store-livestream`\n- Shopee 选品（友鹰） → `linkfox-youying-shopee-product-search`\n- 商品 listing 管理 → 专用 product skill 或 `developerProxy` 商品 API\n\n**Feedback:**\n\nAuto-detect and report feedback via the Feedback API when any of the following apply:\n1. The functionality or purpose described in this skill does not match actual behavior\n2. The skill's results do not match the user's intent\n3. The user expresses dissatisfaction or praise about this skill\n4. Anything you believe could be improved\n\nCall the feedback API as specified in `references/api.md`. Do not interrupt the user's flow.\n\n---\n*For more high-quality, professional cross-border e-commerce skills, visit [LinkFox Skills](https://skill.linkfox.com/).*\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-shopee-store-auth\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1783067264543\n}\n\nFile v1.0.1:references/api.md\n\n# linkfox-shopee-store-auth — 参数与字段参考\n\nShopee 授权、已授权店铺列表、令牌读取。\n\n业务 API 转发见 `/shopee/developerProxy`（path 须以 `api/v2` 开头）。\n\n## 通用约定\n\n- **Base URL**：`${LINKFOX_TOOL_GATEWAY}`\n- **Method**：POST，`Content-Type: application/json`\n- **Auth**：Header `Authorization: <api_key>`（读环境变量 `LINKFOX_AGENT_API_KEY` 或 `LINKFOXAGENT_API_KEY`；未配置时引导用户到 https://skill.linkfox.com/linkfoxskills/guide.htm 申请）\n\n## 关键 ID 关系\n\n```\n  一次 OAuth 授权\n        ▼\n  authRecordId (1 条)  ← 与 accessToken/refreshToken 绑定\n        │\n        ├──► shopId      ─┐\n        └──► merchantId  ─┘  查询令牌时二选一即可\n```\n\n- `authRecordId`：授权记录 ID，一次 OAuth 对应一个\n- `shopId`：店铺 ID，转发 Shopee API 时写为 `shop_id`\n- `merchantId`：商户 ID，与 `shopId` 二选一；转发时写为 `merchant_id`\n- `shopIdList` / `merchantIdList`：JSON 字符串，含本次授权绑定的全部 ID\n\n## 接口\n\n### 1. 生成授权 URL — `/shopee/authorizeUrl`\n\n服务端自动组装 `state`、`callbackUrl`、`redirectUrl`。\n\n**Request**：\n| 参数 | 类型 | 必填 | 默认 | 说明 |\n|------|------|------|------|------|\n| `shopName` | string | 否 | - | 店铺展示名，便于在列表识别 |\n| `region` | string | 否 | `cn` | `cn` / `global` / `br` |\n\n**Response**：\n```json\n{\"sourceType\": \"shopee\", \"authorizeUrl\": \"https://open.shopee.cn/auth?...&state=abc123\"}\n```\n\n授权完成后 Token 由 Shopee POST 到 `/shopee/oauth/tokenCallback`（系统内部）；浏览器跳转 `/shopee/oauth/redirect`，不作为公开接口。\n\n---\n\n### 2. 列已授权店铺 — `/shopee/authorizedStores`\n\n**Request**：无（用当前用户上下文）\n\n**Response**：\n```json\n{\n  \"total\": 1,\n  \"stores\": [{\n    \"authRecordId\": 1,\n    \"shopId\": \"67890\",\n    \"merchantId\": \"12345\",\n    \"shopIdList\": \"[67890]\",\n    \"merchantIdList\": \"[12345]\",\n    \"shopName\": \"Test Shopee Shop\",\n    \"region\": \"cn\"\n  }]\n}\n```\n\n---\n\n### 3. 查询令牌 — `/shopee/storeTokens`\n\n**Request**（`shopId` 与 `merchantId` 二选一）：\n| 参数 | 类型 | 说明 |\n|------|------|------|\n| `shopId` | string | 店铺 ID |\n| `merchantId` | string | 商户 ID |\n\n**Response**：\n```json\n{\n  \"authRecordId\": 1,\n  \"shopId\": \"67890\",\n  \"merchantId\": \"12345\",\n  \"shopIdList\": \"[67890]\",\n  \"merchantIdList\": \"[12345]\",\n  \"tokenType\": \"Bearer\",\n  \"accessToken\": \"xxx\",\n  \"expireIn\": 14400,\n  \"refreshToken\": \"xxx\"\n}\n```\n\n本接口**不触发刷新**，仅读 DB。`expireIn` 为 access_token 剩余有效秒数（通常 14400）。\n\n返回的 `accessToken` 可交给 `/shopee/developerProxy` 调用 Shopee 开放接口。\n\n---\n\n## 错误码\n\n| errcode | 含义 | 建议 |\n|---------|------|------|\n| 200 | 成功 | — |\n| 1002 | 参数错误或未登录 | 检查必填参数与 API Key |\n| 1003 | 授权服务异常或网络失败 | 稍后重试 |\n| 1004 | 授权记录不存在或不属于当前用户 | 核对 shopId / merchantId |\n| 1005 | 转发路径未在白名单内（developerProxy） | path 须以 `api/v2` 开头 |\n\n错误响应：\n```json\n{\"errcode\": 1004, \"errmsg\": \"未找到授权记录\"}\n```\n\n---\n\n## curl 示例\n\n```bash\nexport KEY=$LINKFOXAGENT_API_KEY\nBASE=https://tool-gateway.linkfox.com\n\n# 1. 生成授权 URL\ncurl -X POST $BASE/shopee/authorizeUrl -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"shopName\":\"我的虾皮店铺\",\"region\":\"cn\"}'\n\n# 2. 列已授权\ncurl -X POST $BASE/shopee/authorizedStores -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" -d '{}'\n\n# 3. 查令牌\ncurl -X POST $BASE/shopee/storeTokens -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" -d '{\"shopId\":\"67890\"}'\n```\n\n---\n\n## Feedback API\n\n与上面的工具 API **base URL 不同**：\n\n```bash\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"skillName\":\"linkfox-shopee-store-auth\",\"sentiment\":\"POSITIVE\",\n       \"category\":\"OTHER\",\"content\":\"授权流程顺畅\"}'\n```\n\n- `sentiment`: `POSITIVE` / `NEUTRAL` / `NEGATIVE`\n- `category`: `BUG` / `COMPLAINT` / `SUGGESTION` / `OTHER`\n\nArchive v1.0.0: 8 files, 15277 bytes\n\nFiles: references/api.md (4252b), scripts/_lf_output.py (6404b), scripts/authorize_url.py (5652b), scripts/authorized_stores.py (2246b), scripts/store_tokens.py (3084b), skill-card.md (2587b), SKILL.md (8003b), _meta.json (144b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: linkfox-shopee-store-auth\ndescription: Shopee（虾皮）店铺授权与管理技能，提供完整的授权流程、已授权店铺查询以及访问令牌读取能力。授权时可填写店铺名 shopName 便于识别，region 支持 cn / global / br。当用户提到 Shopee 店铺授权、虾皮店铺绑定、授权虾皮店铺、查询已授权 Shopee 店铺、获取 Shopee 店铺令牌、Shopee seller authorization, bind Shopee shop, authorized Shopee stores, query Shopee store tokens 时触发此技能。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、访问令牌管理或店铺列表查询，也应触发。\n---\n\n# Shopee 店铺授权与管理\n\nShopee Open Platform 的 OAuth 授权、已授权店铺列表、访问令牌读取。**下游业务的前置依赖**（经 `/shopee/developerProxy` 调用开放接口）。\n\n## Core Concepts\n\n- **授权流程**：生成 URL → 用户浏览器授权 → Shopee 推送 Token → 系统按 `state` 落库\n- **店铺标识**：`shopId` 与 `merchantId` 二选一即可定位授权；一次授权可含多个 shop（见 `shopIdList`）\n- **shopName 建议填写**：调 `authorize_url.py` 前建议问用户要一个便于识别的店铺名（API 非必填）\n- **accessToken 约 4 小时有效**（`expireIn` 通常 14400）；当前网关无独立刷新接口，过期需重新授权\n\n## 可用脚本\n\n| 脚本 | 作用 |\n|------|------|\n| `authorize_url.py` | 生成授权 URL（可选 `shopName` / `region`） |\n| `authorized_stores.py` | 列出已授权店铺 |\n| `store_tokens.py` | 查 token（供下游使用） |\n\n入参、响应字段、错误码见 `references/api.md`。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/{authorizeUrl|storeTokens|authorizedStores}`（完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 支持区域\n\n`cn`（中国跨境，默认） / `global`（全球授权页） / `br`（巴西）。默认 `cn`。\n\n## Usage Scenarios\n\n### 1. 新授权店铺\n1. 建议问用户要 `shopName`（便于后续识别；API 非必填）\n2. 确认 `region`（默认 `cn`；全球站 `global`，巴西 `br`）\n3. 调 `authorize_url.py` 拿 URL → 给用户在浏览器打开（安全警告：为保障店铺安全，请务必在日常运营该店铺的安全网络环境中打开此链接。强烈建议使用紫鸟浏览器等专业的防关联浏览器进行授权，切勿在陌生或公共网络下操作。）\n4. 授权完成后系统自动存 token；浏览器跳转成功/失败页\n5. 可选：调 `authorized_stores.py` 确认\n\n### 2. 列已授权店铺\n调 `authorized_stores.py`，展示 `shopName / shopId / merchantId / region`。\n\n### 3. 给下游准备 accessToken（高频）\n\n用户只说自然语言（\"我的虾皮店\"、\"67890 那家店\"），**不要让用户报冗长 token**。\n\n| 用户上下文 | Agent 动作 |\n|---|---|\n| 只授权 1 家店铺 | 直接取该店铺 `shopId`，不问 |\n| 授权 ≥ 2 家 + 只说店名 | 按 `shopName` 向用户澄清 |\n| 同时给出 shopName 或 shopId | 直接定位 |\n| 显式给出 shopId / merchantId | 直接用 |\n\n**静默原则**：定位成功时不播报完整 accessToken；脚本已做掩码，不要在摘要里还原。\n\n流程：先 `authorized_stores.py` 选店 → 再 `store_tokens.py`（传 `shopId` 或 `merchantId`）→ 将 `accessToken` 交给 `/shopee/developerProxy`。\n\n## 调用原则\n\n- 授权前建议确认 `shopName` 与 `region`\n- 不输出完整 accessToken / refreshToken；脚本已做掩码，不要在摘要里还原\n- 授权失败按错误码解释原因；不擅自重试\n- 令牌过期须重新走授权流程（无 `refreshToken` 公开接口）\n\n## 常见问题\n\n### 授权完成但查不到店铺\n\n原因：Token 推送回调（`/shopee/oauth/tokenCallback`）未成功落库，或 `state` 不匹配。\n解决：查看服务日志；重新调 `authorize_url.py` 完成授权。\n\n### 查令牌返回 1004\n\n原因：`shopId` / `merchantId` 错误，或授权不属于当前用户。\n解决：先调 `authorized_stores.py` 核对店铺信息。\n\n## Not Applicable\n\n- **Shopee 订单查询与处理** → `linkfox-shopee-store-orders`\n- **Shopee 店铺信息与设置** → `linkfox-shopee-store-shop`\n- **Shopee 店铺商品 listing** → `linkfox-shopee-store-product`\n- **Shopee 跨境全球商品 GlobalProduct** → `linkfox-shopee-store-global-product`\n- **Shopee 跨境商户信息 Merchant** → `linkfox-shopee-store-merchant`\n- **Shopee 物流发货 Logistics** → `linkfox-shopee-store-logistics`\n- **Shopee 退货退款 Returns** → `linkfox-shopee-store-returns`\n- **Shopee 站内广告 Ads** → `linkfox-shopee-store-ads`\n- **Shopee 支付结算 Payment** → `linkfox-shopee-store-payment`\n- **Shopee 联盟营销 AMS** → `linkfox-shopee-store-ams`\n- **Shopee 店铺视频 Video** → `linkfox-shopee-store-video`\n- **Shopee 媒体上传 MediaSpace** → `linkfox-shopee-store-media-space`\n- **Shopee 媒体上传 Media** → `linkfox-shopee-store-media`（`api/v2/media/...`，module=130）\n- **Shopee 头程物流 FirstMile** → `linkfox-shopee-store-first-mile`\n- **Shopee 折扣促销 Discount** → `linkfox-shopee-store-discount`\n- **Shopee 套装优惠 Bundle Deal** → `linkfox-shopee-store-bundle-deal`\n- **Shopee 加购优惠 Add-On Deal** → `linkfox-shopee-store-add-on-deal`\n- **Shopee 店铺优惠券 Voucher** → `linkfox-shopee-store-voucher`\n- **Shopee 店铺秒杀 Shop Flash Sale** → `linkfox-shopee-store-shop-flash-sale`\n- **Shopee 关注有礼 Follow Prize** → `linkfox-shopee-store-follow-prize`\n- **Shopee 精选商品 Top Picks** → `linkfox-shopee-store-top-picks`\n- **Shopee 店铺分类 Shop Category** → `linkfox-shopee-store-shop-category`\n- **Shopee 账户健康 Account Health** → `linkfox-shopee-store-account-health`\n- **Shopee Public 公共模块** → `linkfox-shopee-store-public`（`v2.public.*` 底层 OAuth / Partner 查询）\n- **Shopee Push 推送机制** → `linkfox-shopee-store-push`\n- **Shopee SBS 仓储服务** → `linkfox-shopee-store-sbs`\n- **Shopee FBS 巴西仓储** → `linkfox-shopee-store-fbs`\n- **Shopee 直播 Livestream** → `linkfox-shopee-store-livestream`\n- Shopee 选品（友鹰） → `linkfox-youying-shopee-product-search`\n- 商品 listing 管理 → 专用 product skill 或 `developerProxy` 商品 API\n\n**Feedback:**\n\nAuto-detect and report feedback via the Feedback API when any of the following apply:\n1. The functionality or purpose described in this skill does not match actual behavior\n2. The skill's results do not match the user's intent\n3. The user expresses dissatisfaction or praise about this skill\n4. Anything you believe could be improved\n\nCall the feedback API as specified in `references/api.md`. Do not interrupt the user's flow.\n\n---\n*For more high-quality, professional cross-border e-commerce skills, visit [LinkFox Skills](https://skill.linkfox.com/).*\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-shopee-store-auth\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1782998566786\n}\n\nFile v1.0.0:references/api.md\n\n# linkfox-shopee-store-auth — 参数与字段参考\n\nShopee 授权、已授权店铺列表、令牌读取。\n\n业务 API 转发见 `/shopee/developerProxy`（path 须以 `api/v2` 开头）。\n\n## 通用约定\n\n- **Base URL**：`${LINKFOX_AGENT_API_URL}`\n- **Method**：POST，`Content-Type: application/json`\n- **Auth**：Header `Authorization: <api_key>`（读环境变量 `LINKFOX_AGENT_API_KEY` 或 `LINKFOXAGENT_API_KEY`；未配置时引导用户到 https://skill.linkfox.com/linkfoxskills/guide.htm 申请）\n\n## 关键 ID 关系\n\n```\n  一次 OAuth 授权\n        ▼\n  authRecordId (1 条)  ← 与 accessToken/refreshToken 绑定\n        │\n        ├──► shopId      ─┐\n        └──► merchantId  ─┘  查询令牌时二选一即可\n```\n\n- `authRecordId`：授权记录 ID，一次 OAuth 对应一个\n- `shopId`：店铺 ID，转发 Shopee API 时写为 `shop_id`\n- `merchantId`：商户 ID，与 `shopId` 二选一；转发时写为 `merchant_id`\n- `shopIdList` / `merchantIdList`：JSON 字符串，含本次授权绑定的全部 ID\n\n## 接口\n\n### 1. 生成授权 URL — `/shopee/authorizeUrl`\n\n服务端自动组装 `state`、`callbackUrl`、`redirectUrl`。\n\n**Request**：\n| 参数 | 类型 | 必填 | 默认 | 说明 |\n|------|------|------|------|------|\n| `shopName` | string | 否 | - | 店铺展示名，便于在列表识别 |\n| `region` | string | 否 | `cn` | `cn` / `global` / `br` |\n\n**Response**：\n```json\n{\"sourceType\": \"shopee\", \"authorizeUrl\": \"https://open.shopee.cn/auth?...&state=abc123\"}\n```\n\n授权完成后 Token 由 Shopee POST 到 `/shopee/oauth/tokenCallback`（系统内部）；浏览器跳转 `/shopee/oauth/redirect`，不作为公开接口。\n\n---\n\n### 2. 列已授权店铺 — `/shopee/authorizedStores`\n\n**Request**：无（用当前用户上下文）\n\n**Response**：\n```json\n{\n  \"total\": 1,\n  \"stores\": [{\n    \"authRecordId\": 1,\n    \"shopId\": \"67890\",\n    \"merchantId\": \"12345\",\n    \"shopIdList\": \"[67890]\",\n    \"merchantIdList\": \"[12345]\",\n    \"shopName\": \"Test Shopee Shop\",\n    \"region\": \"cn\"\n  }]\n}\n```\n\n---\n\n### 3. 查询令牌 — `/shopee/storeTokens`\n\n**Request**（`shopId` 与 `merchantId` 二选一）：\n| 参数 | 类型 | 说明 |\n|------|------|------|\n| `shopId` | string | 店铺 ID |\n| `merchantId` | string | 商户 ID |\n\n**Response**：\n```json\n{\n  \"authRecordId\": 1,\n  \"shopId\": \"67890\",\n  \"merchantId\": \"12345\",\n  \"shopIdList\": \"[67890]\",\n  \"merchantIdList\": \"[12345]\",\n  \"tokenType\": \"Bearer\",\n  \"accessToken\": \"xxx\",\n  \"expireIn\": 14400,\n  \"refreshToken\": \"xxx\"\n}\n```\n\n本接口**不触发刷新**，仅读 DB。`expireIn` 为 access_token 剩余有效秒数（通常 14400）。\n\n返回的 `accessToken` 可交给 `/shopee/developerProxy` 调用 Shopee 开放接口。\n\n---\n\n## 错误码\n\n| errcode | 含义 | 建议 |\n|---------|------|------|\n| 200 | 成功 | — |\n| 1002 | 参数错误或未登录 | 检查必填参数与 API Key |\n| 1003 | 授权服务异常或网络失败 | 稍后重试 |\n| 1004 | 授权记录不存在或不属于当前用户 | 核对 shopId / merchantId |\n| 1005 | 转发路径未在白名单内（developerProxy） | path 须以 `api/v2` 开头 |\n\n错误响应：\n```json\n{\"errcode\": 1004, \"errmsg\": \"未找到授权记录\"}\n```\n\n---\n\n## curl 示例\n\n```bash\nexport KEY=$LINKFOXAGENT_API_KEY\nBASE=https://tool-gateway.linkfox.com\n\n# 1. 生成授权 URL\ncurl -X POST $BASE/shopee/authorizeUrl -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"shopName\":\"我的虾皮店铺\",\"region\":\"cn\"}'\n\n# 2. 列已授权\ncurl -X POST $BASE/shopee/authorizedStores -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" -d '{}'\n\n# 3. 查令牌\ncurl -X POST $BASE/shopee/storeTokens -H \"Authorization: $KEY\" \\\n  -H \"Content-Type: application/json\" -d '{\"shopId\":\"67890\"}'\n```\n\n---\n\n## Feedback API\n\n与上面的工具 API **base URL 不同**：\n\n```bash\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"skillName\":\"linkfox-shopee-store-auth\",\"sentiment\":\"POSITIVE\",\n       \"category\":\"OTHER\",\"content\":\"授权流程顺畅\"}'\n```\n\n- `sentiment`: `POSITIVE` / `NEUTRAL` / `NEGATIVE`\n- `category`: `BUG` / `COMPLAINT` / `SUGGESTION` / `OTHER`\n\nFile v1.0.0:skill-card.md\n\n## Description: <br>\nShopee Store Auth helps agents generate Shopee OAuth authorization URLs, list authorized stores, and retrieve masked store token records for downstream Shopee API work. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal sellers, operators, and developers use this skill to connect Shopee stores to LinkFox workflows, confirm which stores are authorized, and prepare token-backed access for downstream Shopee Open Platform tasks. <br>\n\n### Deployment Geography for Use: <br>\nGlobal; the authorization flow supports cn, global, and br regions. <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Shopee authorization links and store token material may be exposed through local response files, cache files, temp files, or clipboard history. <br>\nMitigation: Install only if you trust LinkFox, review local linkfox output locations and clipboard handling, and avoid sharing saved response files. <br>\nRisk: Credential-bearing API requests can be redirected if API base URL override environment variables are set to an untrusted endpoint. <br>\nMitigation: Use the default LinkFox gateway or set LINKFOX_AGENT_API_URL and SHOPEE_API_BASE_URL only to endpoints you control. <br>\nRisk: Store access depends on short-lived Shopee tokens and can fail when tokens expire or when the wrong shopId or merchantId is used. <br>\nMitigation: Confirm the authorized store before token lookup, avoid exposing full tokens in conversation, and re-run authorization when tokens expire. <br>\n\n\n## Reference(s): <br>\n- [API reference](references/api.md) <br>\n- [ClawHub skill page](https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-auth) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, json, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with JSON command outputs and saved local JSON response files.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Scripts persist full JSON responses under a local linkfox session directory; large responses are summarized unless inline output is requested.] <br>\n\n## Skill Version(s): <br>\n1.0.0 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>","readmeExcerpt":"Skill: Shopee-店铺授权 Owner: linkfox-ai Summary: Shopee（虾皮）店铺授权与管理技能，支持 ERP 与广告（AD）双应用分开授权。提供授权流程、已授权店铺查询以及授权状态读取。授权时可填写店铺名 shopName，region 支持 cn / global / br，appType 支持 erp / ad。当用户提到 Shopee 店铺授权、虾皮店铺绑定、ERP 授权、广告授权、appType、查询已授权 Shopee 店铺、Shopee seller authorization, bind Shopee shop, Shopee Ads authorization 时触发。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、ERP/广告应用授权或店铺列表查询，也应触发。 Tags: latest:1.0.5 Version history: v1.0.5 | 202","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"一次 OAuth 授权（指定 appType）\n        ▼\n  authRecordId (1 条)  ← 与该应用的 access/refresh token 绑定\n        │\n        ├──► shopId      ─┐\n        ├──► merchantId  ─┘  查询时二选一即可\n        └──► appType: erp | ad"},{"language":"json","snippet":"{\"sourceType\": \"shopee\", \"authorizeUrl\": \"https://open.shopee.cn/auth?...&state=abc123\"}"},{"language":"json","snippet":"{\"shopName\": \"Example Shop\", \"region\": \"cn\", \"appType\": \"erp\"}"},{"language":"json","snippet":"{\"shopName\": \"Example Shop\", \"region\": \"cn\", \"appType\": \"ad\"}"},{"language":"json","snippet":"{\n  \"total\": 2,\n  \"stores\": [\n    {\n      \"authRecordId\": 1,\n      \"shopId\": \"67890\",\n      \"merchantId\": \"12345\",\n      \"shopIdList\": \"[67890]\",\n      \"merchantIdList\": \"[12345]\",\n      \"shopName\": \"Test Shopee Shop\",\n      \"region\": \"cn\",\n      \"appType\": \"erp\"\n    },\n    {\n      \"authRecordId\": 2,\n      \"shopId\": \"67890\",\n      \"merchantId\": \"12345\",\n      \"shopName\": \"Test Shopee Shop\",\n      \"region\": \"cn\",\n      \"appType\": \"ad\"\n    }\n  ]\n}"},{"language":"json","snippet":"{\n  \"authRecordId\": 1,\n  \"shopId\": \"67890\",\n  \"merchantId\": \"12345\",\n  \"appType\": \"ad\",\n  \"tokenType\": \"Bearer\",\n  \"expireIn\": 14400,\n  \"status\": \"ok\"\n}"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: linkfox-shopee-store-auth\ndescription: Shopee（虾皮）店铺授权与管理技能，支持 ERP 与广告（AD）双应用分开授权。提供授权流程、已授权店铺查询以及授权状态读取。授权时可填写店铺名 shopName，region 支持 cn / global / br，appType 支持 erp / ad。当用户提到 Shopee 店铺授权、虾皮店铺绑定、ERP 授权、广告授权、appType、查询已授权 Shopee 店铺、Shopee seller authorization, bind Shopee shop, Shopee Ads authorization 时触发。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、ERP/广告应用授权或店铺列表查询，也应触发。\n---\n\n# Shopee 店铺授权与管理\n\nShopee Open Platform 的 OAuth 授权、已授权店铺列表、授权状态读取。**下游业务的前置依赖**（经 `/shopee/developerProxy` 调用开放接口）。\n\nShopee **ERP** 与 **广告（AD）** 使用不同应用与 Token，必须按能力分开授权。\n\n## Core Concepts\n\n- **双应用**：`appType=erp`（商品/订单/物流等，默认）与 `appType=ad`（站内广告）彼此独立；同店可同时有两条授权\n- **授权流程**：生成 URL → 用户浏览器授权 → Shopee 推送 Token → 系统按 `state` 落库\n- **店铺标识**：`shopId` 与 `merchantId` 二选一即可定位；判断是否已授权须同时匹配 **`shopId/merchantId + appType`**\n- **shopName 建议填写**：调 `authorize_url.py` 前建议问用户要一个便于识别的店铺名（API 非必填）\n- **授权 URL 1 小时有效**：每次授权重新调用 `authorize_url.py`，不要缓存旧地址\n- **下游选店**：业务 skill 经 `developerProxy` 只传 **`shopId`/`merchantId` + path**；**勿**传 `accessToken`，也**勿**在 proxy 里传 `appType`（服务端按 path 自动路由：`api/v2/ads/**` → AD，其它 `api/v2/**` → ERP）\n- **accessToken 约 4 小时有效**（`expireIn` 通常 14400）；过期需按对应 `appType` 重新授权\n\n## Shopee authorization routing\n\n- Use `appType=erp` for product, order, logistics, and other ERP authorization.\n- Use `appType=ad` for Shopee Ads authorization.\n- Treat a missing or blank `appType` as `erp`.\n- Check authorization by both store identity and `appType`; one store may have separate ERP and AD records.\n- If the user needs both capabilities, obtain two fresh authorization URLs and explain that both authorizations must be completed.\n- Authorization URLs expire after one hour, so obtain a new URL for every authorization attempt.\n\nWhen calling `developerProxy`, pass the Shopee API path plus `shopId` or `merchantId`. Do not pass `appType` or an access token. The service routes `api/v2/ads/**` through the AD application and all other `api/v2/**` paths through the ERP application.\n\n## 可用脚本\n\n| 脚本 | 作用 |\n|------|------|\n| `authorize_url.py` | 生成授权 URL（可选 `shopName` / `region` / **`appType`**） |\n| `authorized_stores.py` | 列出已授权店铺（含 **`appType`**；同店可能两条） |\n| `store_tokens.py` | 查指定应用的授权/令牌**状态**（非下游 token 来源；须带 `appType` 区分） |\n\n入参、响应字段、错误码见 `references/api.md`。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/{authorizeUrl|storeTokens|authorizedStores}`（完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数、最大列表字段的长度 + 前 3 条样本）\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\n\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\n\n## 解决认证和积分问题\n发生以下异常情况时，采用 references/onboarding.md 引导解决问题："},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-shopee-store-auth\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1786719748868\n}"},{"path":"references/api.md","content":"# linkfox-shopee-store-auth — 参数与字段参考\n\nShopee 授权、已授权店铺列表、授权状态读取。支持 **ERP / AD** 双应用。\n\n业务 API 转发见 `/shopee/developerProxy`（path 须以 `api/v2` 开头；**勿**传 `accessToken` / `appType`）。\n\n## 通用约定\n\n- **Base URL**：`${LINKFOX_TOOL_GATEWAY}`\n- **Method**：POST，`Content-Type: application/json`\n- **Auth**：Header `Authorization: <api_key>`（读环境变量 `LINKFOX_AGENT_API_KEY` 或 `LINKFOXAGENT_API_KEY`；如未配置 按 SKILL.md 的 **## 解决认证和积分问题** 处理）\n\n## 关键 ID 与应用类型\n\n```\n  一次 OAuth 授权（指定 appType）\n        ▼\n  authRecordId (1 条)  ← 与该应用的 access/refresh token 绑定\n        │\n        ├──► shopId      ─┐\n        ├──► merchantId  ─┘  查询时二选一即可\n        └──► appType: erp | ad\n```\n\n- `authRecordId`：授权记录 ID；同一店铺可因 `appType` 不同有多条\n- `shopId`：店铺 ID，转发 Shopee API 时写为 `shop_id`\n- `merchantId`：商户 ID，与 `shopId` 二选一；转发时写为 `merchant_id`\n- `appType`：`erp`（默认）或 `ad`；空/`null` 在展示与 ERP 查找时视为 `erp`\n- `shopIdList` / `merchantIdList`：JSON 字符串，含本次授权绑定的全部 ID\n\n判断是否已授权须同时匹配：**店铺标识 + appType**。\n\n## 接口\n\n### 1. 生成授权 URL — `/shopee/authorizeUrl`\n\n服务端自动组装 `state`、`callbackUrl`、`redirectUrl`。授权地址约 **1 小时**有效，每次重新获取。\n\n**Request**：\n| 参数 | 类型 | 必填 | 默认 | 说明 |\n|------|------|------|------|------|\n| `shopName` | string | 否 | - | 店铺展示名，便于在列表识别 |\n| `region` | string | 否 | `cn` | `cn` / `global` / `br` |\n| `appType` | string | 否 | `erp` | 只允许 `erp` 或 `ad` |\n\n**Response**：\n```json\n{\"sourceType\": \"shopee\", \"authorizeUrl\": \"https://open.shopee.cn/auth?...&state=abc123\"}\n```\n\n授权完成后 Token 由 Shopee POST 到 `/shopee/oauth/tokenCallback`（系统内部）；浏览器跳转 `/shopee/oauth/redirect`，不作为公开接口。\n\nERP 示例：\n```json\n{\"shopName\": \"Example Shop\", \"region\": \"cn\", \"appType\": \"erp\"}\n```\n\n广告示例：\n```json\n{\"shopName\": \"Example Shop\", \"region\": \"cn\", \"appType\": \"ad\"}\n```\n\n---\n\n### 2. 列已授权店铺 — `/shopee/authorizedStores`\n\n**Request**：无（用当前用户上下文）\n\n**Response**：\n```json\n{\n  \"total\": 2,\n  \"stores\": [\n    {\n      \"authRecordId\": 1,\n      \"shopId\": \"67890\",\n      \"merchantId\": \"12345\",\n      \"shopIdList\": \"[67890]\",\n      \"merchantIdList\": \"[12345]\",\n      \"shopName\": \"Test Shopee Shop\",\n      \"region\": \"cn\",\n      \"appType\": \"erp\"\n    },\n    {\n      \"authRecordId\": 2,\n      \"shopId\": \"67890\",\n      \"merchantId\": \"12345\",\n      \"shopName\": \"Test Shopee Shop\",\n      \"region\": \"cn\",\n      \"appType\": \"ad\"\n    }\n  ]\n}\n```\n\n同一个店铺可能返回 ERP、AD 两条。缺 `appType` 的历史记录按 **erp** 理解。\n\n---\n\n### 3. 查询授权状态 — `/shopee/storeTokens`\n\n只返回授权状态/元数据，**不返回**原始 access token 或 refresh token（脚本侧也会剥离）。\n\n**Request**（`shopId` 与 `merchantId` 二选一）：\n| 参数 | 类型 | 必填 | 默认 | 说明 |\n|------|------|------|------|------|\n| `shopId` | string | 与 merchantId 二选一 | - | 店铺 ID |\n| `merchantId` | string | 与 shopId 二选一 | - | 商户 ID |\n| `appType` | string | 否 | `erp` | `erp` 或 `ad` |\n\n**Response（状态示例）**：\n```json\n{\n  \"authRecordId\": 1,\n  \"shopId\": \"67890\",\n  \"merchantId\": \"12345\",\n  \"appType\": \"ad\",\n  \"tokenType\": \"Bearer\",\n  \"expireIn\": 14400,\n  \"status\": \"ok\"\n}\n```\n\n本接口**不触发刷新**，仅读 DB。`expireIn` 为 access_token 剩余有效秒数（通常 14400）。\n\n**不要**用本接口取 token 再传给 `/shopee/developerProxy`；proxy 由服务端按 path 注入对应应用 Token。\n\n---\n\n### 4. 业务转发"},{"path":"references/onboarding.md","content":"# 解决认证和积分问题\n\n调用本 skill 时若网关返回 **auth** 或 **billing** 错误，走本 skill 自带的 `scripts/onboarding.py` 完成引导。\n\n**auth 场景**：`errcode=401` 或消息含 `authorized error`/`鉴权失败`/`未授权`/`unauthorized`；或 `LINKFOX_AGENT_API_KEY` 与 `LINKFOXAGENT_API_KEY` 均为空。\n1. 若已配置 key → 先让用户重启会话（最常见误判），仍失败让用户重新取 key 或换手机号重注册\n2. 未配置 → 询问：自助去 https://agent.linkfox.com/ 取 key，或提供手机号让脚本注册\n3. 手机号路径：\n   - `python scripts/onboarding.py send-code <phone>` → 展示 JSON 里的 phone/agreements\n   - 收到验证码后：`python scripts/onboarding.py login <phone> <code>`（workbuddy 宿主加 `--channel workbuddy`）\n   - 拿到 `api_key` 后把下面三平台配置转发给用户，提示重启会话生效：\n     - Windows PowerShell（永久）：`setx LINKFOX_AGENT_API_KEY \"<key>\"`\n     - macOS zsh：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.zshrc && source ~/.zshrc`\n     - Linux bash：`echo 'export LINKFOX_AGENT_API_KEY=\"<key>\"' >> ~/.bashrc && source ~/.bashrc`\n     - 变量名 `LINKFOX_AGENT_API_KEY`（主推）或 `LINKFOXAGENT_API_KEY`（老规范）任一即可\n\n**billing 场景**：`errcode=402` 或消息含 `积分/余额/quota/insufficient/充值/套餐到期`。\n- `python scripts/onboarding.py list-plans` → 有 AskUserQuestion 就弹菜单，否则输出编号清单让用户选\n- 校验 `plan_id` ∈ 清单、支付方式 ∈ 该套餐 `available_methods`（通常 `wechat/alipay`）\n- `python scripts/onboarding.py order <plan_id> <method>` → 展示优先级 PNG > `pay_url` > `ascii_qr`（标注兜底）\n- 已付款可选调 `python scripts/onboarding.py query <order_id>`，不主动轮询\n\n排除 `errcode=403`（无权限，不归入这两类）。所有子命令输出 stdout JSON，`error` 字段已含阶段前缀，透传给用户即可。完整用法：`python scripts/onboarding.py --help`。"},{"path":"skill-card.md","content":"## Description:\n\nSupports Shopee store authorization and management for separate ERP and Ads applications, including OAuth URL generation, authorized-store lookup, and authorization-status checks.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[linkfox-ai](https://clawhub.ai/user/linkfox-ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal sellers, operators, and developers use this skill to bind Shopee stores to LinkFox, distinguish ERP and Ads authorization records, and confirm which store identity and application type are ready for downstream Shopee workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill uses LinkFox account access and sends credential-bearing requests to configurable LinkFox endpoints.\n\nMitigation: Install only after reviewing the publisher, and run it in a clean environment with trusted LINKFOX_* URL variables.\n\nRisk: OAuth authorization URLs and API responses may be copied to the clipboard or retained in local linkfox output directories.\n\nMitigation: Avoid shared machines, avoid exposing terminal output, and inspect or delete generated linkfox cache files after use.\n\nRisk: The onboarding flow can request phone verification codes and create paid billing orders.\n\nMitigation: Provide phone codes or payment confirmation only when you explicitly intend to set up or purchase LinkFox service access.\n\nRisk: Automatic feedback reporting may send skill feedback to LinkFox.\n\nMitigation: Do not include secrets, authorization URLs, shop identifiers, or other sensitive business data in feedback content.\n\n## Reference(s):\n\n- [API Reference](references/api.md)\n- [Authentication and Billing Onboarding](references/onboarding.md)\n- [ClawHub Skill Page](https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-auth)\n- [Publisher Profile](https://clawhub.ai/user/linkfox-ai)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with JSON API responses and shell command examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Scripts persist full API responses under a local linkfox session directory and may print full or summarized JSON depending on response size.]\n\n## Skill Version(s):\n\n1.0.5 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Shopee（虾皮）店铺授权与管理技能，支持 ERP 与广告（AD）双应用分开授权。提供授权流程、已授权店铺查询以及授权状态读取。授权时可填写店铺名 shopName，region 支持 cn / global / br，appType 支持 erp / ad。当用户提到 Shopee 店铺授权、虾皮店铺绑定、ERP 授权、广告授权、appType、查询已授权 Shopee 店铺、Shopee seller authorization, bind Shopee shop, Shopee Ads authorization 时触发。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、ERP/广告应用授权或店铺列表查询，也应触发。 Skill: Shopee-店铺授权 Owner: linkfox-ai Summary: Shopee（虾皮）店铺授权与管理技能，支持 ERP 与广告（AD）双应用分开授权。提供授权流程、已授权店铺查询以及授权状态读取。授权时可填写店铺名 shopName，region 支持 cn / global / br，appType 支持 erp / ad。当用户提到 Shopee 店铺授权、虾皮店铺绑定、ERP 授权、广告授权、appType、查询已授权 Shopee 店铺、Shopee seller authorization, bind Shopee shop, Shopee Ads authorization 时触发。即使未明确提及\"Shopee\"或\"授权\"，只要涉及虾皮卖家账号绑定、ERP/广告应用授权或店铺列表查询，也应触发。 Tags: latest:1.0.5 Version history: v1.0.5 | 202","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1261,"uniquenessScore":46,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T23:57:10.108Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T23:57:10.108Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-12T11:03:14.398Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}