{"id":"a5e5dc28-b62c-4b99-a182-79fbbec772d5","entityType":"agent","slug":"clawhub-linkfox-ai-linkfox-shopee-store-ams","name":"Shopee-店铺AMS","canonicalUrl":"https://www.xpersona.co/agent/clawhub-linkfox-ai-linkfox-shopee-store-ams","canonicalPath":"/agent/clawhub-linkfox-ai-linkfox-shopee-store-ams","generatedAt":"2026-10-12T16:48:36.610Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T22:03:34.004Z","emptyReason":null},"description":"Shopee（虾皮）联盟营销 AMS Affiliate Marketing Solutions（与 linkfox-shopee-store-auth 同系列），经 /shopee/developerProxy 转发 Shopee Open API AMS 模块全部 36 个接口：get_open_campaign_added_product、batch_add_products_to_open_campaign、create_new_targeted_campaign、get_affiliate_performance、get_shop_performance 等。当用户提到 Shopee 联盟营销、AMS、达人带货、affiliate、Open Campaign、Targeted Campaign、佣金率、达人推广、get_open_campaign_added_product 时触发。即使未明确提及\"联盟\"，只要涉及已授权 Shopee 店铺的联盟推广或达人 campaign 管理，也应触发。","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 987 downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s171g8b6m2khwdy9ye8bxj0wx183vd4z:linkfox-shopee-store-ams","sourceUrl":"https://clawhub.ai/linkfox-ai/linkfox-shopee-store-ams","homepage":"https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-ams","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/linkfox-ai/linkfox-shopee-store-ams","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-ams","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Shopee-店铺AMS technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T22:03:34.004Z","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-11T22:03:34.004Z","emptyReason":null},"stars":null,"forks":null,"downloads":987,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"1.0.6","tractionLabel":"987 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T22:03:33.935Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T22:03:34.004Z","lastCrawledAt":"2026-10-11T22:03:33.935Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T22:03:33.935Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.6","createdAt":"2026-09-14T05:26:21.464Z","changelog":"Update from 1.0.5 to 1.0.6","fileCount":83,"zipByteSize":88898},{"version":"1.0.5","createdAt":"2026-08-14T15:02:19.928Z","changelog":"Update from 1.0.4 to 1.0.5","fileCount":83,"zipByteSize":88864},{"version":"1.0.4","createdAt":"2026-08-07T10:59:17.159Z","changelog":"Update from 1.0.3 to 1.0.4","fileCount":83,"zipByteSize":88973},{"version":"1.0.3","createdAt":"2026-07-13T12:19:38.445Z","changelog":"Update from 1.0.2 to 1.0.3","fileCount":45,"zipByteSize":38910},{"version":"1.0.2","createdAt":"2026-07-06T11:28:06.239Z","changelog":"Update from 1.0.1 to 1.0.2","fileCount":45,"zipByteSize":38118},{"version":"1.0.1","createdAt":"2026-07-03T08:27:30.429Z","changelog":"Update from 1.0.0 to 1.0.1","fileCount":44,"zipByteSize":36819},{"version":"1.0.0","createdAt":"2026-07-02T13:22:40.706Z","changelog":"Initial release","fileCount":44,"zipByteSize":36799}]},"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-ams","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s171g8b6m2khwdy9ye8bxj0wx183vd4z:linkfox-shopee-store-ams` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/linkfox-ai/linkfox-shopee-store-ams before using production credentials."],"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-ams/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-ams/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-ams/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-ams/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-ams/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-ams/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-12T16:48:36.606Z"}},"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-ams/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-ams/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-ams/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-shopee-store-ams/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":"medium","updatedAt":"2026-10-11T22:03:34.004Z","emptyReason":null},"readme":"Skill: Shopee-店铺AMS\n\nOwner: linkfox-ai\n\nSummary: Shopee（虾皮）联盟营销 AMS Affiliate Marketing Solutions（与 linkfox-shopee-store-auth 同系列），经 /shopee/developerProxy 转发 Shopee Open API AMS 模块全部 36 个接口：get_open_campaign_added_product、batch_add_products_to_open_campaign、create_new_targeted_campaign、get_affiliate_performance、get_shop_performance 等。当用户提到 Shopee 联盟营销、AMS、达人带货、affiliate、Open Campaign、Targeted Campaign、佣金率、达人推广、get_open_campaign_added_product 时触发。即使未明确提及\"联盟\"，只要涉及已授权 Shopee 店铺的联盟推广或达人 campaign 管理，也应触发。\n\nTags: latest:1.0.6\n\nVersion history:\n\nv1.0.6 | 2026-09-14T05:26:21.464Z | user\n\nUpdate from 1.0.5 to 1.0.6\n\nv1.0.5 | 2026-08-14T15:02:19.928Z | user\n\nUpdate from 1.0.4 to 1.0.5\n\nv1.0.4 | 2026-08-07T10:59:17.159Z | user\n\nUpdate from 1.0.3 to 1.0.4\n\nv1.0.3 | 2026-07-13T12:19:38.445Z | user\n\nUpdate from 1.0.2 to 1.0.3\n\nv1.0.2 | 2026-07-06T11:28:06.239Z | user\n\nUpdate from 1.0.1 to 1.0.2\n\nv1.0.1 | 2026-07-03T08:27:30.429Z | user\n\nUpdate from 1.0.0 to 1.0.1\n\nv1.0.0 | 2026-07-02T13:22:40.706Z | user\n\nInitial release\n\nArchive index:\n\nArchive v1.0.6: 83 files, 88898 bytes\n\nFiles: references/api.md (13168b), references/apis/add-all-products-to-open-campaign.md (1527b), references/apis/batch-add-products-to-open-campaign.md (1529b), references/apis/batch-edit-products-open-campaign-setting.md (1589b), references/apis/batch-get-products-suggested-rate.md (1516b), references/apis/batch-remove-products-open-campaign-setting.md (1603b), references/apis/create-new-targeted-campaign.md (1473b), references/apis/edit-affiliate-list-of-targeted-campaign.md (1571b), references/apis/edit-all-products-open-campaign-setting.md (1571b), references/apis/edit-product-list-of-targeted-campaign.md (1551b), references/apis/get-affiliate-performance.md (1430b), references/apis/get-auto-add-new-product-toggle-status.md (1556b), references/apis/get-campaign-key-metrics-performance.md (1514b), references/apis/get-content-performance.md (1410b), references/apis/get-conversion-report.md (1390b), references/apis/get-managed-affiliate-list.md (1431b), references/apis/get-open-campaign-added-product.md (1484b), references/apis/get-open-campaign-batch-task-result.md (1543b), references/apis/get-open-campaign-not-added-product.md (1531b), references/apis/get-open-campaign-performance.md (1469b), references/apis/get-optimization-suggestion-product.md (1531b), references/apis/get-performance-data-update-time.md (1508b), references/apis/get-product-performance.md (1418b), references/apis/get-recommended-affiliate-list.md (1471b), references/apis/get-shop-performance.md (1388b), references/apis/get-shop-suggested-rate.md (1431b), references/apis/get-targeted-campaign-addable-product-list.md (1595b), references/apis/get-targeted-campaign-list.md (1439b), references/apis/get-targeted-campaign-performance.md (1509b), references/apis/get-targeted-campaign-settings.md (1493b), references/apis/get-validation-list.md (1370b), references/apis/get-validation-report.md (1390b), references/apis/query-affiliate-list.md (1414b), references/apis/remove-all-products-open-campaign-setting.md (1583b), references/apis/terminate-targeted-campaign.md (1452b), references/apis/update-auto-add-new-product-setting.md (1529b), references/apis/update-basic-info-of-targeted-campaign.md (1553b), references/onboarding.md (1999b), scripts/_ams_api_runner.py (4260b), scripts/_ams_endpoints.py (9504b), scripts/_shopee_ams_common.py (12153b), scripts/add_all_products_to_open_campaign.py (770b), scripts/ams_api.py (1008b), scripts/batch_add_products_to_open_campaign.py (782b), scripts/batch_edit_products_open_campaign_setting.py (818b), scripts/batch_get_products_suggested_rate.py (770b), scripts/batch_remove_products_open_campaign_setting.py (830b), scripts/check_auth_dependency.py (3975b), scripts/create_new_targeted_campaign.py (740b), scripts/edit_affiliate_list_of_targeted_campaign.py (812b), scripts/edit_all_products_open_campaign_setting.py (806b), scripts/edit_product_list_of_targeted_campaign.py (800b), scripts/get_affiliate_performance.py (722b), scripts/get_auto_add_new_product_toggle_status.py (800b), scripts/get_campaign_key_metrics_performance.py (788b), scripts/get_content_performance.py (710b), scripts/get_conversion_report.py (698b), scripts/get_managed_affiliate_list.py (728b), scripts/get_open_campaign_added_product.py (758b), scripts/get_open_campaign_batch_task_result.py (782b), scripts/get_open_campaign_not_added_product.py (782b), scripts/get_open_campaign_performance.py (746b), scripts/get_optimization_suggestion_product.py (782b), scripts/get_performance_data_update_time.py (764b), scripts/get_product_performance.py (710b), scripts/get_recommended_affiliate_list.py (752b), scripts/get_shop_performance.py (692b), scripts/get_shop_suggested_rate.py (710b), scripts/get_targeted_campaign_addable_product_list.py (824b), scripts/get_targeted_campaign_list.py (728b), scripts/get_targeted_campaign_performance.py (770b), scripts/get_targeted_campaign_settings.py (752b), scripts/get_validation_list.py (686b), scripts/get_validation_report.py (698b), scripts/onboarding.py (24027b), scripts/query_affiliate_list.py (692b), scripts/remove_all_products_open_campaign_setting.py (818b), scripts/terminate_targeted_campaign.py (734b), scripts/update_auto_add_new_product_setting.py (782b), scripts/update_basic_info_of_targeted_campaign.py (800b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: linkfox-shopee-store-ams\ndescription: Shopee（虾皮）联盟营销 AMS Affiliate Marketing Solutions（与 linkfox-shopee-store-auth 同系列），经 /shopee/developerProxy 转发 Shopee Open API AMS 模块全部 36 个接口：get_open_campaign_added_product、batch_add_products_to_open_campaign、create_new_targeted_campaign、get_affiliate_performance、get_shop_performance 等。当用户提到 Shopee 联盟营销、AMS、达人带货、affiliate、Open Campaign、Targeted Campaign、佣金率、达人推广、get_open_campaign_added_product 时触发。即使未明确提及\"联盟\"，只要涉及已授权 Shopee 店铺的联盟推广或达人 campaign 管理，也应触发。\n---\n\n# Shopee 联盟营销 AMS\n\nShopee Open Platform **AMS（Affiliate Marketing Solutions）模块**（36 个 API）。**依赖 `linkfox-shopee-store-auth`** 选店；经 **`POST /shopee/developerProxy`** 传入 `shopId`（或 `merchantId`），由服务端解析 token 转发（`path` 须 `api/v2/ams/...`）。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\n- **成本约束**：本工具会消耗算力；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-shopee-store-ams-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 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\nAMS 模块索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\n\n---\n\n## Prerequisites（必须先读）\n\n1. 运行 `python scripts/check_auth_dependency.py`；exit code **42** → 先安装 **`linkfox-shopee-store-auth`** 并授权店铺。\n2. **不要**在本 skill 内实现授权/令牌逻辑。\n3. **AMS vs Ads**：本 skill 为联盟营销/达人带货；站内 CPC 广告见 `linkfox-shopee-store-ads`（module=117）。\n\n---\n\n## Core Concepts\n\n- **转发链路**：`developerProxy`（`shopId`/`merchantId` 选店，服务端注入 token）→ 紫鸟 `shopee-proxy` → Shopee API\n- **Open Campaign**：开放推广，所有达人可推广 → `get_open_campaign_added_product`、`batch_add_products_to_open_campaign`\n- **Targeted Campaign**：定向推广，指定达人 → `create_new_targeted_campaign`、`edit_affiliate_list_of_targeted_campaign`\n- **效果**：`get_shop_performance`、`get_product_performance`、`get_affiliate_performance`\n- **佣金**：`get_shop_suggested_rate`、`batch_get_products_suggested_rate`\n\n## 可用脚本（AMS 模块 36 个 API）\n\n| 分组 | 脚本 |\n|------|------|\n| Open Campaign | `get_open_campaign_added_product.py`、`batch_add_products_to_open_campaign.py`、`get_open_campaign_performance.py` 等 |\n| Targeted Campaign | `create_new_targeted_campaign.py`、`get_targeted_campaign_list.py`、`terminate_targeted_campaign.py` 等 |\n| 达人/Affiliate | `get_recommended_affiliate_list.py`、`query_affiliate_list.py`、`get_affiliate_performance.py` |\n| 效果报表 | `get_shop_performance.py`、`get_product_performance.py`、`get_conversion_report.py` |\n| 通用入口 | `ams_api.py`（JSON 含 `api` 字段） |\n\n完整列表见 `references/api.md`。共享：`_shopee_ams_common.py`、`_ams_endpoints.py`、`_ams_api_runner.py`。\n\n## 接口说明（按 API）\n\n入参与响应细节放在 `references/apis/`，SKILL 只保留索引。\n\n| API | 说明文档 |\n|-----|----------|\n| `add_all_products_to_open_campaign` | [references/apis/add-all-products-to-open-campaign.md](./references/apis/add-all-products-to-open-campaign.md) |\n| `batch_add_products_to_open_campaign` | [references/apis/batch-add-products-to-open-campaign.md](./references/apis/batch-add-products-to-open-campaign.md) |\n| `batch_edit_products_open_campaign_setting` | [references/apis/batch-edit-products-open-campaign-setting.md](./references/apis/batch-edit-products-open-campaign-setting.md) |\n| `batch_get_products_suggested_rate` | [references/apis/batch-get-products-suggested-rate.md](./references/apis/batch-get-products-suggested-rate.md) |\n| `batch_remove_products_open_campaign_setting` | [references/apis/batch-remove-products-open-campaign-setting.md](./references/apis/batch-remove-products-open-campaign-setting.md) |\n| `create_new_targeted_campaign` | [references/apis/create-new-targeted-campaign.md](./references/apis/create-new-targeted-campaign.md) |\n| `edit_affiliate_list_of_targeted_campaign` | [references/apis/edit-affiliate-list-of-targeted-campaign.md](./references/apis/edit-affiliate-list-of-targeted-campaign.md) |\n| `edit_all_products_open_campaign_setting` | [references/apis/edit-all-products-open-campaign-setting.md](./references/apis/edit-all-products-open-campaign-setting.md) |\n| `edit_product_list_of_targeted_campaign` | [references/apis/edit-product-list-of-targeted-campaign.md](./references/apis/edit-product-list-of-targeted-campaign.md) |\n| `get_affiliate_performance` | [references/apis/get-affiliate-performance.md](./references/apis/get-affiliate-performance.md) |\n| `get_auto_add_new_product_toggle_status` | [references/apis/get-auto-add-new-product-toggle-status.md](./references/apis/get-auto-add-new-product-toggle-status.md) |\n| `get_campaign_key_metrics_performance` | [references/apis/get-campaign-key-metrics-performance.md](./references/apis/get-campaign-key-metrics-performance.md) |\n| `get_content_performance` | [references/apis/get-content-performance.md](./references/apis/get-content-performance.md) |\n| `get_conversion_report` | [references/apis/get-conversion-report.md](./references/apis/get-conversion-report.md) |\n| `get_managed_affiliate_list` | [references/apis/get-managed-affiliate-list.md](./references/apis/get-managed-affiliate-list.md) |\n| `get_open_campaign_added_product` | [references/apis/get-open-campaign-added-product.md](./references/apis/get-open-campaign-added-product.md) |\n| `get_open_campaign_batch_task_result` | [references/apis/get-open-campaign-batch-task-result.md](./references/apis/get-open-campaign-batch-task-result.md) |\n| `get_open_campaign_not_added_product` | [references/apis/get-open-campaign-not-added-product.md](./references/apis/get-open-campaign-not-added-product.md) |\n| `get_open_campaign_performance` | [references/apis/get-open-campaign-performance.md](./references/apis/get-open-campaign-performance.md) |\n| `get_optimization_suggestion_product` | [references/apis/get-optimization-suggestion-product.md](./references/apis/get-optimization-suggestion-product.md) |\n| `get_performance_data_update_time` | [references/apis/get-performance-data-update-time.md](./references/apis/get-performance-data-update-time.md) |\n| `get_product_performance` | [references/apis/get-product-performance.md](./references/apis/get-product-performance.md) |\n| `get_recommended_affiliate_list` | [references/apis/get-recommended-affiliate-list.md](./references/apis/get-recommended-affiliate-list.md) |\n| `get_shop_performance` | [references/apis/get-shop-performance.md](./references/apis/get-shop-performance.md) |\n| `get_shop_suggested_rate` | [references/apis/get-shop-suggested-rate.md](./references/apis/get-shop-suggested-rate.md) |\n| `get_targeted_campaign_addable_product_list` | [references/apis/get-targeted-campaign-addable-product-list.md](./references/apis/get-targeted-campaign-addable-product-list.md) |\n| `get_targeted_campaign_list` | [references/apis/get-targeted-campaign-list.md](./references/apis/get-targeted-campaign-list.md) |\n| `get_targeted_campaign_performance` | [references/apis/get-targeted-campaign-performance.md](./references/apis/get-targeted-campaign-performance.md) |\n| `get_targeted_campaign_settings` | [references/apis/get-targeted-campaign-settings.md](./references/apis/get-targeted-campaign-settings.md) |\n| `get_validation_list` | [references/apis/get-validation-list.md](./references/apis/get-validation-list.md) |\n| `get_validation_report` | [references/apis/get-validation-report.md](./references/apis/get-validation-report.md) |\n| `query_affiliate_list` | [references/apis/query-affiliate-list.md](./references/apis/query-affiliate-list.md) |\n| `remove_all_products_open_campaign_setting` | [references/apis/remove-all-products-open-campaign-setting.md](./references/apis/remove-all-products-open-campaign-setting.md) |\n| `terminate_targeted_campaign` | [references/apis/terminate-targeted-campaign.md](./references/apis/terminate-targeted-campaign.md) |\n| `update_auto_add_new_product_setting` | [references/apis/update-auto-add-new-product-setting.md](./references/apis/update-auto-add-new-product-setting.md) |\n| `update_basic_info_of_targeted_campaign` | [references/apis/update-basic-info-of-targeted-campaign.md](./references/apis/update-basic-info-of-targeted-campaign.md) |\n\n模块总览 / Feedback 见 [references/api.md](./references/api.md)。\n\n## Usage Scenarios\n\n### 1. 管理 Open Campaign 商品\n1. `get_open_campaign_added_product.py` 查已加入商品\n2. `get_open_campaign_not_added_product.py` 查可加入商品\n3. `batch_add_products_to_open_campaign.py` 批量添加\n\n### 2. 创建定向达人 Campaign\n1. `get_recommended_affiliate_list.py` 选达人\n2. `create_new_targeted_campaign.py` 传完整 `body`\n3. `get_targeted_campaign_performance.py` 查效果\n\n## 调用原则\n\n- 先看 **`developerProxy.httpStatus`**，再读 `*Response` 字段\n- GET：业务参数放 JSON 顶层\n- POST：复杂接口传 `body`\n- 每个脚本 docstring 含 **官方文档 URL**（`module=127`）\n\n## Not Applicable\n\n- 店铺授权 → `linkfox-shopee-store-auth`\n- 站内 CPC 广告 → `linkfox-shopee-store-ads`\n- 商品 listing → `linkfox-shopee-store-product`\n- 店铺视频 → `linkfox-shopee-store-video`\n- 订单 → `linkfox-shopee-store-orders`\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---\n*For more high-quality, professional cross-border e-commerce skills, visit [LinkFox Skills](https://skill.linkfox.com/).*\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-shopee-store-ams\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1789363581464\n}\n\nFile v1.0.6:references/api.md\n\n# linkfox-shopee-store-ams — 参数与字段参考\r\n\r\n> 单接口入参/响应说明已拆到 **`apis/`**（按 API 一份）；本文件保留模块总览与 Feedback。\r\nShopee **AMS（Affiliate Marketing Solutions）模块**全部 36 个 API，经 **`POST /shopee/developerProxy`** 转发。\r\n\r\n授权见 **`linkfox-shopee-store-auth`**。官方索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\r\n\r\n## 通用约定\r\n\r\n- **Base URL**：`https://tool-gateway.linkfox.com`\r\n- **Method**：POST（网关），上游 Method 见各接口\r\n- **Auth**：Header `Authorization: <api_key>`（`LINKFOXAGENT_API_KEY`）\r\n- **流程**：`POST /shopee/storeTokens` → `POST /shopee/developerProxy`\r\n- **path**：须 `api/v2/ams/...`\r\n- **标识**：店铺级 API，通常传 **`shopId`**\r\n- **与 Ads 区别**：AMS 为联盟营销/达人带货；Ads（module=117）为站内 CPC 广告\r\n- **官方文档 URL 规则**：`https://open.shopee.com/documents/v2/v2.ams.{api}?module=127&type=1`\r\n\r\n---\r\n\r\n## AMS 模块总览\r\n\r\n| # | API | Method | path | 脚本 | 官方文档 |\r\n|---|-----|--------|------|------|----------|\r\n| 1 | add_all_products_to_open_campaign | POST | `api/v2/ams/add_all_products_to_open_campaign` | `add_all_products_to_open_campaign.py` | [apis/add-all-products-to-open-campaign.md](./apis/add-all-products-to-open-campaign.md) |\r\n| 2 | batch_add_products_to_open_campaign | POST | `api/v2/ams/batch_add_products_to_open_campaign` | `batch_add_products_to_open_campaign.py` | [apis/batch-add-products-to-open-campaign.md](./apis/batch-add-products-to-open-campaign.md) |\r\n| 3 | batch_edit_products_open_campaign_setting | POST | `api/v2/ams/batch_edit_products_open_campaign_setting` | `batch_edit_products_open_campaign_setting.py` | [apis/batch-edit-products-open-campaign-setting.md](./apis/batch-edit-products-open-campaign-setting.md) |\r\n| 4 | batch_get_products_suggested_rate | POST | `api/v2/ams/batch_get_products_suggested_rate` | `batch_get_products_suggested_rate.py` | [apis/batch-get-products-suggested-rate.md](./apis/batch-get-products-suggested-rate.md) |\r\n| 5 | batch_remove_products_open_campaign_setting | POST | `api/v2/ams/batch_remove_products_open_campaign_setting` | `batch_remove_products_open_campaign_setting.py` | [apis/batch-remove-products-open-campaign-setting.md](./apis/batch-remove-products-open-campaign-setting.md) |\r\n| 6 | create_new_targeted_campaign | POST | `api/v2/ams/create_new_targeted_campaign` | `create_new_targeted_campaign.py` | [apis/create-new-targeted-campaign.md](./apis/create-new-targeted-campaign.md) |\r\n| 7 | edit_affiliate_list_of_targeted_campaign | POST | `api/v2/ams/edit_affiliate_list_of_targeted_campaign` | `edit_affiliate_list_of_targeted_campaign.py` | [apis/edit-affiliate-list-of-targeted-campaign.md](./apis/edit-affiliate-list-of-targeted-campaign.md) |\r\n| 8 | edit_all_products_open_campaign_setting | POST | `api/v2/ams/edit_all_products_open_campaign_setting` | `edit_all_products_open_campaign_setting.py` | [apis/edit-all-products-open-campaign-setting.md](./apis/edit-all-products-open-campaign-setting.md) |\r\n| 9 | edit_product_list_of_targeted_campaign | POST | `api/v2/ams/edit_product_list_of_targeted_campaign` | `edit_product_list_of_targeted_campaign.py` | [apis/edit-product-list-of-targeted-campaign.md](./apis/edit-product-list-of-targeted-campaign.md) |\r\n| 10 | get_affiliate_performance | GET | `api/v2/ams/get_affiliate_performance` | `get_affiliate_performance.py` | [apis/get-affiliate-performance.md](./apis/get-affiliate-performance.md) |\r\n| 11 | get_auto_add_new_product_toggle_status | GET | `api/v2/ams/get_auto_add_new_product_toggle_status` | `get_auto_add_new_product_toggle_status.py` | [apis/get-auto-add-new-product-toggle-status.md](./apis/get-auto-add-new-product-toggle-status.md) |\r\n| 12 | get_campaign_key_metrics_performance | GET | `api/v2/ams/get_campaign_key_metrics_performance` | `get_campaign_key_metrics_performance.py` | [apis/get-campaign-key-metrics-performance.md](./apis/get-campaign-key-metrics-performance.md) |\r\n| 13 | get_content_performance | GET | `api/v2/ams/get_content_performance` | `get_content_performance.py` | [apis/get-content-performance.md](./apis/get-content-performance.md) |\r\n| 14 | get_conversion_report | GET | `api/v2/ams/get_conversion_report` | `get_conversion_report.py` | [apis/get-conversion-report.md](./apis/get-conversion-report.md) |\r\n| 15 | get_managed_affiliate_list | GET | `api/v2/ams/get_managed_affiliate_list` | `get_managed_affiliate_list.py` | [apis/get-managed-affiliate-list.md](./apis/get-managed-affiliate-list.md) |\r\n| 16 | get_open_campaign_added_product | GET | `api/v2/ams/get_open_campaign_added_product` | `get_open_campaign_added_product.py` | [apis/get-open-campaign-added-product.md](./apis/get-open-campaign-added-product.md) |\r\n| 17 | get_open_campaign_batch_task_result | GET | `api/v2/ams/get_open_campaign_batch_task_result` | `get_open_campaign_batch_task_result.py` | [apis/get-open-campaign-batch-task-result.md](./apis/get-open-campaign-batch-task-result.md) |\r\n| 18 | get_open_campaign_not_added_product | GET | `api/v2/ams/get_open_campaign_not_added_product` | `get_open_campaign_not_added_product.py` | [apis/get-open-campaign-not-added-product.md](./apis/get-open-campaign-not-added-product.md) |\r\n| 19 | get_open_campaign_performance | GET | `api/v2/ams/get_open_campaign_performance` | `get_open_campaign_performance.py` | [apis/get-open-campaign-performance.md](./apis/get-open-campaign-performance.md) |\r\n| 20 | get_optimization_suggestion_product | GET | `api/v2/ams/get_optimization_suggestion_product` | `get_optimization_suggestion_product.py` | [apis/get-optimization-suggestion-product.md](./apis/get-optimization-suggestion-product.md) |\r\n| 21 | get_performance_data_update_time | GET | `api/v2/ams/get_performance_data_update_time` | `get_performance_data_update_time.py` | [apis/get-performance-data-update-time.md](./apis/get-performance-data-update-time.md) |\r\n| 22 | get_product_performance | GET | `api/v2/ams/get_product_performance` | `get_product_performance.py` | [apis/get-product-performance.md](./apis/get-product-performance.md) |\r\n| 23 | get_recommended_affiliate_list | GET | `api/v2/ams/get_recommended_affiliate_list` | `get_recommended_affiliate_list.py` | [apis/get-recommended-affiliate-list.md](./apis/get-recommended-affiliate-list.md) |\r\n| 24 | get_shop_performance | GET | `api/v2/ams/get_shop_performance` | `get_shop_performance.py` | [apis/get-shop-performance.md](./apis/get-shop-performance.md) |\r\n| 25 | get_shop_suggested_rate | GET | `api/v2/ams/get_shop_suggested_rate` | `get_shop_suggested_rate.py` | [apis/get-shop-suggested-rate.md](./apis/get-shop-suggested-rate.md) |\r\n| 26 | get_targeted_campaign_addable_product_list | GET | `api/v2/ams/get_targeted_campaign_addable_product_list` | `get_targeted_campaign_addable_product_list.py` | [apis/get-targeted-campaign-addable-product-list.md](./apis/get-targeted-campaign-addable-product-list.md) |\r\n| 27 | get_targeted_campaign_list | GET | `api/v2/ams/get_targeted_campaign_list` | `get_targeted_campaign_list.py` | [apis/get-targeted-campaign-list.md](./apis/get-targeted-campaign-list.md) |\r\n| 28 | get_targeted_campaign_performance | GET | `api/v2/ams/get_targeted_campaign_performance` | `get_targeted_campaign_performance.py` | [apis/get-targeted-campaign-performance.md](./apis/get-targeted-campaign-performance.md) |\r\n| 29 | get_targeted_campaign_settings | GET | `api/v2/ams/get_targeted_campaign_settings` | `get_targeted_campaign_settings.py` | [apis/get-targeted-campaign-settings.md](./apis/get-targeted-campaign-settings.md) |\r\n| 30 | get_validation_list | GET | `api/v2/ams/get_validation_list` | `get_validation_list.py` | [apis/get-validation-list.md](./apis/get-validation-list.md) |\r\n| 31 | get_validation_report | GET | `api/v2/ams/get_validation_report` | `get_validation_report.py` | [apis/get-validation-report.md](./apis/get-validation-report.md) |\r\n| 32 | query_affiliate_list | GET | `api/v2/ams/query_affiliate_list` | `query_affiliate_list.py` | [apis/query-affiliate-list.md](./apis/query-affiliate-list.md) |\r\n| 33 | remove_all_products_open_campaign_setting | POST | `api/v2/ams/remove_all_products_open_campaign_setting` | `remove_all_products_open_campaign_setting.py` | [apis/remove-all-products-open-campaign-setting.md](./apis/remove-all-products-open-campaign-setting.md) |\r\n| 34 | terminate_targeted_campaign | POST | `api/v2/ams/terminate_targeted_campaign` | `terminate_targeted_campaign.py` | [apis/terminate-targeted-campaign.md](./apis/terminate-targeted-campaign.md) |\r\n| 35 | update_auto_add_new_product_setting | POST | `api/v2/ams/update_auto_add_new_product_setting` | `update_auto_add_new_product_setting.py` | [apis/update-auto-add-new-product-setting.md](./apis/update-auto-add-new-product-setting.md) |\r\n| 36 | update_basic_info_of_targeted_campaign | POST | `api/v2/ams/update_basic_info_of_targeted_campaign` | `update_basic_info_of_targeted_campaign.py` | [apis/update-basic-info-of-targeted-campaign.md](./apis/update-basic-info-of-targeted-campaign.md) |\r\n通用入口：`ams_api.py`（JSON 含 `\"api\": \"<上表 API 名>\"`）。\r\n\r\n---\r\n\r\n## 常用接口说明\r\n\r\n### Open Campaign（开放推广）\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_open_campaign_added_product` | 已加入 Open Campaign 的商品 — [apis/get-open-campaign-added-product.md](./apis/get-open-campaign-added-product.md) |\r\n| `get_open_campaign_not_added_product` | 未加入的商品 — [apis/get-open-campaign-not-added-product.md](./apis/get-open-campaign-not-added-product.md) |\r\n| `batch_add_products_to_open_campaign` | 批量添加商品 — [apis/batch-add-products-to-open-campaign.md](./apis/batch-add-products-to-open-campaign.md) |\r\n| `batch_edit_products_open_campaign_setting` | 批量编辑佣金等设置 — [apis/batch-edit-products-open-campaign-setting.md](./apis/batch-edit-products-open-campaign-setting.md) |\r\n| `get_open_campaign_performance` | Open Campaign 效果数据 — [apis/get-open-campaign-performance.md](./apis/get-open-campaign-performance.md) |\r\n\r\n### Targeted Campaign（定向推广）\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `create_new_targeted_campaign` | 创建定向达人 campaign — [apis/create-new-targeted-campaign.md](./apis/create-new-targeted-campaign.md) |\r\n| `get_targeted_campaign_list` | campaign 列表 — [apis/get-targeted-campaign-list.md](./apis/get-targeted-campaign-list.md) |\r\n| `edit_product_list_of_targeted_campaign` | 编辑 campaign 商品 — [apis/edit-product-list-of-targeted-campaign.md](./apis/edit-product-list-of-targeted-campaign.md) |\r\n| `edit_affiliate_list_of_targeted_campaign` | 编辑 campaign 达人 — [apis/edit-affiliate-list-of-targeted-campaign.md](./apis/edit-affiliate-list-of-targeted-campaign.md) |\r\n| `get_targeted_campaign_performance` | 定向 campaign 效果 — [apis/get-targeted-campaign-performance.md](./apis/get-targeted-campaign-performance.md) |\r\n\r\n### 达人/Affiliate\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_recommended_affiliate_list` | 推荐达人 — [apis/get-recommended-affiliate-list.md](./apis/get-recommended-affiliate-list.md) |\r\n| `get_managed_affiliate_list` | 已管理达人 — [apis/get-managed-affiliate-list.md](./apis/get-managed-affiliate-list.md) |\r\n| `query_affiliate_list` | 查询达人列表 — [apis/query-affiliate-list.md](./apis/query-affiliate-list.md) |\r\n| `get_affiliate_performance` | 达人效果 — [apis/get-affiliate-performance.md](./apis/get-affiliate-performance.md) |\r\n\r\n### 效果报表\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_shop_performance` | 店铺 AMS 效果 — [apis/get-shop-performance.md](./apis/get-shop-performance.md) |\r\n| `get_product_performance` | 商品效果 — [apis/get-product-performance.md](./apis/get-product-performance.md) |\r\n| `get_conversion_report` | 转化报告 — [apis/get-conversion-report.md](./apis/get-conversion-report.md) |\r\n| `get_campaign_key_metrics_performance` | 关键指标 — [apis/get-campaign-key-metrics-performance.md](./apis/get-campaign-key-metrics-performance.md) |\r\n\r\n---\r\n\r\n## 网关错误码\r\n\r\n| errcode | 含义 | 建议 |\r\n|---------|------|------|\r\n| 1002 | 参数/未登录 | 检查 shopId 与 API Key |\r\n| 1003 | 代理/网络异常 | 重试 |\r\n| 1004 | 无授权记录 | auth skill |\r\n| 1005 | path 未白名单 | 确认 `api/v2/ams/...` |\r\n\r\n---\r\n\r\n## curl 示例\r\n\r\n```bash\r\nexport KEY=$LINKFOXAGENT_API_KEY\r\nBASE=https://tool-gateway.linkfox.com\r\n\r\ncurl -X POST $BASE/shopee/developerProxy -H \"Authorization: $KEY\" \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\r\n    \"path\": \"api/v2/ams/get_open_campaign_added_product\",\r\n    \"method\": \"GET\",\r\n    \"accessToken\": \"xxx\",\r\n    \"shopId\": \"67890\"\r\n  }'\r\n```\r\n\r\n---\r\n\r\n## Feedback API\r\n\r\n```bash\r\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\"skillName\":\"linkfox-shopee-store-ams\",\"sentiment\":\"POSITIVE\",\r\n       \"category\":\"OTHER\",\"content\":\"AMS推广商品查询正常\"}'\r\n```\n\nFile v1.0.6:references/apis/add-all-products-to-open-campaign.md\n\n# add_all_products_to_open_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/add_all_products_to_open_campaign.py` |\n| Method / path | POST `api/v2/ams/add_all_products_to_open_campaign` |\n| 官方文档 | [add_all_products_to_open_campaign](https://open.shopee.com/documents/v2/v2.ams.add_all_products_to_open_campaign?module=127&type=1) |\n| 用途 | Add all eligible products to Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Add all eligible products to Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/add_all_products_to_open_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"add_all_products_to_open_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`addAllProductsToOpenCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/batch-add-products-to-open-campaign.md\n\n# batch_add_products_to_open_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_add_products_to_open_campaign.py` |\n| Method / path | POST `api/v2/ams/batch_add_products_to_open_campaign` |\n| 官方文档 | [batch_add_products_to_open_campaign](https://open.shopee.com/documents/v2/v2.ams.batch_add_products_to_open_campaign?module=127&type=1) |\n| 用途 | Batch add products to Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch add products to Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_add_products_to_open_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_add_products_to_open_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchAddProductsToOpenCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/batch-edit-products-open-campaign-setting.md\n\n# batch_edit_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_edit_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/batch_edit_products_open_campaign_setting` |\n| 官方文档 | [batch_edit_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.batch_edit_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Batch edit Open Campaign product settings |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch edit Open Campaign product settings\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_edit_products_open_campaign_setting.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_edit_products_open_campaign_setting\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchEditProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/batch-get-products-suggested-rate.md\n\n# batch_get_products_suggested_rate\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_get_products_suggested_rate.py` |\n| Method / path | POST `api/v2/ams/batch_get_products_suggested_rate` |\n| 官方文档 | [batch_get_products_suggested_rate](https://open.shopee.com/documents/v2/v2.ams.batch_get_products_suggested_rate?module=127&type=1) |\n| 用途 | Batch get suggested commission rates |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch get suggested commission rates\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_get_products_suggested_rate.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_get_products_suggested_rate\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchGetProductsSuggestedRate`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/batch-remove-products-open-campaign-setting.md\n\n# batch_remove_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_remove_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/batch_remove_products_open_campaign_setting` |\n| 官方文档 | [batch_remove_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.batch_remove_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Batch remove products from Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch remove products from Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_remove_products_open_campaign_setting.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_remove_products_open_campaign_setting\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchRemoveProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/create-new-targeted-campaign.md\n\n# create_new_targeted_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/create_new_targeted_campaign.py` |\n| Method / path | POST `api/v2/ams/create_new_targeted_campaign` |\n| 官方文档 | [create_new_targeted_campaign](https://open.shopee.com/documents/v2/v2.ams.create_new_targeted_campaign?module=127&type=1) |\n| 用途 | Create targeted affiliate campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Create targeted affiliate campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/create_new_targeted_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"create_new_targeted_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`createNewTargetedCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/edit-affiliate-list-of-targeted-campaign.md\n\n# edit_affiliate_list_of_targeted_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/edit_affiliate_list_of_targeted_campaign.py` |\n| Method / path | POST `api/v2/ams/edit_affiliate_list_of_targeted_campaign` |\n| 官方文档 | [edit_affiliate_list_of_targeted_campaign](https://open.shopee.com/documents/v2/v2.ams.edit_affiliate_list_of_targeted_campaign?module=127&type=1) |\n| 用途 | Edit affiliates in targeted campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Edit affiliates in targeted campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/edit_affiliate_list_of_targeted_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"edit_affiliate_list_of_targeted_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`editAffiliateListOfTargetedCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/edit-all-products-open-campaign-setting.md\n\n# edit_all_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/edit_all_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/edit_all_products_open_campaign_setting` |\n| 官方文档 | [edit_all_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.edit_all_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Edit all products Open Campaign settings |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Edit all products Open Campaign settings\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/edit_all_products_open_campaign_setting.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"edit_all_products_open_campaign_setting\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`editAllProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/edit-product-list-of-targeted-campaign.md\n\n# edit_product_list_of_targeted_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/edit_product_list_of_targeted_campaign.py` |\n| Method / path | POST `api/v2/ams/edit_product_list_of_targeted_campaign` |\n| 官方文档 | [edit_product_list_of_targeted_campaign](https://open.shopee.com/documents/v2/v2.ams.edit_product_list_of_targeted_campaign?module=127&type=1) |\n| 用途 | Edit products in targeted campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Edit products in targeted campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/edit_product_list_of_targeted_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"edit_product_list_of_targeted_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`editProductListOfTargetedCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nArchive v1.0.5: 83 files, 88864 bytes\n\nFiles: references/api.md (13168b), references/apis/add-all-products-to-open-campaign.md (1527b), references/apis/batch-add-products-to-open-campaign.md (1529b), references/apis/batch-edit-products-open-campaign-setting.md (1589b), references/apis/batch-get-products-suggested-rate.md (1516b), references/apis/batch-remove-products-open-campaign-setting.md (1603b), references/apis/create-new-targeted-campaign.md (1473b), references/apis/edit-affiliate-list-of-targeted-campaign.md (1571b), references/apis/edit-all-products-open-campaign-setting.md (1571b), references/apis/edit-product-list-of-targeted-campaign.md (1551b), references/apis/get-affiliate-performance.md (1430b), references/apis/get-auto-add-new-product-toggle-status.md (1556b), references/apis/get-campaign-key-metrics-performance.md (1514b), references/apis/get-content-performance.md (1410b), references/apis/get-conversion-report.md (1390b), references/apis/get-managed-affiliate-list.md (1431b), references/apis/get-open-campaign-added-product.md (1484b), references/apis/get-open-campaign-batch-task-result.md (1543b), references/apis/get-open-campaign-not-added-product.md (1531b), references/apis/get-open-campaign-performance.md (1469b), references/apis/get-optimization-suggestion-product.md (1531b), references/apis/get-performance-data-update-time.md (1508b), references/apis/get-product-performance.md (1418b), references/apis/get-recommended-affiliate-list.md (1471b), references/apis/get-shop-performance.md (1388b), references/apis/get-shop-suggested-rate.md (1431b), references/apis/get-targeted-campaign-addable-product-list.md (1595b), references/apis/get-targeted-campaign-list.md (1439b), references/apis/get-targeted-campaign-performance.md (1509b), references/apis/get-targeted-campaign-settings.md (1493b), references/apis/get-validation-list.md (1370b), references/apis/get-validation-report.md (1390b), references/apis/query-affiliate-list.md (1414b), references/apis/remove-all-products-open-campaign-setting.md (1583b), references/apis/terminate-targeted-campaign.md (1452b), references/apis/update-auto-add-new-product-setting.md (1529b), references/apis/update-basic-info-of-targeted-campaign.md (1553b), references/onboarding.md (2046b), scripts/_ams_api_runner.py (4260b), scripts/_ams_endpoints.py (9504b), scripts/_shopee_ams_common.py (11919b), scripts/add_all_products_to_open_campaign.py (770b), scripts/ams_api.py (1008b), scripts/batch_add_products_to_open_campaign.py (782b), scripts/batch_edit_products_open_campaign_setting.py (818b), scripts/batch_get_products_suggested_rate.py (770b), scripts/batch_remove_products_open_campaign_setting.py (830b), scripts/check_auth_dependency.py (3975b), scripts/create_new_targeted_campaign.py (740b), scripts/edit_affiliate_list_of_targeted_campaign.py (812b), scripts/edit_all_products_open_campaign_setting.py (806b), scripts/edit_product_list_of_targeted_campaign.py (800b), scripts/get_affiliate_performance.py (722b), scripts/get_auto_add_new_product_toggle_status.py (800b), scripts/get_campaign_key_metrics_performance.py (788b), scripts/get_content_performance.py (710b), scripts/get_conversion_report.py (698b), scripts/get_managed_affiliate_list.py (728b), scripts/get_open_campaign_added_product.py (758b), scripts/get_open_campaign_batch_task_result.py (782b), scripts/get_open_campaign_not_added_product.py (782b), scripts/get_open_campaign_performance.py (746b), scripts/get_optimization_suggestion_product.py (782b), scripts/get_performance_data_update_time.py (764b), scripts/get_product_performance.py (710b), scripts/get_recommended_affiliate_list.py (752b), scripts/get_shop_performance.py (692b), scripts/get_shop_suggested_rate.py (710b), scripts/get_targeted_campaign_addable_product_list.py (824b), scripts/get_targeted_campaign_list.py (728b), scripts/get_targeted_campaign_performance.py (770b), scripts/get_targeted_campaign_settings.py (752b), scripts/get_validation_list.py (686b), scripts/get_validation_report.py (698b), scripts/onboarding.py (24089b), scripts/query_affiliate_list.py (692b), scripts/remove_all_products_open_campaign_setting.py (818b), scripts/terminate_targeted_campaign.py (734b), scripts/update_auto_add_new_product_setting.py (782b), scripts/update_basic_info_of_targeted_campaign.py (800b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: linkfox-shopee-store-ams\ndescription: Shopee（虾皮）联盟营销 AMS Affiliate Marketing Solutions（与 linkfox-shopee-store-auth 同系列），经 /shopee/developerProxy 转发 Shopee Open API AMS 模块全部 36 个接口：get_open_campaign_added_product、batch_add_products_to_open_campaign、create_new_targeted_campaign、get_affiliate_performance、get_shop_performance 等。当用户提到 Shopee 联盟营销、AMS、达人带货、affiliate、Open Campaign、Targeted Campaign、佣金率、达人推广、get_open_campaign_added_product 时触发。即使未明确提及\"联盟\"，只要涉及已授权 Shopee 店铺的联盟推广或达人 campaign 管理，也应触发。\n---\n\n# Shopee 联盟营销 AMS\n\nShopee Open Platform **AMS（Affiliate Marketing Solutions）模块**（36 个 API）。**依赖 `linkfox-shopee-store-auth`** 选店；经 **`POST /shopee/developerProxy`** 传入 `shopId`（或 `merchantId`），由服务端解析 token 转发（`path` 须 `api/v2/ams/...`）。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-shopee-store-ams-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 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\nAMS 模块索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\n\n---\n\n## Prerequisites（必须先读）\n\n1. 运行 `python scripts/check_auth_dependency.py`；exit code **42** → 先安装 **`linkfox-shopee-store-auth`** 并授权店铺。\n2. **不要**在本 skill 内实现授权/令牌逻辑。\n3. **AMS vs Ads**：本 skill 为联盟营销/达人带货；站内 CPC 广告见 `linkfox-shopee-store-ads`（module=117）。\n\n---\n\n## Core Concepts\n\n- **转发链路**：`developerProxy`（`shopId`/`merchantId` 选店，服务端注入 token）→ 紫鸟 `shopee-proxy` → Shopee API\n- **Open Campaign**：开放推广，所有达人可推广 → `get_open_campaign_added_product`、`batch_add_products_to_open_campaign`\n- **Targeted Campaign**：定向推广，指定达人 → `create_new_targeted_campaign`、`edit_affiliate_list_of_targeted_campaign`\n- **效果**：`get_shop_performance`、`get_product_performance`、`get_affiliate_performance`\n- **佣金**：`get_shop_suggested_rate`、`batch_get_products_suggested_rate`\n\n## 可用脚本（AMS 模块 36 个 API）\n\n| 分组 | 脚本 |\n|------|------|\n| Open Campaign | `get_open_campaign_added_product.py`、`batch_add_products_to_open_campaign.py`、`get_open_campaign_performance.py` 等 |\n| Targeted Campaign | `create_new_targeted_campaign.py`、`get_targeted_campaign_list.py`、`terminate_targeted_campaign.py` 等 |\n| 达人/Affiliate | `get_recommended_affiliate_list.py`、`query_affiliate_list.py`、`get_affiliate_performance.py` |\n| 效果报表 | `get_shop_performance.py`、`get_product_performance.py`、`get_conversion_report.py` |\n| 通用入口 | `ams_api.py`（JSON 含 `api` 字段） |\n\n完整列表见 `references/api.md`。共享：`_shopee_ams_common.py`、`_ams_endpoints.py`、`_ams_api_runner.py`。\n\n## 接口说明（按 API）\n\n入参与响应细节放在 `references/apis/`，SKILL 只保留索引。\n\n| API | 说明文档 |\n|-----|----------|\n| `add_all_products_to_open_campaign` | [references/apis/add-all-products-to-open-campaign.md](./references/apis/add-all-products-to-open-campaign.md) |\n| `batch_add_products_to_open_campaign` | [references/apis/batch-add-products-to-open-campaign.md](./references/apis/batch-add-products-to-open-campaign.md) |\n| `batch_edit_products_open_campaign_setting` | [references/apis/batch-edit-products-open-campaign-setting.md](./references/apis/batch-edit-products-open-campaign-setting.md) |\n| `batch_get_products_suggested_rate` | [references/apis/batch-get-products-suggested-rate.md](./references/apis/batch-get-products-suggested-rate.md) |\n| `batch_remove_products_open_campaign_setting` | [references/apis/batch-remove-products-open-campaign-setting.md](./references/apis/batch-remove-products-open-campaign-setting.md) |\n| `create_new_targeted_campaign` | [references/apis/create-new-targeted-campaign.md](./references/apis/create-new-targeted-campaign.md) |\n| `edit_affiliate_list_of_targeted_campaign` | [references/apis/edit-affiliate-list-of-targeted-campaign.md](./references/apis/edit-affiliate-list-of-targeted-campaign.md) |\n| `edit_all_products_open_campaign_setting` | [references/apis/edit-all-products-open-campaign-setting.md](./references/apis/edit-all-products-open-campaign-setting.md) |\n| `edit_product_list_of_targeted_campaign` | [references/apis/edit-product-list-of-targeted-campaign.md](./references/apis/edit-product-list-of-targeted-campaign.md) |\n| `get_affiliate_performance` | [references/apis/get-affiliate-performance.md](./references/apis/get-affiliate-performance.md) |\n| `get_auto_add_new_product_toggle_status` | [references/apis/get-auto-add-new-product-toggle-status.md](./references/apis/get-auto-add-new-product-toggle-status.md) |\n| `get_campaign_key_metrics_performance` | [references/apis/get-campaign-key-metrics-performance.md](./references/apis/get-campaign-key-metrics-performance.md) |\n| `get_content_performance` | [references/apis/get-content-performance.md](./references/apis/get-content-performance.md) |\n| `get_conversion_report` | [references/apis/get-conversion-report.md](./references/apis/get-conversion-report.md) |\n| `get_managed_affiliate_list` | [references/apis/get-managed-affiliate-list.md](./references/apis/get-managed-affiliate-list.md) |\n| `get_open_campaign_added_product` | [references/apis/get-open-campaign-added-product.md](./references/apis/get-open-campaign-added-product.md) |\n| `get_open_campaign_batch_task_result` | [references/apis/get-open-campaign-batch-task-result.md](./references/apis/get-open-campaign-batch-task-result.md) |\n| `get_open_campaign_not_added_product` | [references/apis/get-open-campaign-not-added-product.md](./references/apis/get-open-campaign-not-added-product.md) |\n| `get_open_campaign_performance` | [references/apis/get-open-campaign-performance.md](./references/apis/get-open-campaign-performance.md) |\n| `get_optimization_suggestion_product` | [references/apis/get-optimization-suggestion-product.md](./references/apis/get-optimization-suggestion-product.md) |\n| `get_performance_data_update_time` | [references/apis/get-performance-data-update-time.md](./references/apis/get-performance-data-update-time.md) |\n| `get_product_performance` | [references/apis/get-product-performance.md](./references/apis/get-product-performance.md) |\n| `get_recommended_affiliate_list` | [references/apis/get-recommended-affiliate-list.md](./references/apis/get-recommended-affiliate-list.md) |\n| `get_shop_performance` | [references/apis/get-shop-performance.md](./references/apis/get-shop-performance.md) |\n| `get_shop_suggested_rate` | [references/apis/get-shop-suggested-rate.md](./references/apis/get-shop-suggested-rate.md) |\n| `get_targeted_campaign_addable_product_list` | [references/apis/get-targeted-campaign-addable-product-list.md](./references/apis/get-targeted-campaign-addable-product-list.md) |\n| `get_targeted_campaign_list` | [references/apis/get-targeted-campaign-list.md](./references/apis/get-targeted-campaign-list.md) |\n| `get_targeted_campaign_performance` | [references/apis/get-targeted-campaign-performance.md](./references/apis/get-targeted-campaign-performance.md) |\n| `get_targeted_campaign_settings` | [references/apis/get-targeted-campaign-settings.md](./references/apis/get-targeted-campaign-settings.md) |\n| `get_validation_list` | [references/apis/get-validation-list.md](./references/apis/get-validation-list.md) |\n| `get_validation_report` | [references/apis/get-validation-report.md](./references/apis/get-validation-report.md) |\n| `query_affiliate_list` | [references/apis/query-affiliate-list.md](./references/apis/query-affiliate-list.md) |\n| `remove_all_products_open_campaign_setting` | [references/apis/remove-all-products-open-campaign-setting.md](./references/apis/remove-all-products-open-campaign-setting.md) |\n| `terminate_targeted_campaign` | [references/apis/terminate-targeted-campaign.md](./references/apis/terminate-targeted-campaign.md) |\n| `update_auto_add_new_product_setting` | [references/apis/update-auto-add-new-product-setting.md](./references/apis/update-auto-add-new-product-setting.md) |\n| `update_basic_info_of_targeted_campaign` | [references/apis/update-basic-info-of-targeted-campaign.md](./references/apis/update-basic-info-of-targeted-campaign.md) |\n\n模块总览 / Feedback 见 [references/api.md](./references/api.md)。\n\n## Usage Scenarios\n\n### 1. 管理 Open Campaign 商品\n1. `get_open_campaign_added_product.py` 查已加入商品\n2. `get_open_campaign_not_added_product.py` 查可加入商品\n3. `batch_add_products_to_open_campaign.py` 批量添加\n\n### 2. 创建定向达人 Campaign\n1. `get_recommended_affiliate_list.py` 选达人\n2. `create_new_targeted_campaign.py` 传完整 `body`\n3. `get_targeted_campaign_performance.py` 查效果\n\n## 调用原则\n\n- 先看 **`developerProxy.httpStatus`**，再读 `*Response` 字段\n- GET：业务参数放 JSON 顶层\n- POST：复杂接口传 `body`\n- 每个脚本 docstring 含 **官方文档 URL**（`module=127`）\n\n## Not Applicable\n\n- 店铺授权 → `linkfox-shopee-store-auth`\n- 站内 CPC 广告 → `linkfox-shopee-store-ads`\n- 商品 listing → `linkfox-shopee-store-product`\n- 店铺视频 → `linkfox-shopee-store-video`\n- 订单 → `linkfox-shopee-store-orders`\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---\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-ams\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1786719739928\n}\n\nFile v1.0.5:references/api.md\n\n# linkfox-shopee-store-ams — 参数与字段参考\r\n\r\n> 单接口入参/响应说明已拆到 **`apis/`**（按 API 一份）；本文件保留模块总览与 Feedback。\r\nShopee **AMS（Affiliate Marketing Solutions）模块**全部 36 个 API，经 **`POST /shopee/developerProxy`** 转发。\r\n\r\n授权见 **`linkfox-shopee-store-auth`**。官方索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\r\n\r\n## 通用约定\r\n\r\n- **Base URL**：`https://tool-gateway.linkfox.com`\r\n- **Method**：POST（网关），上游 Method 见各接口\r\n- **Auth**：Header `Authorization: <api_key>`（`LINKFOXAGENT_API_KEY`）\r\n- **流程**：`POST /shopee/storeTokens` → `POST /shopee/developerProxy`\r\n- **path**：须 `api/v2/ams/...`\r\n- **标识**：店铺级 API，通常传 **`shopId`**\r\n- **与 Ads 区别**：AMS 为联盟营销/达人带货；Ads（module=117）为站内 CPC 广告\r\n- **官方文档 URL 规则**：`https://open.shopee.com/documents/v2/v2.ams.{api}?module=127&type=1`\r\n\r\n---\r\n\r\n## AMS 模块总览\r\n\r\n| # | API | Method | path | 脚本 | 官方文档 |\r\n|---|-----|--------|------|------|----------|\r\n| 1 | add_all_products_to_open_campaign | POST | `api/v2/ams/add_all_products_to_open_campaign` | `add_all_products_to_open_campaign.py` | [apis/add-all-products-to-open-campaign.md](./apis/add-all-products-to-open-campaign.md) |\r\n| 2 | batch_add_products_to_open_campaign | POST | `api/v2/ams/batch_add_products_to_open_campaign` | `batch_add_products_to_open_campaign.py` | [apis/batch-add-products-to-open-campaign.md](./apis/batch-add-products-to-open-campaign.md) |\r\n| 3 | batch_edit_products_open_campaign_setting | POST | `api/v2/ams/batch_edit_products_open_campaign_setting` | `batch_edit_products_open_campaign_setting.py` | [apis/batch-edit-products-open-campaign-setting.md](./apis/batch-edit-products-open-campaign-setting.md) |\r\n| 4 | batch_get_products_suggested_rate | POST | `api/v2/ams/batch_get_products_suggested_rate` | `batch_get_products_suggested_rate.py` | [apis/batch-get-products-suggested-rate.md](./apis/batch-get-products-suggested-rate.md) |\r\n| 5 | batch_remove_products_open_campaign_setting | POST | `api/v2/ams/batch_remove_products_open_campaign_setting` | `batch_remove_products_open_campaign_setting.py` | [apis/batch-remove-products-open-campaign-setting.md](./apis/batch-remove-products-open-campaign-setting.md) |\r\n| 6 | create_new_targeted_campaign | POST | `api/v2/ams/create_new_targeted_campaign` | `create_new_targeted_campaign.py` | [apis/create-new-targeted-campaign.md](./apis/create-new-targeted-campaign.md) |\r\n| 7 | edit_affiliate_list_of_targeted_campaign | POST | `api/v2/ams/edit_affiliate_list_of_targeted_campaign` | `edit_affiliate_list_of_targeted_campaign.py` | [apis/edit-affiliate-list-of-targeted-campaign.md](./apis/edit-affiliate-list-of-targeted-campaign.md) |\r\n| 8 | edit_all_products_open_campaign_setting | POST | `api/v2/ams/edit_all_products_open_campaign_setting` | `edit_all_products_open_campaign_setting.py` | [apis/edit-all-products-open-campaign-setting.md](./apis/edit-all-products-open-campaign-setting.md) |\r\n| 9 | edit_product_list_of_targeted_campaign | POST | `api/v2/ams/edit_product_list_of_targeted_campaign` | `edit_product_list_of_targeted_campaign.py` | [apis/edit-product-list-of-targeted-campaign.md](./apis/edit-product-list-of-targeted-campaign.md) |\r\n| 10 | get_affiliate_performance | GET | `api/v2/ams/get_affiliate_performance` | `get_affiliate_performance.py` | [apis/get-affiliate-performance.md](./apis/get-affiliate-performance.md) |\r\n| 11 | get_auto_add_new_product_toggle_status | GET | `api/v2/ams/get_auto_add_new_product_toggle_status` | `get_auto_add_new_product_toggle_status.py` | [apis/get-auto-add-new-product-toggle-status.md](./apis/get-auto-add-new-product-toggle-status.md) |\r\n| 12 | get_campaign_key_metrics_performance | GET | `api/v2/ams/get_campaign_key_metrics_performance` | `get_campaign_key_metrics_performance.py` | [apis/get-campaign-key-metrics-performance.md](./apis/get-campaign-key-metrics-performance.md) |\r\n| 13 | get_content_performance | GET | `api/v2/ams/get_content_performance` | `get_content_performance.py` | [apis/get-content-performance.md](./apis/get-content-performance.md) |\r\n| 14 | get_conversion_report | GET | `api/v2/ams/get_conversion_report` | `get_conversion_report.py` | [apis/get-conversion-report.md](./apis/get-conversion-report.md) |\r\n| 15 | get_managed_affiliate_list | GET | `api/v2/ams/get_managed_affiliate_list` | `get_managed_affiliate_list.py` | [apis/get-managed-affiliate-list.md](./apis/get-managed-affiliate-list.md) |\r\n| 16 | get_open_campaign_added_product | GET | `api/v2/ams/get_open_campaign_added_product` | `get_open_campaign_added_product.py` | [apis/get-open-campaign-added-product.md](./apis/get-open-campaign-added-product.md) |\r\n| 17 | get_open_campaign_batch_task_result | GET | `api/v2/ams/get_open_campaign_batch_task_result` | `get_open_campaign_batch_task_result.py` | [apis/get-open-campaign-batch-task-result.md](./apis/get-open-campaign-batch-task-result.md) |\r\n| 18 | get_open_campaign_not_added_product | GET | `api/v2/ams/get_open_campaign_not_added_product` | `get_open_campaign_not_added_product.py` | [apis/get-open-campaign-not-added-product.md](./apis/get-open-campaign-not-added-product.md) |\r\n| 19 | get_open_campaign_performance | GET | `api/v2/ams/get_open_campaign_performance` | `get_open_campaign_performance.py` | [apis/get-open-campaign-performance.md](./apis/get-open-campaign-performance.md) |\r\n| 20 | get_optimization_suggestion_product | GET | `api/v2/ams/get_optimization_suggestion_product` | `get_optimization_suggestion_product.py` | [apis/get-optimization-suggestion-product.md](./apis/get-optimization-suggestion-product.md) |\r\n| 21 | get_performance_data_update_time | GET | `api/v2/ams/get_performance_data_update_time` | `get_performance_data_update_time.py` | [apis/get-performance-data-update-time.md](./apis/get-performance-data-update-time.md) |\r\n| 22 | get_product_performance | GET | `api/v2/ams/get_product_performance` | `get_product_performance.py` | [apis/get-product-performance.md](./apis/get-product-performance.md) |\r\n| 23 | get_recommended_affiliate_list | GET | `api/v2/ams/get_recommended_affiliate_list` | `get_recommended_affiliate_list.py` | [apis/get-recommended-affiliate-list.md](./apis/get-recommended-affiliate-list.md) |\r\n| 24 | get_shop_performance | GET | `api/v2/ams/get_shop_performance` | `get_shop_performance.py` | [apis/get-shop-performance.md](./apis/get-shop-performance.md) |\r\n| 25 | get_shop_suggested_rate | GET | `api/v2/ams/get_shop_suggested_rate` | `get_shop_suggested_rate.py` | [apis/get-shop-suggested-rate.md](./apis/get-shop-suggested-rate.md) |\r\n| 26 | get_targeted_campaign_addable_product_list | GET | `api/v2/ams/get_targeted_campaign_addable_product_list` | `get_targeted_campaign_addable_product_list.py` | [apis/get-targeted-campaign-addable-product-list.md](./apis/get-targeted-campaign-addable-product-list.md) |\r\n| 27 | get_targeted_campaign_list | GET | `api/v2/ams/get_targeted_campaign_list` | `get_targeted_campaign_list.py` | [apis/get-targeted-campaign-list.md](./apis/get-targeted-campaign-list.md) |\r\n| 28 | get_targeted_campaign_performance | GET | `api/v2/ams/get_targeted_campaign_performance` | `get_targeted_campaign_performance.py` | [apis/get-targeted-campaign-performance.md](./apis/get-targeted-campaign-performance.md) |\r\n| 29 | get_targeted_campaign_settings | GET | `api/v2/ams/get_targeted_campaign_settings` | `get_targeted_campaign_settings.py` | [apis/get-targeted-campaign-settings.md](./apis/get-targeted-campaign-settings.md) |\r\n| 30 | get_validation_list | GET | `api/v2/ams/get_validation_list` | `get_validation_list.py` | [apis/get-validation-list.md](./apis/get-validation-list.md) |\r\n| 31 | get_validation_report | GET | `api/v2/ams/get_validation_report` | `get_validation_report.py` | [apis/get-validation-report.md](./apis/get-validation-report.md) |\r\n| 32 | query_affiliate_list | GET | `api/v2/ams/query_affiliate_list` | `query_affiliate_list.py` | [apis/query-affiliate-list.md](./apis/query-affiliate-list.md) |\r\n| 33 | remove_all_products_open_campaign_setting | POST | `api/v2/ams/remove_all_products_open_campaign_setting` | `remove_all_products_open_campaign_setting.py` | [apis/remove-all-products-open-campaign-setting.md](./apis/remove-all-products-open-campaign-setting.md) |\r\n| 34 | terminate_targeted_campaign | POST | `api/v2/ams/terminate_targeted_campaign` | `terminate_targeted_campaign.py` | [apis/terminate-targeted-campaign.md](./apis/terminate-targeted-campaign.md) |\r\n| 35 | update_auto_add_new_product_setting | POST | `api/v2/ams/update_auto_add_new_product_setting` | `update_auto_add_new_product_setting.py` | [apis/update-auto-add-new-product-setting.md](./apis/update-auto-add-new-product-setting.md) |\r\n| 36 | update_basic_info_of_targeted_campaign | POST | `api/v2/ams/update_basic_info_of_targeted_campaign` | `update_basic_info_of_targeted_campaign.py` | [apis/update-basic-info-of-targeted-campaign.md](./apis/update-basic-info-of-targeted-campaign.md) |\r\n通用入口：`ams_api.py`（JSON 含 `\"api\": \"<上表 API 名>\"`）。\r\n\r\n---\r\n\r\n## 常用接口说明\r\n\r\n### Open Campaign（开放推广）\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_open_campaign_added_product` | 已加入 Open Campaign 的商品 — [apis/get-open-campaign-added-product.md](./apis/get-open-campaign-added-product.md) |\r\n| `get_open_campaign_not_added_product` | 未加入的商品 — [apis/get-open-campaign-not-added-product.md](./apis/get-open-campaign-not-added-product.md) |\r\n| `batch_add_products_to_open_campaign` | 批量添加商品 — [apis/batch-add-products-to-open-campaign.md](./apis/batch-add-products-to-open-campaign.md) |\r\n| `batch_edit_products_open_campaign_setting` | 批量编辑佣金等设置 — [apis/batch-edit-products-open-campaign-setting.md](./apis/batch-edit-products-open-campaign-setting.md) |\r\n| `get_open_campaign_performance` | Open Campaign 效果数据 — [apis/get-open-campaign-performance.md](./apis/get-open-campaign-performance.md) |\r\n\r\n### Targeted Campaign（定向推广）\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `create_new_targeted_campaign` | 创建定向达人 campaign — [apis/create-new-targeted-campaign.md](./apis/create-new-targeted-campaign.md) |\r\n| `get_targeted_campaign_list` | campaign 列表 — [apis/get-targeted-campaign-list.md](./apis/get-targeted-campaign-list.md) |\r\n| `edit_product_list_of_targeted_campaign` | 编辑 campaign 商品 — [apis/edit-product-list-of-targeted-campaign.md](./apis/edit-product-list-of-targeted-campaign.md) |\r\n| `edit_affiliate_list_of_targeted_campaign` | 编辑 campaign 达人 — [apis/edit-affiliate-list-of-targeted-campaign.md](./apis/edit-affiliate-list-of-targeted-campaign.md) |\r\n| `get_targeted_campaign_performance` | 定向 campaign 效果 — [apis/get-targeted-campaign-performance.md](./apis/get-targeted-campaign-performance.md) |\r\n\r\n### 达人/Affiliate\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_recommended_affiliate_list` | 推荐达人 — [apis/get-recommended-affiliate-list.md](./apis/get-recommended-affiliate-list.md) |\r\n| `get_managed_affiliate_list` | 已管理达人 — [apis/get-managed-affiliate-list.md](./apis/get-managed-affiliate-list.md) |\r\n| `query_affiliate_list` | 查询达人列表 — [apis/query-affiliate-list.md](./apis/query-affiliate-list.md) |\r\n| `get_affiliate_performance` | 达人效果 — [apis/get-affiliate-performance.md](./apis/get-affiliate-performance.md) |\r\n\r\n### 效果报表\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_shop_performance` | 店铺 AMS 效果 — [apis/get-shop-performance.md](./apis/get-shop-performance.md) |\r\n| `get_product_performance` | 商品效果 — [apis/get-product-performance.md](./apis/get-product-performance.md) |\r\n| `get_conversion_report` | 转化报告 — [apis/get-conversion-report.md](./apis/get-conversion-report.md) |\r\n| `get_campaign_key_metrics_performance` | 关键指标 — [apis/get-campaign-key-metrics-performance.md](./apis/get-campaign-key-metrics-performance.md) |\r\n\r\n---\r\n\r\n## 网关错误码\r\n\r\n| errcode | 含义 | 建议 |\r\n|---------|------|------|\r\n| 1002 | 参数/未登录 | 检查 shopId 与 API Key |\r\n| 1003 | 代理/网络异常 | 重试 |\r\n| 1004 | 无授权记录 | auth skill |\r\n| 1005 | path 未白名单 | 确认 `api/v2/ams/...` |\r\n\r\n---\r\n\r\n## curl 示例\r\n\r\n```bash\r\nexport KEY=$LINKFOXAGENT_API_KEY\r\nBASE=https://tool-gateway.linkfox.com\r\n\r\ncurl -X POST $BASE/shopee/developerProxy -H \"Authorization: $KEY\" \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\r\n    \"path\": \"api/v2/ams/get_open_campaign_added_product\",\r\n    \"method\": \"GET\",\r\n    \"accessToken\": \"xxx\",\r\n    \"shopId\": \"67890\"\r\n  }'\r\n```\r\n\r\n---\r\n\r\n## Feedback API\r\n\r\n```bash\r\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\"skillName\":\"linkfox-shopee-store-ams\",\"sentiment\":\"POSITIVE\",\r\n       \"category\":\"OTHER\",\"content\":\"AMS推广商品查询正常\"}'\r\n```\n\nFile v1.0.5:references/apis/add-all-products-to-open-campaign.md\n\n# add_all_products_to_open_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/add_all_products_to_open_campaign.py` |\n| Method / path | POST `api/v2/ams/add_all_products_to_open_campaign` |\n| 官方文档 | [add_all_products_to_open_campaign](https://open.shopee.com/documents/v2/v2.ams.add_all_products_to_open_campaign?module=127&type=1) |\n| 用途 | Add all eligible products to Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Add all eligible products to Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/add_all_products_to_open_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"add_all_products_to_open_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`addAllProductsToOpenCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.5:references/apis/batch-add-products-to-open-campaign.md\n\n# batch_add_products_to_open_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_add_products_to_open_campaign.py` |\n| Method / path | POST `api/v2/ams/batch_add_products_to_open_campaign` |\n| 官方文档 | [batch_add_products_to_open_campaign](https://open.shopee.com/documents/v2/v2.ams.batch_add_products_to_open_campaign?module=127&type=1) |\n| 用途 | Batch add products to Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch add products to Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_add_products_to_open_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_add_products_to_open_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchAddProductsToOpenCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.5:references/apis/batch-edit-products-open-campaign-setting.md\n\n# batch_edit_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_edit_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/batch_edit_products_open_campaign_setting` |\n| 官方文档 | [batch_edit_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.batch_edit_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Batch edit Open Campaign product settings |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch edit Open Campaign product settings\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_edit_products_open_campaign_setting.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_edit_products_open_campaign_setting\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchEditProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.5:references/apis/batch-get-products-suggested-rate.md\n\n# batch_get_products_suggested_rate\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_get_products_suggested_rate.py` |\n| Method / path | POST `api/v2/ams/batch_get_products_suggested_rate` |\n| 官方文档 | [batch_get_products_suggested_rate](https://open.shopee.com/documents/v2/v2.ams.batch_get_products_suggested_rate?module=127&type=1) |\n| 用途 | Batch get suggested commission rates |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch get suggested commission rates\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_get_products_suggested_rate.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_get_products_suggested_rate\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchGetProductsSuggestedRate`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.5:references/apis/batch-remove-products-open-campaign-setting.md\n\n# batch_remove_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_remove_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/batch_remove_products_open_campaign_setting` |\n| 官方文档 | [batch_remove_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.batch_remove_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Batch remove products from Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch remove products from Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_remove_products_open_campaign_setting.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_remove_products_open_campaign_setting\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchRemoveProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.5:references/apis/create-new-targeted-campaign.md\n\n# create_new_targeted_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/create_new_targeted_campaign.py` |\n| Method / path | POST `api/v2/ams/create_new_targeted_campaign` |\n| 官方文档 | [create_new_targeted_campaign](https://open.shopee.com/documents/v2/v2.ams.create_new_targeted_campaign?module=127&type=1) |\n| 用途 | Create targeted affiliate campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Create targeted affiliate campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/create_new_targeted_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"create_new_targeted_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`createNewTargetedCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.5:references/apis/edit-affiliate-list-of-targeted-campaign.md\n\n# edit_affiliate_list_of_targeted_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/edit_affiliate_list_of_targeted_campaign.py` |\n| Method / path | POST `api/v2/ams/edit_affiliate_list_of_targeted_campaign` |\n| 官方文档 | [edit_affiliate_list_of_targeted_campaign](https://open.shopee.com/documents/v2/v2.ams.edit_affiliate_list_of_targeted_campaign?module=127&type=1) |\n| 用途 | Edit affiliates in targeted campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Edit affiliates in targeted campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/edit_affiliate_list_of_targeted_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"edit_affiliate_list_of_targeted_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`editAffiliateListOfTargetedCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.5:references/apis/edit-all-products-open-campaign-setting.md\n\n# edit_all_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/edit_all_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/edit_all_products_open_campaign_setting` |\n| 官方文档 | [edit_all_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.edit_all_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Edit all products Open Campaign settings |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Edit all products Open Campaign settings\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/edit_all_products_open_campaign_setting.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"edit_all_products_open_campaign_setting\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`editAllProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.5:references/apis/edit-product-list-of-targeted-campaign.md\n\n# edit_product_list_of_targeted_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/edit_product_list_of_targeted_campaign.py` |\n| Method / path | POST `api/v2/ams/edit_product_list_of_targeted_campaign` |\n| 官方文档 | [edit_product_list_of_targeted_campaign](https://open.shopee.com/documents/v2/v2.ams.edit_product_list_of_targeted_campaign?module=127&type=1) |\n| 用途 | Edit products in targeted campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Edit products in targeted campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/edit_product_list_of_targeted_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"edit_product_list_of_targeted_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`editProductListOfTargetedCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nArchive v1.0.4: 83 files, 88973 bytes\n\nFiles: references/api.md (13168b), references/apis/add-all-products-to-open-campaign.md (1527b), references/apis/batch-add-products-to-open-campaign.md (1529b), references/apis/batch-edit-products-open-campaign-setting.md (1589b), references/apis/batch-get-products-suggested-rate.md (1516b), references/apis/batch-remove-products-open-campaign-setting.md (1603b), references/apis/create-new-targeted-campaign.md (1473b), references/apis/edit-affiliate-list-of-targeted-campaign.md (1571b), references/apis/edit-all-products-open-campaign-setting.md (1571b), references/apis/edit-product-list-of-targeted-campaign.md (1551b), references/apis/get-affiliate-performance.md (1430b), references/apis/get-auto-add-new-product-toggle-status.md (1556b), references/apis/get-campaign-key-metrics-performance.md (1514b), references/apis/get-content-performance.md (1410b), references/apis/get-conversion-report.md (1390b), references/apis/get-managed-affiliate-list.md (1431b), references/apis/get-open-campaign-added-product.md (1484b), references/apis/get-open-campaign-batch-task-result.md (1543b), references/apis/get-open-campaign-not-added-product.md (1531b), references/apis/get-open-campaign-performance.md (1469b), references/apis/get-optimization-suggestion-product.md (1531b), references/apis/get-performance-data-update-time.md (1508b), references/apis/get-product-performance.md (1418b), references/apis/get-recommended-affiliate-list.md (1471b), references/apis/get-shop-performance.md (1388b), references/apis/get-shop-suggested-rate.md (1431b), references/apis/get-targeted-campaign-addable-product-list.md (1595b), references/apis/get-targeted-campaign-list.md (1439b), references/apis/get-targeted-campaign-performance.md (1509b), references/apis/get-targeted-campaign-settings.md (1493b), references/apis/get-validation-list.md (1370b), references/apis/get-validation-report.md (1390b), references/apis/query-affiliate-list.md (1414b), references/apis/remove-all-products-open-campaign-setting.md (1583b), references/apis/terminate-targeted-campaign.md (1452b), references/apis/update-auto-add-new-product-setting.md (1529b), references/apis/update-basic-info-of-targeted-campaign.md (1553b), references/onboarding.md (2046b), scripts/_ams_api_runner.py (4260b), scripts/_ams_endpoints.py (9504b), scripts/_shopee_ams_common.py (11919b), scripts/add_all_products_to_open_campaign.py (770b), scripts/ams_api.py (1008b), scripts/batch_add_products_to_open_campaign.py (782b), scripts/batch_edit_products_open_campaign_setting.py (818b), scripts/batch_get_products_suggested_rate.py (770b), scripts/batch_remove_products_open_campaign_setting.py (830b), scripts/check_auth_dependency.py (3975b), scripts/create_new_targeted_campaign.py (740b), scripts/edit_affiliate_list_of_targeted_campaign.py (812b), scripts/edit_all_products_open_campaign_setting.py (806b), scripts/edit_product_list_of_targeted_campaign.py (800b), scripts/get_affiliate_performance.py (722b), scripts/get_auto_add_new_product_toggle_status.py (800b), scripts/get_campaign_key_metrics_performance.py (788b), scripts/get_content_performance.py (710b), scripts/get_conversion_report.py (698b), scripts/get_managed_affiliate_list.py (728b), scripts/get_open_campaign_added_product.py (758b), scripts/get_open_campaign_batch_task_result.py (782b), scripts/get_open_campaign_not_added_product.py (782b), scripts/get_open_campaign_performance.py (746b), scripts/get_optimization_suggestion_product.py (782b), scripts/get_performance_data_update_time.py (764b), scripts/get_product_performance.py (710b), scripts/get_recommended_affiliate_list.py (752b), scripts/get_shop_performance.py (692b), scripts/get_shop_suggested_rate.py (710b), scripts/get_targeted_campaign_addable_product_list.py (824b), scripts/get_targeted_campaign_list.py (728b), scripts/get_targeted_campaign_performance.py (770b), scripts/get_targeted_campaign_settings.py (752b), scripts/get_validation_list.py (686b), scripts/get_validation_report.py (698b), scripts/onboarding.py (24089b), scripts/query_affiliate_list.py (692b), scripts/remove_all_products_open_campaign_setting.py (818b), scripts/terminate_targeted_campaign.py (734b), scripts/update_auto_add_new_product_setting.py (782b), scripts/update_basic_info_of_targeted_campaign.py (800b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: linkfox-shopee-store-ams\ndescription: Shopee（虾皮）联盟营销 AMS Affiliate Marketing Solutions（与 linkfox-shopee-store-auth 同系列），经 /shopee/developerProxy 转发 Shopee Open API AMS 模块全部 36 个接口：get_open_campaign_added_product、batch_add_products_to_open_campaign、create_new_targeted_campaign、get_affiliate_performance、get_shop_performance 等。当用户提到 Shopee 联盟营销、AMS、达人带货、affiliate、Open Campaign、Targeted Campaign、佣金率、达人推广、get_open_campaign_added_product 时触发。即使未明确提及\"联盟\"，只要涉及已授权 Shopee 店铺的联盟推广或达人 campaign 管理，也应触发。\n---\n\n# Shopee 联盟营销 AMS\n\nShopee Open Platform **AMS（Affiliate Marketing Solutions）模块**（36 个 API）。**依赖 `linkfox-shopee-store-auth`** 选店；经 **`POST /shopee/developerProxy`** 传入 `shopId`（或 `merchantId`），由服务端解析 token 转发（`path` 须 `api/v2/ams/...`）。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-shopee-store-ams-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 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\nAMS 模块索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\n\n---\n\n## Prerequisites（必须先读）\n\n1. 运行 `python scripts/check_auth_dependency.py`；exit code **42** → 先安装 **`linkfox-shopee-store-auth`** 并授权店铺。\n2. **不要**在本 skill 内实现授权/令牌逻辑。\n3. **AMS vs Ads**：本 skill 为联盟营销/达人带货；站内 CPC 广告见 `linkfox-shopee-store-ads`（module=117）。\n\n---\n\n## Core Concepts\n\n- **转发链路**：`developerProxy`（`shopId`/`merchantId` 选店，服务端注入 token）→ 紫鸟 `shopee-proxy` → Shopee API\n- **Open Campaign**：开放推广，所有达人可推广 → `get_open_campaign_added_product`、`batch_add_products_to_open_campaign`\n- **Targeted Campaign**：定向推广，指定达人 → `create_new_targeted_campaign`、`edit_affiliate_list_of_targeted_campaign`\n- **效果**：`get_shop_performance`、`get_product_performance`、`get_affiliate_performance`\n- **佣金**：`get_shop_suggested_rate`、`batch_get_products_suggested_rate`\n\n## 可用脚本（AMS 模块 36 个 API）\n\n| 分组 | 脚本 |\n|------|------|\n| Open Campaign | `get_open_campaign_added_product.py`、`batch_add_products_to_open_campaign.py`、`get_open_campaign_performance.py` 等 |\n| Targeted Campaign | `create_new_targeted_campaign.py`、`get_targeted_campaign_list.py`、`terminate_targeted_campaign.py` 等 |\n| 达人/Affiliate | `get_recommended_affiliate_list.py`、`query_affiliate_list.py`、`get_affiliate_performance.py` |\n| 效果报表 | `get_shop_performance.py`、`get_product_performance.py`、`get_conversion_report.py` |\n| 通用入口 | `ams_api.py`（JSON 含 `api` 字段） |\n\n完整列表见 `references/api.md`。共享：`_shopee_ams_common.py`、`_ams_endpoints.py`、`_ams_api_runner.py`。\n\n## 接口说明（按 API）\n\n入参与响应细节放在 `references/apis/`，SKILL 只保留索引。\n\n| API | 说明文档 |\n|-----|----------|\n| `add_all_products_to_open_campaign` | [references/apis/add-all-products-to-open-campaign.md](./references/apis/add-all-products-to-open-campaign.md) |\n| `batch_add_products_to_open_campaign` | [references/apis/batch-add-products-to-open-campaign.md](./references/apis/batch-add-products-to-open-campaign.md) |\n| `batch_edit_products_open_campaign_setting` | [references/apis/batch-edit-products-open-campaign-setting.md](./references/apis/batch-edit-products-open-campaign-setting.md) |\n| `batch_get_products_suggested_rate` | [references/apis/batch-get-products-suggested-rate.md](./references/apis/batch-get-products-suggested-rate.md) |\n| `batch_remove_products_open_campaign_setting` | [references/apis/batch-remove-products-open-campaign-setting.md](./references/apis/batch-remove-products-open-campaign-setting.md) |\n| `create_new_targeted_campaign` | [references/apis/create-new-targeted-campaign.md](./references/apis/create-new-targeted-campaign.md) |\n| `edit_affiliate_list_of_targeted_campaign` | [references/apis/edit-affiliate-list-of-targeted-campaign.md](./references/apis/edit-affiliate-list-of-targeted-campaign.md) |\n| `edit_all_products_open_campaign_setting` | [references/apis/edit-all-products-open-campaign-setting.md](./references/apis/edit-all-products-open-campaign-setting.md) |\n| `edit_product_list_of_targeted_campaign` | [references/apis/edit-product-list-of-targeted-campaign.md](./references/apis/edit-product-list-of-targeted-campaign.md) |\n| `get_affiliate_performance` | [references/apis/get-affiliate-performance.md](./references/apis/get-affiliate-performance.md) |\n| `get_auto_add_new_product_toggle_status` | [references/apis/get-auto-add-new-product-toggle-status.md](./references/apis/get-auto-add-new-product-toggle-status.md) |\n| `get_campaign_key_metrics_performance` | [references/apis/get-campaign-key-metrics-performance.md](./references/apis/get-campaign-key-metrics-performance.md) |\n| `get_content_performance` | [references/apis/get-content-performance.md](./references/apis/get-content-performance.md) |\n| `get_conversion_report` | [references/apis/get-conversion-report.md](./references/apis/get-conversion-report.md) |\n| `get_managed_affiliate_list` | [references/apis/get-managed-affiliate-list.md](./references/apis/get-managed-affiliate-list.md) |\n| `get_open_campaign_added_product` | [references/apis/get-open-campaign-added-product.md](./references/apis/get-open-campaign-added-product.md) |\n| `get_open_campaign_batch_task_result` | [references/apis/get-open-campaign-batch-task-result.md](./references/apis/get-open-campaign-batch-task-result.md) |\n| `get_open_campaign_not_added_product` | [references/apis/get-open-campaign-not-added-product.md](./references/apis/get-open-campaign-not-added-product.md) |\n| `get_open_campaign_performance` | [references/apis/get-open-campaign-performance.md](./references/apis/get-open-campaign-performance.md) |\n| `get_optimization_suggestion_product` | [references/apis/get-optimization-suggestion-product.md](./references/apis/get-optimization-suggestion-product.md) |\n| `get_performance_data_update_time` | [references/apis/get-performance-data-update-time.md](./references/apis/get-performance-data-update-time.md) |\n| `get_product_performance` | [references/apis/get-product-performance.md](./references/apis/get-product-performance.md) |\n| `get_recommended_affiliate_list` | [references/apis/get-recommended-affiliate-list.md](./references/apis/get-recommended-affiliate-list.md) |\n| `get_shop_performance` | [references/apis/get-shop-performance.md](./references/apis/get-shop-performance.md) |\n| `get_shop_suggested_rate` | [references/apis/get-shop-suggested-rate.md](./references/apis/get-shop-suggested-rate.md) |\n| `get_targeted_campaign_addable_product_list` | [references/apis/get-targeted-campaign-addable-product-list.md](./references/apis/get-targeted-campaign-addable-product-list.md) |\n| `get_targeted_campaign_list` | [references/apis/get-targeted-campaign-list.md](./references/apis/get-targeted-campaign-list.md) |\n| `get_targeted_campaign_performance` | [references/apis/get-targeted-campaign-performance.md](./references/apis/get-targeted-campaign-performance.md) |\n| `get_targeted_campaign_settings` | [references/apis/get-targeted-campaign-settings.md](./references/apis/get-targeted-campaign-settings.md) |\n| `get_validation_list` | [references/apis/get-validation-list.md](./references/apis/get-validation-list.md) |\n| `get_validation_report` | [references/apis/get-validation-report.md](./references/apis/get-validation-report.md) |\n| `query_affiliate_list` | [references/apis/query-affiliate-list.md](./references/apis/query-affiliate-list.md) |\n| `remove_all_products_open_campaign_setting` | [references/apis/remove-all-products-open-campaign-setting.md](./references/apis/remove-all-products-open-campaign-setting.md) |\n| `terminate_targeted_campaign` | [references/apis/terminate-targeted-campaign.md](./references/apis/terminate-targeted-campaign.md) |\n| `update_auto_add_new_product_setting` | [references/apis/update-auto-add-new-product-setting.md](./references/apis/update-auto-add-new-product-setting.md) |\n| `update_basic_info_of_targeted_campaign` | [references/apis/update-basic-info-of-targeted-campaign.md](./references/apis/update-basic-info-of-targeted-campaign.md) |\n\n模块总览 / Feedback 见 [references/api.md](./references/api.md)。\n\n## Usage Scenarios\n\n### 1. 管理 Open Campaign 商品\n1. `get_open_campaign_added_product.py` 查已加入商品\n2. `get_open_campaign_not_added_product.py` 查可加入商品\n3. `batch_add_products_to_open_campaign.py` 批量添加\n\n### 2. 创建定向达人 Campaign\n1. `get_recommended_affiliate_list.py` 选达人\n2. `create_new_targeted_campaign.py` 传完整 `body`\n3. `get_targeted_campaign_performance.py` 查效果\n\n## 调用原则\n\n- 先看 **`developerProxy.httpStatus`**，再读 `*Response` 字段\n- GET：业务参数放 JSON 顶层\n- POST：复杂接口传 `body`\n- 每个脚本 docstring 含 **官方文档 URL**（`module=127`）\n\n## Not Applicable\n\n- 店铺授权 → `linkfox-shopee-store-auth`\n- 站内 CPC 广告 → `linkfox-shopee-store-ads`\n- 商品 listing → `linkfox-shopee-store-product`\n- 店铺视频 → `linkfox-shopee-store-video`\n- 订单 → `linkfox-shopee-store-orders`\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---\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-ams\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1786100357159\n}\n\nFile v1.0.4:references/api.md\n\n# linkfox-shopee-store-ams — 参数与字段参考\r\n\r\n> 单接口入参/响应说明已拆到 **`apis/`**（按 API 一份）；本文件保留模块总览与 Feedback。\r\nShopee **AMS（Affiliate Marketing Solutions）模块**全部 36 个 API，经 **`POST /shopee/developerProxy`** 转发。\r\n\r\n授权见 **`linkfox-shopee-store-auth`**。官方索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\r\n\r\n## 通用约定\r\n\r\n- **Base URL**：`https://tool-gateway.linkfox.com`\r\n- **Method**：POST（网关），上游 Method 见各接口\r\n- **Auth**：Header `Authorization: <api_key>`（`LINKFOXAGENT_API_KEY`）\r\n- **流程**：`POST /shopee/storeTokens` → `POST /shopee/developerProxy`\r\n- **path**：须 `api/v2/ams/...`\r\n- **标识**：店铺级 API，通常传 **`shopId`**\r\n- **与 Ads 区别**：AMS 为联盟营销/达人带货；Ads（module=117）为站内 CPC 广告\r\n- **官方文档 URL 规则**：`https://open.shopee.com/documents/v2/v2.ams.{api}?module=127&type=1`\r\n\r\n---\r\n\r\n## AMS 模块总览\r\n\r\n| # | API | Method | path | 脚本 | 官方文档 |\r\n|---|-----|--------|------|------|----------|\r\n| 1 | add_all_products_to_open_campaign | POST | `api/v2/ams/add_all_products_to_open_campaign` | `add_all_products_to_open_campaign.py` | [apis/add-all-products-to-open-campaign.md](./apis/add-all-products-to-open-campaign.md) |\r\n| 2 | batch_add_products_to_open_campaign | POST | `api/v2/ams/batch_add_products_to_open_campaign` | `batch_add_products_to_open_campaign.py` | [apis/batch-add-products-to-open-campaign.md](./apis/batch-add-products-to-open-campaign.md) |\r\n| 3 | batch_edit_products_open_campaign_setting | POST | `api/v2/ams/batch_edit_products_open_campaign_setting` | `batch_edit_products_open_campaign_setting.py` | [apis/batch-edit-products-open-campaign-setting.md](./apis/batch-edit-products-open-campaign-setting.md) |\r\n| 4 | batch_get_products_suggested_rate | POST | `api/v2/ams/batch_get_products_suggested_rate` | `batch_get_products_suggested_rate.py` | [apis/batch-get-products-suggested-rate.md](./apis/batch-get-products-suggested-rate.md) |\r\n| 5 | batch_remove_products_open_campaign_setting | POST | `api/v2/ams/batch_remove_products_open_campaign_setting` | `batch_remove_products_open_campaign_setting.py` | [apis/batch-remove-products-open-campaign-setting.md](./apis/batch-remove-products-open-campaign-setting.md) |\r\n| 6 | create_new_targeted_campaign | POST | `api/v2/ams/create_new_targeted_campaign` | `create_new_targeted_campaign.py` | [apis/create-new-targeted-campaign.md](./apis/create-new-targeted-campaign.md) |\r\n| 7 | edit_affiliate_list_of_targeted_campaign | POST | `api/v2/ams/edit_affiliate_list_of_targeted_campaign` | `edit_affiliate_list_of_targeted_campaign.py` | [apis/edit-affiliate-list-of-targeted-campaign.md](./apis/edit-affiliate-list-of-targeted-campaign.md) |\r\n| 8 | edit_all_products_open_campaign_setting | POST | `api/v2/ams/edit_all_products_open_campaign_setting` | `edit_all_products_open_campaign_setting.py` | [apis/edit-all-products-open-campaign-setting.md](./apis/edit-all-products-open-campaign-setting.md) |\r\n| 9 | edit_product_list_of_targeted_campaign | POST | `api/v2/ams/edit_product_list_of_targeted_campaign` | `edit_product_list_of_targeted_campaign.py` | [apis/edit-product-list-of-targeted-campaign.md](./apis/edit-product-list-of-targeted-campaign.md) |\r\n| 10 | get_affiliate_performance | GET | `api/v2/ams/get_affiliate_performance` | `get_affiliate_performance.py` | [apis/get-affiliate-performance.md](./apis/get-affiliate-performance.md) |\r\n| 11 | get_auto_add_new_product_toggle_status | GET | `api/v2/ams/get_auto_add_new_product_toggle_status` | `get_auto_add_new_product_toggle_status.py` | [apis/get-auto-add-new-product-toggle-status.md](./apis/get-auto-add-new-product-toggle-status.md) |\r\n| 12 | get_campaign_key_metrics_performance | GET | `api/v2/ams/get_campaign_key_metrics_performance` | `get_campaign_key_metrics_performance.py` | [apis/get-campaign-key-metrics-performance.md](./apis/get-campaign-key-metrics-performance.md) |\r\n| 13 | get_content_performance | GET | `api/v2/ams/get_content_performance` | `get_content_performance.py` | [apis/get-content-performance.md](./apis/get-content-performance.md) |\r\n| 14 | get_conversion_report | GET | `api/v2/ams/get_conversion_report` | `get_conversion_report.py` | [apis/get-conversion-report.md](./apis/get-conversion-report.md) |\r\n| 15 | get_managed_affiliate_list | GET | `api/v2/ams/get_managed_affiliate_list` | `get_managed_affiliate_list.py` | [apis/get-managed-affiliate-list.md](./apis/get-managed-affiliate-list.md) |\r\n| 16 | get_open_campaign_added_product | GET | `api/v2/ams/get_open_campaign_added_product` | `get_open_campaign_added_product.py` | [apis/get-open-campaign-added-product.md](./apis/get-open-campaign-added-product.md) |\r\n| 17 | get_open_campaign_batch_task_result | GET | `api/v2/ams/get_open_campaign_batch_task_result` | `get_open_campaign_batch_task_result.py` | [apis/get-open-campaign-batch-task-result.md](./apis/get-open-campaign-batch-task-result.md) |\r\n| 18 | get_open_campaign_not_added_product | GET | `api/v2/ams/get_open_campaign_not_added_product` | `get_open_campaign_not_added_product.py` | [apis/get-open-campaign-not-added-product.md](./apis/get-open-campaign-not-added-product.md) |\r\n| 19 | get_open_campaign_performance | GET | `api/v2/ams/get_open_campaign_performance` | `get_open_campaign_performance.py` | [apis/get-open-campaign-performance.md](./apis/get-open-campaign-performance.md) |\r\n| 20 | get_optimization_suggestion_product | GET | `api/v2/ams/get_optimization_suggestion_product` | `get_optimization_suggestion_product.py` | [apis/get-optimization-suggestion-product.md](./apis/get-optimization-suggestion-product.md) |\r\n| 21 | get_performance_data_update_time | GET | `api/v2/ams/get_performance_data_update_time` | `get_performance_data_update_time.py` | [apis/get-performance-data-update-time.md](./apis/get-performance-data-update-time.md) |\r\n| 22 | get_product_performance | GET | `api/v2/ams/get_product_performance` | `get_product_performance.py` | [apis/get-product-performance.md](./apis/get-product-performance.md) |\r\n| 23 | get_recommended_affiliate_list | GET | `api/v2/ams/get_recommended_affiliate_list` | `get_recommended_affiliate_list.py` | [apis/get-recommended-affiliate-list.md](./apis/get-recommended-affiliate-list.md) |\r\n| 24 | get_shop_performance | GET | `api/v2/ams/get_shop_performance` | `get_shop_performance.py` | [apis/get-shop-performance.md](./apis/get-shop-performance.md) |\r\n| 25 | get_shop_suggested_rate | GET | `api/v2/ams/get_shop_suggested_rate` | `get_shop_suggested_rate.py` | [apis/get-shop-suggested-rate.md](./apis/get-shop-suggested-rate.md) |\r\n| 26 | get_targeted_campaign_addable_product_list | GET | `api/v2/ams/get_targeted_campaign_addable_product_list` | `get_targeted_campaign_addable_product_list.py` | [apis/get-targeted-campaign-addable-product-list.md](./apis/get-targeted-campaign-addable-product-list.md) |\r\n| 27 | get_targeted_campaign_list | GET | `api/v2/ams/get_targeted_campaign_list` | `get_targeted_campaign_list.py` | [apis/get-targeted-campaign-list.md](./apis/get-targeted-campaign-list.md) |\r\n| 28 | get_targeted_campaign_performance | GET | `api/v2/ams/get_targeted_campaign_performance` | `get_targeted_campaign_performance.py` | [apis/get-targeted-campaign-performance.md](./apis/get-targeted-campaign-performance.md) |\r\n| 29 | get_targeted_campaign_settings | GET | `api/v2/ams/get_targeted_campaign_settings` | `get_targeted_campaign_settings.py` | [apis/get-targeted-campaign-settings.md](./apis/get-targeted-campaign-settings.md) |\r\n| 30 | get_validation_list | GET | `api/v2/ams/get_validation_list` | `get_validation_list.py` | [apis/get-validation-list.md](./apis/get-validation-list.md) |\r\n| 31 | get_validation_report | GET | `api/v2/ams/get_validation_report` | `get_validation_report.py` | [apis/get-validation-report.md](./apis/get-validation-report.md) |\r\n| 32 | query_affiliate_list | GET | `api/v2/ams/query_affiliate_list` | `query_affiliate_list.py` | [apis/query-affiliate-list.md](./apis/query-affiliate-list.md) |\r\n| 33 | remove_all_products_open_campaign_setting | POST | `api/v2/ams/remove_all_products_open_campaign_setting` | `remove_all_products_open_campaign_setting.py` | [apis/remove-all-products-open-campaign-setting.md](./apis/remove-all-products-open-campaign-setting.md) |\r\n| 34 | terminate_targeted_campaign | POST | `api/v2/ams/terminate_targeted_campaign` | `terminate_targeted_campaign.py` | [apis/terminate-targeted-campaign.md](./apis/terminate-targeted-campaign.md) |\r\n| 35 | update_auto_add_new_product_setting | POST | `api/v2/ams/update_auto_add_new_product_setting` | `update_auto_add_new_product_setting.py` | [apis/update-auto-add-new-product-setting.md](./apis/update-auto-add-new-product-setting.md) |\r\n| 36 | update_basic_info_of_targeted_campaign | POST | `api/v2/ams/update_basic_info_of_targeted_campaign` | `update_basic_info_of_targeted_campaign.py` | [apis/update-basic-info-of-targeted-campaign.md](./apis/update-basic-info-of-targeted-campaign.md) |\r\n通用入口：`ams_api.py`（JSON 含 `\"api\": \"<上表 API 名>\"`）。\r\n\r\n---\r\n\r\n## 常用接口说明\r\n\r\n### Open Campaign（开放推广）\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_open_campaign_added_product` | 已加入 Open Campaign 的商品 — [apis/get-open-campaign-added-product.md](./apis/get-open-campaign-added-product.md) |\r\n| `get_open_campaign_not_added_product` | 未加入的商品 — [apis/get-open-campaign-not-added-product.md](./apis/get-open-campaign-not-added-product.md) |\r\n| `batch_add_products_to_open_campaign` | 批量添加商品 — [apis/batch-add-products-to-open-campaign.md](./apis/batch-add-products-to-open-campaign.md) |\r\n| `batch_edit_products_open_campaign_setting` | 批量编辑佣金等设置 — [apis/batch-edit-products-open-campaign-setting.md](./apis/batch-edit-products-open-campaign-setting.md) |\r\n| `get_open_campaign_performance` | Open Campaign 效果数据 — [apis/get-open-campaign-performance.md](./apis/get-open-campaign-performance.md) |\r\n\r\n### Targeted Campaign（定向推广）\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `create_new_targeted_campaign` | 创建定向达人 campaign — [apis/create-new-targeted-campaign.md](./apis/create-new-targeted-campaign.md) |\r\n| `get_targeted_campaign_list` | campaign 列表 — [apis/get-targeted-campaign-list.md](./apis/get-targeted-campaign-list.md) |\r\n| `edit_product_list_of_targeted_campaign` | 编辑 campaign 商品 — [apis/edit-product-list-of-targeted-campaign.md](./apis/edit-product-list-of-targeted-campaign.md) |\r\n| `edit_affiliate_list_of_targeted_campaign` | 编辑 campaign 达人 — [apis/edit-affiliate-list-of-targeted-campaign.md](./apis/edit-affiliate-list-of-targeted-campaign.md) |\r\n| `get_targeted_campaign_performance` | 定向 campaign 效果 — [apis/get-targeted-campaign-performance.md](./apis/get-targeted-campaign-performance.md) |\r\n\r\n### 达人/Affiliate\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_recommended_affiliate_list` | 推荐达人 — [apis/get-recommended-affiliate-list.md](./apis/get-recommended-affiliate-list.md) |\r\n| `get_managed_affiliate_list` | 已管理达人 — [apis/get-managed-affiliate-list.md](./apis/get-managed-affiliate-list.md) |\r\n| `query_affiliate_list` | 查询达人列表 — [apis/query-affiliate-list.md](./apis/query-affiliate-list.md) |\r\n| `get_affiliate_performance` | 达人效果 — [apis/get-affiliate-performance.md](./apis/get-affiliate-performance.md) |\r\n\r\n### 效果报表\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_shop_performance` | 店铺 AMS 效果 — [apis/get-shop-performance.md](./apis/get-shop-performance.md) |\r\n| `get_product_performance` | 商品效果 — [apis/get-product-performance.md](./apis/get-product-performance.md) |\r\n| `get_conversion_report` | 转化报告 — [apis/get-conversion-report.md](./apis/get-conversion-report.md) |\r\n| `get_campaign_key_metrics_performance` | 关键指标 — [apis/get-campaign-key-metrics-performance.md](./apis/get-campaign-key-metrics-performance.md) |\r\n\r\n---\r\n\r\n## 网关错误码\r\n\r\n| errcode | 含义 | 建议 |\r\n|---------|------|------|\r\n| 1002 | 参数/未登录 | 检查 shopId 与 API Key |\r\n| 1003 | 代理/网络异常 | 重试 |\r\n| 1004 | 无授权记录 | auth skill |\r\n| 1005 | path 未白名单 | 确认 `api/v2/ams/...` |\r\n\r\n---\r\n\r\n## curl 示例\r\n\r\n```bash\r\nexport KEY=$LINKFOXAGENT_API_KEY\r\nBASE=https://tool-gateway.linkfox.com\r\n\r\ncurl -X POST $BASE/shopee/developerProxy -H \"Authorization: $KEY\" \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\r\n    \"path\": \"api/v2/ams/get_open_campaign_added_product\",\r\n    \"method\": \"GET\",\r\n    \"accessToken\": \"xxx\",\r\n    \"shopId\": \"67890\"\r\n  }'\r\n```\r\n\r\n---\r\n\r\n## Feedback API\r\n\r\n```bash\r\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\"skillName\":\"linkfox-shopee-store-ams\",\"sentiment\":\"POSITIVE\",\r\n       \"category\":\"OTHER\",\"content\":\"AMS推广商品查询正常\"}'\r\n```\n\nFile v1.0.4:references/apis/add-all-products-to-open-campaign.md\n\n# add_all_products_to_open_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/add_all_products_to_open_campaign.py` |\n| Method / path | POST `api/v2/ams/add_all_products_to_open_campaign` |\n| 官方文档 | [add_all_products_to_open_campaign](https://open.shopee.com/documents/v2/v2.ams.add_all_products_to_open_campaign?module=127&type=1) |\n| 用途 | Add all eligible products to Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Add all eligible products to Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/add_all_products_to_open_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"add_all_products_to_open_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`addAllProductsToOpenCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.4:references/apis/batch-add-products-to-open-campaign.md\n\n# batch_add_products_to_open_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_add_products_to_open_campaign.py` |\n| Method / path | POST `api/v2/ams/batch_add_products_to_open_campaign` |\n| 官方文档 | [batch_add_products_to_open_campaign](https://open.shopee.com/documents/v2/v2.ams.batch_add_products_to_open_campaign?module=127&type=1) |\n| 用途 | Batch add products to Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch add products to Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_add_products_to_open_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_add_products_to_open_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchAddProductsToOpenCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.4:references/apis/batch-edit-products-open-campaign-setting.md\n\n# batch_edit_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_edit_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/batch_edit_products_open_campaign_setting` |\n| 官方文档 | [batch_edit_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.batch_edit_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Batch edit Open Campaign product settings |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch edit Open Campaign product settings\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_edit_products_open_campaign_setting.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_edit_products_open_campaign_setting\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchEditProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.4:references/apis/batch-get-products-suggested-rate.md\n\n# batch_get_products_suggested_rate\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_get_products_suggested_rate.py` |\n| Method / path | POST `api/v2/ams/batch_get_products_suggested_rate` |\n| 官方文档 | [batch_get_products_suggested_rate](https://open.shopee.com/documents/v2/v2.ams.batch_get_products_suggested_rate?module=127&type=1) |\n| 用途 | Batch get suggested commission rates |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch get suggested commission rates\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_get_products_suggested_rate.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_get_products_suggested_rate\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchGetProductsSuggestedRate`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.4:references/apis/batch-remove-products-open-campaign-setting.md\n\n# batch_remove_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_remove_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/batch_remove_products_open_campaign_setting` |\n| 官方文档 | [batch_remove_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.batch_remove_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Batch remove products from Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch remove products from Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_remove_products_open_campaign_setting.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_remove_products_open_campaign_setting\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchRemoveProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.4:references/apis/create-new-targeted-campaign.md\n\n# create_new_targeted_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/create_new_targeted_campaign.py` |\n| Method / path | POST `api/v2/ams/create_new_targeted_campaign` |\n| 官方文档 | [create_new_targeted_campaign](https://open.shopee.com/documents/v2/v2.ams.create_new_targeted_campaign?module=127&type=1) |\n| 用途 | Create targeted affiliate campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Create targeted affiliate campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/create_new_targeted_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"create_new_targeted_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`createNewTargetedCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.4:references/apis/edit-affiliate-list-of-targeted-campaign.md\n\n# edit_affiliate_list_of_targeted_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/edit_affiliate_list_of_targeted_campaign.py` |\n| Method / path | POST `api/v2/ams/edit_affiliate_list_of_targeted_campaign` |\n| 官方文档 | [edit_affiliate_list_of_targeted_campaign](https://open.shopee.com/documents/v2/v2.ams.edit_affiliate_list_of_targeted_campaign?module=127&type=1) |\n| 用途 | Edit affiliates in targeted campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Edit affiliates in targeted campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/edit_affiliate_list_of_targeted_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"edit_affiliate_list_of_targeted_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`editAffiliateListOfTargetedCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.4:references/apis/edit-all-products-open-campaign-setting.md\n\n# edit_all_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/edit_all_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/edit_all_products_open_campaign_setting` |\n| 官方文档 | [edit_all_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.edit_all_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Edit all products Open Campaign settings |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Edit all products Open Campaign settings\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/edit_all_products_open_campaign_setting.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"edit_all_products_open_campaign_setting\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`editAllProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.4:references/apis/edit-product-list-of-targeted-campaign.md\n\n# edit_product_list_of_targeted_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/edit_product_list_of_targeted_campaign.py` |\n| Method / path | POST `api/v2/ams/edit_product_list_of_targeted_campaign` |\n| 官方文档 | [edit_product_list_of_targeted_campaign](https://open.shopee.com/documents/v2/v2.ams.edit_product_list_of_targeted_campaign?module=127&type=1) |\n| 用途 | Edit products in targeted campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Edit products in targeted campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/edit_product_list_of_targeted_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"edit_product_list_of_targeted_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`editProductListOfTargetedCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nArchive v1.0.3: 45 files, 38910 bytes\n\nFiles: references/api.md (12148b), scripts/_ams_api_runner.py (4247b), scripts/_ams_endpoints.py (9504b), scripts/_shopee_ams_common.py (11727b), scripts/add_all_products_to_open_campaign.py (799b), scripts/ams_api.py (1008b), scripts/batch_add_products_to_open_campaign.py (811b), scripts/batch_edit_products_open_campaign_setting.py (847b), scripts/batch_get_products_suggested_rate.py (799b), scripts/batch_remove_products_open_campaign_setting.py (859b), scripts/check_auth_dependency.py (3975b), scripts/create_new_targeted_campaign.py (769b), scripts/edit_affiliate_list_of_targeted_campaign.py (841b), scripts/edit_all_products_open_campaign_setting.py (835b), scripts/edit_product_list_of_targeted_campaign.py (829b), scripts/get_affiliate_performance.py (751b), scripts/get_auto_add_new_product_toggle_status.py (829b), scripts/get_campaign_key_metrics_performance.py (817b), scripts/get_content_performance.py (739b), scripts/get_conversion_report.py (727b), scripts/get_managed_affiliate_list.py (757b), scripts/get_open_campaign_added_product.py (787b), scripts/get_open_campaign_batch_task_result.py (811b), scripts/get_open_campaign_not_added_product.py (811b), scripts/get_open_campaign_performance.py (775b), scripts/get_optimization_suggestion_product.py (811b), scripts/get_performance_data_update_time.py (793b), scripts/get_product_performance.py (739b), scripts/get_recommended_affiliate_list.py (781b), scripts/get_shop_performance.py (721b), scripts/get_shop_suggested_rate.py (739b), scripts/get_targeted_campaign_addable_product_list.py (853b), scripts/get_targeted_campaign_list.py (757b), scripts/get_targeted_campaign_performance.py (799b), scripts/get_targeted_campaign_settings.py (781b), scripts/get_validation_list.py (715b), scripts/get_validation_report.py (727b), scripts/query_affiliate_list.py (721b), scripts/remove_all_products_open_campaign_setting.py (847b), scripts/terminate_targeted_campaign.py (763b), scripts/update_auto_add_new_product_setting.py (811b), scripts/update_basic_info_of_targeted_campaign.py (829b), skill-card.md (2641b), SKILL.md (6772b), _meta.json (143b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: linkfox-shopee-store-ams\ndescription: Shopee（虾皮）联盟营销 AMS Affiliate Marketing Solutions（与 linkfox-shopee-store-auth 同系列），经 /shopee/developerProxy 转发 Shopee Open API AMS 模块全部 36 个接口：get_open_campaign_added_product、batch_add_products_to_open_campaign、create_new_targeted_campaign、get_affiliate_performance、get_shop_performance 等。当用户提到 Shopee 联盟营销、AMS、达人带货、affiliate、Open Campaign、Targeted Campaign、佣金率、达人推广、get_open_campaign_added_product 时触发。即使未明确提及\"联盟\"，只要涉及已授权 Shopee 店铺的联盟推广或达人 campaign 管理，也应触发。\n---\n\n# Shopee 联盟营销 AMS\n\nShopee Open Platform **AMS（Affiliate Marketing Solutions）模块**（36 个 API）。**依赖 `linkfox-shopee-store-auth`**：先取 `accessToken`，再经 **`POST /shopee/developerProxy`** 转发（`path` 须 `api/v2/ams/...`）。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-shopee-store-ams-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 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\nAMS 模块索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\n\n---\n\n## Prerequisites（必须先读）\n\n1. 运行 `python scripts/check_auth_dependency.py`；exit code **42** → 先安装 **`linkfox-shopee-store-auth`** 并授权店铺。\n2. **不要**在本 skill 内实现授权/令牌逻辑。\n3. **AMS vs Ads**：本 skill 为联盟营销/达人带货；站内 CPC 广告见 `linkfox-shopee-store-ads`（module=117）。\n\n---\n\n## Core Concepts\n\n- **转发链路**：`storeTokens` → `developerProxy` → 紫鸟 `shopee-proxy` → Shopee API\n- **Open Campaign**：开放推广，所有达人可推广 → `get_open_campaign_added_product`、`batch_add_products_to_open_campaign`\n- **Targeted Campaign**：定向推广，指定达人 → `create_new_targeted_campaign`、`edit_affiliate_list_of_targeted_campaign`\n- **效果**：`get_shop_performance`、`get_product_performance`、`get_affiliate_performance`\n- **佣金**：`get_shop_suggested_rate`、`batch_get_products_suggested_rate`\n\n## 可用脚本（AMS 模块 36 个 API）\n\n| 分组 | 脚本 |\n|------|------|\n| Open Campaign | `get_open_campaign_added_product.py`、`batch_add_products_to_open_campaign.py`、`get_open_campaign_performance.py` 等 |\n| Targeted Campaign | `create_new_targeted_campaign.py`、`get_targeted_campaign_list.py`、`terminate_targeted_campaign.py` 等 |\n| 达人/Affiliate | `get_recommended_affiliate_list.py`、`query_affiliate_list.py`、`get_affiliate_performance.py` |\n| 效果报表 | `get_shop_performance.py`、`get_product_performance.py`、`get_conversion_report.py` |\n| 通用入口 | `ams_api.py`（JSON 含 `api` 字段） |\n\n完整列表见 `references/api.md`。共享：`_shopee_ams_common.py`、`_ams_endpoints.py`、`_ams_api_runner.py`。\n\n## Usage Scenarios\n\n### 1. 管理 Open Campaign 商品\n1. `get_open_campaign_added_product.py` 查已加入商品\n2. `get_open_campaign_not_added_product.py` 查可加入商品\n3. `batch_add_products_to_open_campaign.py` 批量添加\n\n### 2. 创建定向达人 Campaign\n1. `get_recommended_affiliate_list.py` 选达人\n2. `create_new_targeted_campaign.py` 传完整 `body`\n3. `get_targeted_campaign_performance.py` 查效果\n\n## 调用原则\n\n- 先看 **`developerProxy.httpStatus`**，再读 `*Response` 字段\n- GET：业务参数放 JSON 顶层\n- POST：复杂接口传 `body`\n- 每个脚本 docstring 含 **官方文档 URL**（`module=127`）\n\n## Not Applicable\n\n- 店铺授权 → `linkfox-shopee-store-auth`\n- 站内 CPC 广告 → `linkfox-shopee-store-ads`\n- 商品 listing → `linkfox-shopee-store-product`\n- 店铺视频 → `linkfox-shopee-store-video`\n- 订单 → `linkfox-shopee-store-orders`\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---\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-ams\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783945178445\n}\n\nFile v1.0.3:references/api.md\n\n# linkfox-shopee-store-ams — 参数与字段参考\r\n\r\nShopee **AMS（Affiliate Marketing Solutions）模块**全部 36 个 API，经 **`POST /shopee/developerProxy`** 转发。\r\n\r\n授权见 **`linkfox-shopee-store-auth`**。官方索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\r\n\r\n## 通用约定\r\n\r\n- **Base URL**：`${LINKFOX_TOOL_GATEWAY}`\r\n- **Method**：POST（网关），上游 Method 见各接口\r\n- **Auth**：Header `Authorization: <api_key>`（`LINKFOX_AGENT_API_KEY` 或 `LINKFOXAGENT_API_KEY`）（如未配置 按 SKILL.md 的 **## 解决认证和积分问题** 处理）\r\n- **流程**：`POST /shopee/storeTokens` → `POST /shopee/developerProxy`\r\n- **path**：须 `api/v2/ams/...`\r\n- **标识**：店铺级 API，通常传 **`shopId`**\r\n- **与 Ads 区别**：AMS 为联盟营销/达人带货；Ads（module=117）为站内 CPC 广告\r\n- **官方文档 URL 规则**：`https://open.shopee.com/documents/v2/v2.ams.{api}?module=127&type=1`\r\n\r\n---\r\n\r\n## AMS 模块总览\r\n\r\n| # | API | Method | path | 脚本 | 官方文档 |\r\n|---|-----|--------|------|------|----------|\r\n| 1 | add_all_products_to_open_campaign | POST | `api/v2/ams/add_all_products_to_open_campaign` | `add_all_products_to_open_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.add_all_products_to_open_campaign?module=127&type=1) |\r\n| 2 | batch_add_products_to_open_campaign | POST | `api/v2/ams/batch_add_products_to_open_campaign` | `batch_add_products_to_open_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.batch_add_products_to_open_campaign?module=127&type=1) |\r\n| 3 | batch_edit_products_open_campaign_setting | POST | `api/v2/ams/batch_edit_products_open_campaign_setting` | `batch_edit_products_open_campaign_setting.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.batch_edit_products_open_campaign_setting?module=127&type=1) |\r\n| 4 | batch_get_products_suggested_rate | POST | `api/v2/ams/batch_get_products_suggested_rate` | `batch_get_products_suggested_rate.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.batch_get_products_suggested_rate?module=127&type=1) |\r\n| 5 | batch_remove_products_open_campaign_setting | POST | `api/v2/ams/batch_remove_products_open_campaign_setting` | `batch_remove_products_open_campaign_setting.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.batch_remove_products_open_campaign_setting?module=127&type=1) |\r\n| 6 | create_new_targeted_campaign | POST | `api/v2/ams/create_new_targeted_campaign` | `create_new_targeted_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.create_new_targeted_campaign?module=127&type=1) |\r\n| 7 | edit_affiliate_list_of_targeted_campaign | POST | `api/v2/ams/edit_affiliate_list_of_targeted_campaign` | `edit_affiliate_list_of_targeted_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.edit_affiliate_list_of_targeted_campaign?module=127&type=1) |\r\n| 8 | edit_all_products_open_campaign_setting | POST | `api/v2/ams/edit_all_products_open_campaign_setting` | `edit_all_products_open_campaign_setting.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.edit_all_products_open_campaign_setting?module=127&type=1) |\r\n| 9 | edit_product_list_of_targeted_campaign | POST | `api/v2/ams/edit_product_list_of_targeted_campaign` | `edit_product_list_of_targeted_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.edit_product_list_of_targeted_campaign?module=127&type=1) |\r\n| 10 | get_affiliate_performance | GET | `api/v2/ams/get_affiliate_performance` | `get_affiliate_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_affiliate_performance?module=127&type=1) |\r\n| 11 | get_auto_add_new_product_toggle_status | GET | `api/v2/ams/get_auto_add_new_product_toggle_status` | `get_auto_add_new_product_toggle_status.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_auto_add_new_product_toggle_status?module=127&type=1) |\r\n| 12 | get_campaign_key_metrics_performance | GET | `api/v2/ams/get_campaign_key_metrics_performance` | `get_campaign_key_metrics_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_campaign_key_metrics_performance?module=127&type=1) |\r\n| 13 | get_content_performance | GET | `api/v2/ams/get_content_performance` | `get_content_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_content_performance?module=127&type=1) |\r\n| 14 | get_conversion_report | GET | `api/v2/ams/get_conversion_report` | `get_conversion_report.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_conversion_report?module=127&type=1) |\r\n| 15 | get_managed_affiliate_list | GET | `api/v2/ams/get_managed_affiliate_list` | `get_managed_affiliate_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_managed_affiliate_list?module=127&type=1) |\r\n| 16 | get_open_campaign_added_product | GET | `api/v2/ams/get_open_campaign_added_product` | `get_open_campaign_added_product.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1) |\r\n| 17 | get_open_campaign_batch_task_result | GET | `api/v2/ams/get_open_campaign_batch_task_result` | `get_open_campaign_batch_task_result.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_batch_task_result?module=127&type=1) |\r\n| 18 | get_open_campaign_not_added_product | GET | `api/v2/ams/get_open_campaign_not_added_product` | `get_open_campaign_not_added_product.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_not_added_product?module=127&type=1) |\r\n| 19 | get_open_campaign_performance | GET | `api/v2/ams/get_open_campaign_performance` | `get_open_campaign_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_performance?module=127&type=1) |\r\n| 20 | get_optimization_suggestion_product | GET | `api/v2/ams/get_optimization_suggestion_product` | `get_optimization_suggestion_product.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_optimization_suggestion_product?module=127&type=1) |\r\n| 21 | get_performance_data_update_time | GET | `api/v2/ams/get_performance_data_update_time` | `get_performance_data_update_time.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_performance_data_update_time?module=127&type=1) |\r\n| 22 | get_product_performance | GET | `api/v2/ams/get_product_performance` | `get_product_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_product_performance?module=127&type=1) |\r\n| 23 | get_recommended_affiliate_list | GET | `api/v2/ams/get_recommended_affiliate_list` | `get_recommended_affiliate_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_recommended_affiliate_list?module=127&type=1) |\r\n| 24 | get_shop_performance | GET | `api/v2/ams/get_shop_performance` | `get_shop_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_shop_performance?module=127&type=1) |\r\n| 25 | get_shop_suggested_rate | GET | `api/v2/ams/get_shop_suggested_rate` | `get_shop_suggested_rate.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_shop_suggested_rate?module=127&type=1) |\r\n| 26 | get_targeted_campaign_addable_product_list | GET | `api/v2/ams/get_targeted_campaign_addable_product_list` | `get_targeted_campaign_addable_product_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_targeted_campaign_addable_product_list?module=127&type=1) |\r\n| 27 | get_targeted_campaign_list | GET | `api/v2/ams/get_targeted_campaign_list` | `get_targeted_campaign_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_targeted_campaign_list?module=127&type=1) |\r\n| 28 | get_targeted_campaign_performance | GET | `api/v2/ams/get_targeted_campaign_performance` | `get_targeted_campaign_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_targeted_campaign_performance?module=127&type=1) |\r\n| 29 | get_targeted_campaign_settings | GET | `api/v2/ams/get_targeted_campaign_settings` | `get_targeted_campaign_settings.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_targeted_campaign_settings?module=127&type=1) |\r\n| 30 | get_validation_list | GET | `api/v2/ams/get_validation_list` | `get_validation_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_validation_list?module=127&type=1) |\r\n| 31 | get_validation_report | GET | `api/v2/ams/get_validation_report` | `get_validation_report.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_validation_report?module=127&type=1) |\r\n| 32 | query_affiliate_list | GET | `api/v2/ams/query_affiliate_list` | `query_affiliate_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.query_affiliate_list?module=127&type=1) |\r\n| 33 | remove_all_products_open_campaign_setting | POST | `api/v2/ams/remove_all_products_open_campaign_setting` | `remove_all_products_open_campaign_setting.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.remove_all_products_open_campaign_setting?module=127&type=1) |\r\n| 34 | terminate_targeted_campaign | POST | `api/v2/ams/terminate_targeted_campaign` | `terminate_targeted_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.terminate_targeted_campaign?module=127&type=1) |\r\n| 35 | update_auto_add_new_product_setting | POST | `api/v2/ams/update_auto_add_new_product_setting` | `update_auto_add_new_product_setting.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.update_auto_add_new_product_setting?module=127&type=1) |\r\n| 36 | update_basic_info_of_targeted_campaign | POST | `api/v2/ams/update_basic_info_of_targeted_campaign` | `update_basic_info_of_targeted_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.update_basic_info_of_targeted_campaign?module=127&type=1) |\r\n通用入口：`ams_api.py`（JSON 含 `\"api\": \"<上表 API 名>\"`）。\r\n\r\n---\r\n\r\n## 常用接口说明\r\n\r\n### Open Campaign（开放推广）\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_open_campaign_added_product` | 已加入 Open Campaign 的商品 |\r\n| `get_open_campaign_not_added_product` | 未加入的商品 |\r\n| `batch_add_products_to_open_campaign` | 批量添加商品 |\r\n| `batch_edit_products_open_campaign_setting` | 批量编辑佣金等设置 |\r\n| `get_open_campaign_performance` | Open Campaign 效果数据 |\r\n\r\n### Targeted Campaign（定向推广）\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `create_new_targeted_campaign` | 创建定向达人 campaign |\r\n| `get_targeted_campaign_list` | campaign 列表 |\r\n| `edit_product_list_of_targeted_campaign` | 编辑 campaign 商品 |\r\n| `edit_affiliate_list_of_targeted_campaign` | 编辑 campaign 达人 |\r\n| `get_targeted_campaign_performance` | 定向 campaign 效果 |\r\n\r\n### 达人/Affiliate\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_recommended_affiliate_list` | 推荐达人 |\r\n| `get_managed_affiliate_list` | 已管理达人 |\r\n| `query_affiliate_list` | 查询达人列表 |\r\n| `get_affiliate_performance` | 达人效果 |\r\n\r\n### 效果报表\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_shop_performance` | 店铺 AMS 效果 |\r\n| `get_product_performance` | 商品效果 |\r\n| `get_conversion_report` | 转化报告 |\r\n| `get_campaign_key_metrics_performance` | 关键指标 |\r\n\r\n---\r\n\r\n## 网关错误码\r\n\r\n| errcode | 含义 | 建议 |\r\n|---------|------|------|\r\n| 1002 | 参数/未登录 | 检查 shopId 与 API Key |\r\n| 1003 | 代理/网络异常 | 重试 |\r\n| 1004 | 无授权记录 | auth skill |\r\n| 1005 | path 未白名单 | 确认 `api/v2/ams/...` |\r\n\r\n---\r\n\r\n## curl 示例\r\n\r\n```bash\r\nexport KEY=${LINKFOX_AGENT_API_KEY}\r\nBASE=${LINKFOX_TOOL_GATEWAY}\r\n\r\ncurl -X POST $BASE/shopee/developerProxy -H \"Authorization: $KEY\" \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\r\n    \"path\": \"api/v2/ams/get_open_campaign_added_product\",\r\n    \"method\": \"GET\",\r\n    \"accessToken\": \"xxx\",\r\n    \"shopId\": \"67890\"\r\n  }'\r\n```\r\n\r\n---\r\n\r\n## Feedback API\r\n\r\n```bash\r\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\"skillName\":\"linkfox-shopee-store-ams\",\"sentiment\":\"POSITIVE\",\r\n       \"category\":\"OTHER\",\"content\":\"AMS推广商品查询正常\"}'\r\n```\n\nFile v1.0.3:skill-card.md\n\n## Description: <br>\nProvides agent guidance and Python wrappers for authorized Shopee store Affiliate Marketing Solutions workflows, including campaign, affiliate, commission, and performance operations through LinkFox. <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 ecommerce teams use this skill to inspect and manage Shopee Affiliate Marketing Solutions campaigns for authorized stores, including Open Campaign, Targeted Campaign, affiliate lists, commission settings, and performance reports. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can change Shopee shop campaign settings through AMS operations. <br>\nMitigation: Confirm each mutating action before execution and review request bodies for the intended shop, campaign, products, affiliates, and commission settings. <br>\nRisk: Full API responses may include sensitive shop, campaign, affiliate, or performance data and are saved persistently. <br>\nMitigation: Use trusted workspaces, keep API keys in environment variables, avoid sharing real tokens, and delete generated linkfox response files when no longer needed. <br>\nRisk: The skill depends on authorized Shopee credentials and LinkFox proxy access. <br>\nMitigation: Verify the required authorization skill before use and restrict API keys to trusted agents and environments. <br>\n\n\n## Reference(s): <br>\n- [Shopee AMS API reference](references/api.md) <br>\n- [Shopee Open Platform AMS documentation](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1) <br>\n- [ClawHub skill page](https://clawhub.ai/linkfox-ai/skills/linkfox-shopee-store-ams) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration, JSON, Files, Guidance] <br>\n**Output Format:** [Markdown guidance with Python shell commands and JSON request/response data] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Scripts save full API responses under a linkfox session data directory and print small responses or summaries to stdout.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (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.2: 45 files, 38118 bytes\n\nFiles: references/api.md (12071b), scripts/_ams_api_runner.py (4247b), scripts/_ams_endpoints.py (9504b), scripts/_shopee_ams_common.py (11628b), scripts/add_all_products_to_open_campaign.py (799b), scripts/ams_api.py (1008b), scripts/batch_add_products_to_open_campaign.py (811b), scripts/batch_edit_products_open_campaign_setting.py (847b), scripts/batch_get_products_suggested_rate.py (799b), scripts/batch_remove_products_open_campaign_setting.py (859b), scripts/check_auth_dependency.py (3975b), scripts/create_new_targeted_campaign.py (769b), scripts/edit_affiliate_list_of_targeted_campaign.py (841b), scripts/edit_all_products_open_campaign_setting.py (835b), scripts/edit_product_list_of_targeted_campaign.py (829b), scripts/get_affiliate_performance.py (751b), scripts/get_auto_add_new_product_toggle_status.py (829b), scripts/get_campaign_key_metrics_performance.py (817b), scripts/get_content_performance.py (739b), scripts/get_conversion_report.py (727b), scripts/get_managed_affiliate_list.py (757b), scripts/get_open_campaign_added_product.py (787b), scripts/get_open_campaign_batch_task_result.py (811b), scripts/get_open_campaign_not_added_product.py (811b), scripts/get_open_campaign_performance.py (775b), scripts/get_optimization_suggestion_product.py (811b), scripts/get_performance_data_update_time.py (793b), scripts/get_product_performance.py (739b), scripts/get_recommended_affiliate_list.py (781b), scripts/get_shop_performance.py (721b), scripts/get_shop_suggested_rate.py (739b), scripts/get_targeted_campaign_addable_product_list.py (853b), scripts/get_targeted_campaign_list.py (757b), scripts/get_targeted_campaign_performance.py (799b), scripts/get_targeted_campaign_settings.py (781b), scripts/get_validation_list.py (715b), scripts/get_validation_report.py (727b), scripts/query_affiliate_list.py (721b), scripts/remove_all_products_open_campaign_setting.py (847b), scripts/terminate_targeted_campaign.py (763b), scripts/update_auto_add_new_product_setting.py (811b), scripts/update_basic_info_of_targeted_campaign.py (829b), skill-card.md (2477b), SKILL.md (5735b), _meta.json (143b)\n\nFile v1.0.2:SKILL.md\n\n---\r\nname: linkfox-shopee-store-ams\r\ndescription: Shopee（虾皮）联盟营销 AMS Affiliate Marketing Solutions（与 linkfox-shopee-store-auth 同系列），经 /shopee/developerProxy 转发 Shopee Open API AMS 模块全部 36 个接口：get_open_campaign_added_product、batch_add_products_to_open_campaign、create_new_targeted_campaign、get_affiliate_performance、get_shop_performance 等。当用户提到 Shopee 联盟营销、AMS、达人带货、affiliate、Open Campaign、Targeted Campaign、佣金率、达人推广、get_open_campaign_added_product 时触发。即使未明确提及\"联盟\"，只要涉及已授权 Shopee 店铺的联盟推广或达人 campaign 管理，也应触发。\r\n---\r\n\r\n# Shopee 联盟营销 AMS\r\n\r\nShopee Open Platform **AMS（Affiliate Marketing Solutions）模块**（36 个 API）。**依赖 `linkfox-shopee-store-auth`**：先取 `accessToken`，再经 **`POST /shopee/developerProxy`** 转发（`path` 须 `api/v2/ams/...`）。\r\n\r\n## 调用方式\r\n\r\n- **API 端点**：`POST /shopee/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\r\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\r\n- **成本约束**：本工具会消耗积分；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\r\n\r\n**输出策略（脚本默认行为）**：\r\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-shopee-store-ams-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\r\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\r\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 3 条样本）\r\n- 加 `--inline` 强制全量打印到 stdout（同样落盘）\r\n\r\n**读数据建议**：先看摘要判断是否足够；需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取，避免整份 JSON 进入上下文。\r\n\r\n## 官方参考\r\n\r\nAMS 模块索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\r\n\r\n---\r\n\r\n## Prerequisites（必须先读）\r\n\r\n1. 运行 `python scripts/check_auth_dependency.py`；exit code **42** → 先安装 **`linkfox-shopee-store-auth`** 并授权店铺。\r\n2. **不要**在本 skill 内实现授权/令牌逻辑。\r\n3. **AMS vs Ads**：本 skill 为联盟营销/达人带货；站内 CPC 广告见 `linkfox-shopee-store-ads`（module=117）。\r\n\r\n---\r\n\r\n## Core Concepts\r\n\r\n- **转发链路**：`storeTokens` → `developerProxy` → 紫鸟 `shopee-proxy` → Shopee API\r\n- **Open Campaign**：开放推广，所有达人可推广 → `get_open_campaign_added_product`、`batch_add_products_to_open_campaign`\r\n- **Targeted Campaign**：定向推广，指定达人 → `create_new_targeted_campaign`、`edit_affiliate_list_of_targeted_campaign`\r\n- **效果**：`get_shop_performance`、`get_product_performance`、`get_affiliate_performance`\r\n- **佣金**：`get_shop_suggested_rate`、`batch_get_products_suggested_rate`\r\n\r\n## 可用脚本（AMS 模块 36 个 API）\r\n\r\n| 分组 | 脚本 |\r\n|------|------|\r\n| Open Campaign | `get_open_campaign_added_product.py`、`batch_add_products_to_open_campaign.py`、`get_open_campaign_performance.py` 等 |\r\n| Targeted Campaign | `create_new_targeted_campaign.py`、`get_targeted_campaign_list.py`、`terminate_targeted_campaign.py` 等 |\r\n| 达人/Affiliate | `get_recommended_affiliate_list.py`、`query_affiliate_list.py`、`get_affiliate_performance.py` |\r\n| 效果报表 | `get_shop_performance.py`、`get_product_performance.py`、`get_conversion_report.py` |\r\n| 通用入口 | `ams_api.py`（JSON 含 `api` 字段） |\r\n\r\n完整列表见 `references/api.md`。共享：`_shopee_ams_common.py`、`_ams_endpoints.py`、`_ams_api_runner.py`。\r\n\r\n## Usage Scenarios\r\n\r\n### 1. 管理 Open Campaign 商品\r\n1. `get_open_campaign_added_product.py` 查已加入商品\r\n2. `get_open_campaign_not_added_product.py` 查可加入商品\r\n3. `batch_add_products_to_open_campaign.py` 批量添加\r\n\r\n### 2. 创建定向达人 Campaign\r\n1. `get_recommended_affiliate_list.py` 选达人\r\n2. `create_new_targeted_campaign.py` 传完整 `body`\r\n3. `get_targeted_campaign_performance.py` 查效果\r\n\r\n## 调用原则\r\n\r\n- 先看 **`developerProxy.httpStatus`**，再读 `*Response` 字段\r\n- GET：业务参数放 JSON 顶层\r\n- POST：复杂接口传 `body`\r\n- 每个脚本 docstring 含 **官方文档 URL**（`module=127`）\r\n\r\n## Not Applicable\r\n\r\n- 店铺授权 → `linkfox-shopee-store-auth`\r\n- 站内 CPC 广告 → `linkfox-shopee-store-ads`\r\n- 商品 listing → `linkfox-shopee-store-product`\r\n- 店铺视频 → `linkfox-shopee-store-video`\r\n- 订单 → `linkfox-shopee-store-orders`\r\n\r\n**Feedback:**\r\n\r\nAuto-detect and report feedback via the Feedback API when any of the following apply:\r\n1. The functionality or purpose described in this skill does not match actual behavior\r\n2. The skill's results do not match the user's intent\r\n3. The user expresses dissatisfaction or praise about this skill\r\n4. Anything you believe could be improved\r\n\r\nCall the feedback API as specified in `references/api.md`. Do not interrupt the user's flow.\r\n\r\n\r\n---\r\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-ams\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1783337286239\n}\n\nFile v1.0.2:references/api.md\n\n# linkfox-shopee-store-ams — 参数与字段参考\r\n\r\nShopee **AMS（Affiliate Marketing Solutions）模块**全部 36 个 API，经 **`POST /shopee/developerProxy`** 转发。\r\n\r\n授权见 **`linkfox-shopee-store-auth`**。官方索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\r\n\r\n## 通用约定\r\n\r\n- **Base URL**：`${LINKFOX_TOOL_GATEWAY}`\r\n- **Method**：POST（网关），上游 Method 见各接口\r\n- **Auth**：Header `Authorization: <api_key>`（`LINKFOX_AGENT_API_KEY` 或 `LINKFOXAGENT_API_KEY`）\r\n- **流程**：`POST /shopee/storeTokens` → `POST /shopee/developerProxy`\r\n- **path**：须 `api/v2/ams/...`\r\n- **标识**：店铺级 API，通常传 **`shopId`**\r\n- **与 Ads 区别**：AMS 为联盟营销/达人带货；Ads（module=117）为站内 CPC 广告\r\n- **官方文档 URL 规则**：`https://open.shopee.com/documents/v2/v2.ams.{api}?module=127&type=1`\r\n\r\n---\r\n\r\n## AMS 模块总览\r\n\r\n| # | API | Method | path | 脚本 | 官方文档 |\r\n|---|-----|--------|------|------|----------|\r\n| 1 | add_all_products_to_open_campaign | POST | `api/v2/ams/add_all_products_to_open_campaign` | `add_all_products_to_open_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.add_all_products_to_open_campaign?module=127&type=1) |\r\n| 2 | batch_add_products_to_open_campaign | POST | `api/v2/ams/batch_add_products_to_open_campaign` | `batch_add_products_to_open_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.batch_add_products_to_open_campaign?module=127&type=1) |\r\n| 3 | batch_edit_products_open_campaign_setting | POST | `api/v2/ams/batch_edit_products_open_campaign_setting` | `batch_edit_products_open_campaign_setting.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.batch_edit_products_open_campaign_setting?module=127&type=1) |\r\n| 4 | batch_get_products_suggested_rate | POST | `api/v2/ams/batch_get_products_suggested_rate` | `batch_get_products_suggested_rate.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.batch_get_products_suggested_rate?module=127&type=1) |\r\n| 5 | batch_remove_products_open_campaign_setting | POST | `api/v2/ams/batch_remove_products_open_campaign_setting` | `batch_remove_products_open_campaign_setting.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.batch_remove_products_open_campaign_setting?module=127&type=1) |\r\n| 6 | create_new_targeted_campaign | POST | `api/v2/ams/create_new_targeted_campaign` | `create_new_targeted_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.create_new_targeted_campaign?module=127&type=1) |\r\n| 7 | edit_affiliate_list_of_targeted_campaign | POST | `api/v2/ams/edit_affiliate_list_of_targeted_campaign` | `edit_affiliate_list_of_targeted_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.edit_affiliate_list_of_targeted_campaign?module=127&type=1) |\r\n| 8 | edit_all_products_open_campaign_setting | POST | `api/v2/ams/edit_all_products_open_campaign_setting` | `edit_all_products_open_campaign_setting.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.edit_all_products_open_campaign_setting?module=127&type=1) |\r\n| 9 | edit_product_list_of_targeted_campaign | POST | `api/v2/ams/edit_product_list_of_targeted_campaign` | `edit_product_list_of_targeted_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.edit_product_list_of_targeted_campaign?module=127&type=1) |\r\n| 10 | get_affiliate_performance | GET | `api/v2/ams/get_affiliate_performance` | `get_affiliate_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_affiliate_performance?module=127&type=1) |\r\n| 11 | get_auto_add_new_product_toggle_status | GET | `api/v2/ams/get_auto_add_new_product_toggle_status` | `get_auto_add_new_product_toggle_status.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_auto_add_new_product_toggle_status?module=127&type=1) |\r\n| 12 | get_campaign_key_metrics_performance | GET | `api/v2/ams/get_campaign_key_metrics_performance` | `get_campaign_key_metrics_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_campaign_key_metrics_performance?module=127&type=1) |\r\n| 13 | get_content_performance | GET | `api/v2/ams/get_content_performance` | `get_content_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_content_performance?module=127&type=1) |\r\n| 14 | get_conversion_report | GET | `api/v2/ams/get_conversion_report` | `get_conversion_report.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_conversion_report?module=127&type=1) |\r\n| 15 | get_managed_affiliate_list | GET | `api/v2/ams/get_managed_affiliate_list` | `get_managed_affiliate_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_managed_affiliate_list?module=127&type=1) |\r\n| 16 | get_open_campaign_added_product | GET | `api/v2/ams/get_open_campaign_added_product` | `get_open_campaign_added_product.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1) |\r\n| 17 | get_open_campaign_batch_task_result | GET | `api/v2/ams/get_open_campaign_batch_task_result` | `get_open_campaign_batch_task_result.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_batch_task_result?module=127&type=1) |\r\n| 18 | get_open_campaign_not_added_product | GET | `api/v2/ams/get_open_campaign_not_added_product` | `get_open_campaign_not_added_product.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_not_added_product?module=127&type=1) |\r\n| 19 | get_open_campaign_performance | GET | `api/v2/ams/get_open_campaign_performance` | `get_open_campaign_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_performance?module=127&type=1) |\r\n| 20 | get_optimization_suggestion_product | GET | `api/v2/ams/get_optimization_suggestion_product` | `get_optimization_suggestion_product.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_optimization_suggestion_product?module=127&type=1) |\r\n| 21 | get_performance_data_update_time | GET | `api/v2/ams/get_performance_data_update_time` | `get_performance_data_update_time.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_performance_data_update_time?module=127&type=1) |\r\n| 22 | get_product_performance | GET | `api/v2/ams/get_product_performance` | `get_product_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_product_performance?module=127&type=1) |\r\n| 23 | get_recommended_affiliate_list | GET | `api/v2/ams/get_recommended_affiliate_list` | `get_recommended_affiliate_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_recommended_affiliate_list?module=127&type=1) |\r\n| 24 | get_shop_performance | GET | `api/v2/ams/get_shop_performance` | `get_shop_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_shop_performance?module=127&type=1) |\r\n| 25 | get_shop_suggested_rate | GET | `api/v2/ams/get_shop_suggested_rate` | `get_shop_suggested_rate.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_shop_suggested_rate?module=127&type=1) |\r\n| 26 | get_targeted_campaign_addable_product_list | GET | `api/v2/ams/get_targeted_campaign_addable_product_list` | `get_targeted_campaign_addable_product_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_targeted_campaign_addable_product_list?module=127&type=1) |\r\n| 27 | get_targeted_campaign_list | GET | `api/v2/ams/get_targeted_campaign_list` | `get_targeted_campaign_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_targeted_campaign_list?module=127&type=1) |\r\n| 28 | get_targeted_campaign_performance | GET | `api/v2/ams/get_targeted_campaign_performance` | `get_targeted_campaign_performance.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_targeted_campaign_performance?module=127&type=1) |\r\n| 29 | get_targeted_campaign_settings | GET | `api/v2/ams/get_targeted_campaign_settings` | `get_targeted_campaign_settings.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_targeted_campaign_settings?module=127&type=1) |\r\n| 30 | get_validation_list | GET | `api/v2/ams/get_validation_list` | `get_validation_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_validation_list?module=127&type=1) |\r\n| 31 | get_validation_report | GET | `api/v2/ams/get_validation_report` | `get_validation_report.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.get_validation_report?module=127&type=1) |\r\n| 32 | query_affiliate_list | GET | `api/v2/ams/query_affiliate_list` | `query_affiliate_list.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.query_affiliate_list?module=127&type=1) |\r\n| 33 | remove_all_products_open_campaign_setting | POST | `api/v2/ams/remove_all_products_open_campaign_setting` | `remove_all_products_open_campaign_setting.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.remove_all_products_open_campaign_setting?module=127&type=1) |\r\n| 34 | terminate_targeted_campaign | POST | `api/v2/ams/terminate_targeted_campaign` | `terminate_targeted_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.terminate_targeted_campaign?module=127&type=1) |\r\n| 35 | update_auto_add_new_product_setting | POST | `api/v2/ams/update_auto_add_new_product_setting` | `update_auto_add_new_product_setting.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.update_auto_add_new_product_setting?module=127&type=1) |\r\n| 36 | update_basic_info_of_targeted_campaign | POST | `api/v2/ams/update_basic_info_of_targeted_campaign` | `update_basic_info_of_targeted_campaign.py` | [doc](https://open.shopee.com/documents/v2/v2.ams.update_basic_info_of_targeted_campaign?module=127&type=1) |\r\n通用入口：`ams_api.py`（JSON 含 `\"api\": \"<上表 API 名>\"`）。\r\n\r\n---\r\n\r\n## 常用接口说明\r\n\r\n### Open Campaign（开放推广）\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_open_campaign_added_product` | 已加入 Open Campaign 的商品 |\r\n| `get_open_campaign_not_added_product` | 未加入的商品 |\r\n| `batch_add_products_to_open_campaign` | 批量添加商品 |\r\n| `batch_edit_products_open_campaign_setting` | 批量编辑佣金等设置 |\r\n| `get_open_campaign_performance` | Open Campaign 效果数据 |\r\n\r\n### Targeted Campaign（定向推广）\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `create_new_targeted_campaign` | 创建定向达人 campaign |\r\n| `get_targeted_campaign_list` | campaign 列表 |\r\n| `edit_product_list_of_targeted_campaign` | 编辑 campaign 商品 |\r\n| `edit_affiliate_list_of_targeted_campaign` | 编辑 campaign 达人 |\r\n| `get_targeted_campaign_performance` | 定向 campaign 效果 |\r\n\r\n### 达人/Affiliate\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_recommended_affiliate_list` | 推荐达人 |\r\n| `get_managed_affiliate_list` | 已管理达人 |\r\n| `query_affiliate_list` | 查询达人列表 |\r\n| `get_affiliate_performance` | 达人效果 |\r\n\r\n### 效果报表\r\n\r\n| API | 要点 |\r\n|-----|------|\r\n| `get_shop_performance` | 店铺 AMS 效果 |\r\n| `get_product_performance` | 商品效果 |\r\n| `get_conversion_report` | 转化报告 |\r\n| `get_campaign_key_metrics_performance` | 关键指标 |\r\n\r\n---\r\n\r\n## 网关错误码\r\n\r\n| errcode | 含义 | 建议 |\r\n|---------|------|------|\r\n| 1002 | 参数/未登录 | 检查 shopId 与 API Key |\r\n| 1003 | 代理/网络异常 | 重试 |\r\n| 1004 | 无授权记录 | auth skill |\r\n| 1005 | path 未白名单 | 确认 `api/v2/ams/...` |\r\n\r\n---\r\n\r\n## curl 示例\r\n\r\n```bash\r\nexport KEY=${LINKFOX_AGENT_API_KEY}\r\nBASE=${LINKFOX_TOOL_GATEWAY}\r\n\r\ncurl -X POST $BASE/shopee/developerProxy -H \"Authorization: $KEY\" \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\r\n    \"path\": \"api/v2/ams/get_open_campaign_added_product\",\r\n    \"method\": \"GET\",\r\n    \"accessToken\": \"xxx\",\r\n    \"shopId\": \"67890\"\r\n  }'\r\n```\r\n\r\n---\r\n\r\n## Feedback API\r\n\r\n```bash\r\ncurl -X POST https://skill-api.linkfox.com/api/v1/public/feedback \\\r\n  -H \"Content-Type: application/json\" \\\r\n  -d '{\"skillName\":\"linkfox-shopee-store-ams\",\"sentiment\":\"POSITIVE\",\r\n       \"category\":\"OTHER\",\"content\":\"AMS推广商品查询正常\"}'\r\n```\n\nFile v1.0.2:skill-card.md\n\n## Description: <br>\nShopee AMS skill for managing affiliate marketing campaigns, affiliates, commissions, and performance data for authorized Shopee stores through 36 Open Platform AMS 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...","readmeExcerpt":"Skill: Shopee-店铺AMS Owner: linkfox-ai Summary: Shopee（虾皮）联盟营销 AMS Affiliate Marketing Solutions（与 linkfox-shopee-store-auth 同系列），经 /shopee/developerProxy 转发 Shopee Open API AMS 模块全部 36 个接口：get_open_campaign_added_product、batch_add_products_to_open_campaign、create_new_targeted_campaign、get_affiliate_performance、get_shop_performance 等。当用户提到 Shopee 联盟营销、AMS、达人带货、affiliate、Open Campaign、Targeted Campaign、佣金率、达人推广、get_ope","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"File v1.0.6:references/apis/add-all-products-to-open-campaign.md\n\n# add_all_products_to_open_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/add_all_products_to_open_campaign.py` |\n| Method / path | POST `api/v2/ams/add_all_products_to_open_campaign` |\n| 官方文档 | [add_all_products_to_open_campaign](https://open.shopee.com/documents/v2/v2.ams.add_all_products_to_open_campaign?module=127&type=1) |\n| 用途 | Add all eligible products to Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Add all eligible products to Open Campaign\n\n---\n\n## 调用示例"},{"language":"text","snippet":"---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`addAllProductsToOpenCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/batch-add-products-to-open-campaign.md\n\n# batch_add_products_to_open_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_add_products_to_open_campaign.py` |\n| Method / path | POST `api/v2/ams/batch_add_products_to_open_campaign` |\n| 官方文档 | [batch_add_products_to_open_campaign](https://open.shopee.com/documents/v2/v2.ams.batch_add_products_to_open_campaign?module=127&type=1) |\n| 用途 | Batch add products to Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch add products to Open Campaign\n\n---\n\n## 调用示例"},{"language":"text","snippet":"---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchAddProductsToOpenCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/batch-edit-products-open-campaign-setting.md\n\n# batch_edit_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_edit_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/batch_edit_products_open_campaign_setting` |\n| 官方文档 | [batch_edit_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.batch_edit_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Batch edit Open Campaign product settings |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch edit Open Campaign product settings\n\n---\n\n## 调用示例"},{"language":"text","snippet":"---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchEditProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/batch-get-products-suggested-rate.md\n\n# batch_get_products_suggested_rate\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_get_products_suggested_rate.py` |\n| Method / path | POST `api/v2/ams/batch_get_products_suggested_rate` |\n| 官方文档 | [batch_get_products_suggested_rate](https://open.shopee.com/documents/v2/v2.ams.batch_get_products_suggested_rate?module=127&type=1) |\n| 用途 | Batch get suggested commission rates |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch get suggested commission rates\n\n---\n\n## 调用示例"},{"language":"text","snippet":"---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchGetProductsSuggestedRate`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/batch-remove-products-open-campaign-setting.md\n\n# batch_remove_products_open_campaign_setting\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_remove_products_open_campaign_setting.py` |\n| Method / path | POST `api/v2/ams/batch_remove_products_open_campaign_setting` |\n| 官方文档 | [batch_remove_products_open_campaign_setting](https://open.shopee.com/documents/v2/v2.ams.batch_remove_products_open_campaign_setting?module=127&type=1) |\n| 用途 | Batch remove products from Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch remove products from Open Campaign\n\n---\n\n## 调用示例"},{"language":"text","snippet":"---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchRemoveProductsOpenCampaignSetting`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准\n\nFile v1.0.6:references/apis/create-new-targeted-campaign.md\n\n# create_new_targeted_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/create_new_targeted_campaign.py` |\n| Method / path | POST `api/v2/ams/create_new_targeted_campaign` |\n| 官方文档 | [create_new_targeted_campaign](https://open.shopee.com/documents/v2/v2.ams.create_new_targeted_campaign?module=127&type=1) |\n| 用途 | Create targeted affiliate campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Create targeted affiliate campaign\n\n---\n\n## 调用示例"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: linkfox-shopee-store-ams\ndescription: Shopee（虾皮）联盟营销 AMS Affiliate Marketing Solutions（与 linkfox-shopee-store-auth 同系列），经 /shopee/developerProxy 转发 Shopee Open API AMS 模块全部 36 个接口：get_open_campaign_added_product、batch_add_products_to_open_campaign、create_new_targeted_campaign、get_affiliate_performance、get_shop_performance 等。当用户提到 Shopee 联盟营销、AMS、达人带货、affiliate、Open Campaign、Targeted Campaign、佣金率、达人推广、get_open_campaign_added_product 时触发。即使未明确提及\"联盟\"，只要涉及已授权 Shopee 店铺的联盟推广或达人 campaign 管理，也应触发。\n---\n\n# Shopee 联盟营销 AMS\n\nShopee Open Platform **AMS（Affiliate Marketing Solutions）模块**（36 个 API）。**依赖 `linkfox-shopee-store-auth`** 选店；经 **`POST /shopee/developerProxy`** 传入 `shopId`（或 `merchantId`），由服务端解析 token 转发（`path` 须 `api/v2/ams/...`）。\n\n## 调用方式\n\n- **API 端点**：`POST /shopee/developerProxy`（不同操作通过请求体区分；完整参数/响应/错误码见 `references/api.md`）\n- **Python 脚本**：`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`（可用脚本见上文脚本一览）\n- **成本约束**：本工具会消耗算力；失败/空结果不得自动换关键词、翻页或连续试探；需要继续检索时先向用户说明会产生额外消耗。\n\n**输出策略（脚本默认行为）**：\n- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-shopee-store-ams-<timestamp>.json`（`<cwd>` 为脚本执行时的工作目录，在 Claude Code 里即当前项目目录；`<session>` 取自环境变量 `SESSION_ID`，按用户任务自动聚合；**禁止写入 /tmp**，当前目录不可写则报错）\n- 响应体 ≤ 8 KB：落盘后把完整 JSON 打印到 stdout\n- 响应体 > 8 KB：落盘后 stdout 只输出摘要（顶层字段、常见计数如 `total`/`costToken`、最大列表字段的长度 + 前 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\nAMS 模块索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\n\n---\n\n## Prerequisites（必须先读）\n\n1. 运行 `python scripts/check_auth_dependency.py`；exit code **42** → 先安装 **`linkfox-shopee-store-auth`** 并授权店铺。\n2. **不要**在本 skill 内实现授权/令牌逻辑。\n3. **AMS vs Ads**：本 skill 为联盟营销/达人带货；站内 CPC 广告见 `linkfox-shopee-store-ads`（module=117）。\n\n---\n\n## Core Concepts\n\n- **转发链路**：`developerProxy`（`shopId`/`merchantId` 选店，服务端注入 token）→ 紫鸟 `shopee-proxy` → Shopee API\n- **Open Campaign**：开放推广，所有达人可推广 → `get_open_campaign_added_product`、`batch_add_products_to_open_campaign`\n- **Targeted Campaign**：定向推广，指定达人 → `create_new_targeted_campaign`、`edit_affiliate_list_of_targeted_campaign`\n- **效果**：`get_shop_performance`、`get_product_performance`、`get_affiliate_performance`\n- **佣金**：`get_shop_suggested_rate`、`batch_get_products_suggested_rate`\n\n## 可用脚本（AMS 模块 36 个 API）\n\n| 分组 | 脚本 |\n|------|------|\n| Open Campaign | `get_open_campaign_added_product.py`、`batch_add_products_to_open_campaign.py`、`get_open_campaign_performance.py` 等 |\n| Targeted Campaign | `create_new_targeted_campaign.py`、`get_targeted_campaign_list.py`、`terminate_targeted_campaign.py` 等 |\n| 达人/Affiliate | `get_recommended_affiliate"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7dmc1t4j28hem1twwyav85p182pb1j\",\n  \"slug\": \"linkfox-shopee-store-ams\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1789363581464\n}"},{"path":"references/api.md","content":"# linkfox-shopee-store-ams — 参数与字段参考\r\n\r\n> 单接口入参/响应说明已拆到 **`apis/`**（按 API 一份）；本文件保留模块总览与 Feedback。\r\nShopee **AMS（Affiliate Marketing Solutions）模块**全部 36 个 API，经 **`POST /shopee/developerProxy`** 转发。\r\n\r\n授权见 **`linkfox-shopee-store-auth`**。官方索引：[v2.ams.get_open_campaign_added_product](https://open.shopee.com/documents/v2/v2.ams.get_open_campaign_added_product?module=127&type=1)\r\n\r\n## 通用约定\r\n\r\n- **Base URL**：`https://tool-gateway.linkfox.com`\r\n- **Method**：POST（网关），上游 Method 见各接口\r\n- **Auth**：Header `Authorization: <api_key>`（`LINKFOXAGENT_API_KEY`）\r\n- **流程**：`POST /shopee/storeTokens` → `POST /shopee/developerProxy`\r\n- **path**：须 `api/v2/ams/...`\r\n- **标识**：店铺级 API，通常传 **`shopId`**\r\n- **与 Ads 区别**：AMS 为联盟营销/达人带货；Ads（module=117）为站内 CPC 广告\r\n- **官方文档 URL 规则**：`https://open.shopee.com/documents/v2/v2.ams.{api}?module=127&type=1`\r\n\r\n---\r\n\r\n## AMS 模块总览\r\n\r\n| # | API | Method | path | 脚本 | 官方文档 |\r\n|---|-----|--------|------|------|----------|\r\n| 1 | add_all_products_to_open_campaign | POST | `api/v2/ams/add_all_products_to_open_campaign` | `add_all_products_to_open_campaign.py` | [apis/add-all-products-to-open-campaign.md](./apis/add-all-products-to-open-campaign.md) |\r\n| 2 | batch_add_products_to_open_campaign | POST | `api/v2/ams/batch_add_products_to_open_campaign` | `batch_add_products_to_open_campaign.py` | [apis/batch-add-products-to-open-campaign.md](./apis/batch-add-products-to-open-campaign.md) |\r\n| 3 | batch_edit_products_open_campaign_setting | POST | `api/v2/ams/batch_edit_products_open_campaign_setting` | `batch_edit_products_open_campaign_setting.py` | [apis/batch-edit-products-open-campaign-setting.md](./apis/batch-edit-products-open-campaign-setting.md) |\r\n| 4 | batch_get_products_suggested_rate | POST | `api/v2/ams/batch_get_products_suggested_rate` | `batch_get_products_suggested_rate.py` | [apis/batch-get-products-suggested-rate.md](./apis/batch-get-products-suggested-rate.md) |\r\n| 5 | batch_remove_products_open_campaign_setting | POST | `api/v2/ams/batch_remove_products_open_campaign_setting` | `batch_remove_products_open_campaign_setting.py` | [apis/batch-remove-products-open-campaign-setting.md](./apis/batch-remove-products-open-campaign-setting.md) |\r\n| 6 | create_new_targeted_campaign | POST | `api/v2/ams/create_new_targeted_campaign` | `create_new_targeted_campaign.py` | [apis/create-new-targeted-campaign.md](./apis/create-new-targeted-campaign.md) |\r\n| 7 | edit_affiliate_list_of_targeted_campaign | POST | `api/v2/ams/edit_affiliate_list_of_targeted_campaign` | `edit_affiliate_list_of_targeted_campaign.py` | [apis/edit-affiliate-list-of-targeted-campaign.md](./apis/edit-affiliate-list-of-targeted-campaign.md) |\r\n| 8 | edit_all_products_open_campaign_setting | POST | `api/v2/ams/edit_all_products_open_campaign_setting` | `edit_all_products_open_campaign_setting.py` | [apis/edit-all-products-open-campaign-setting.md](./apis/edit-all-products-open-campaign-setting.md) |\r\n| 9 | edit_product_list_of_targeted_campaign | POST | `api/v2/ams/e"},{"path":"references/apis/add-all-products-to-open-campaign.md","content":"# add_all_products_to_open_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/add_all_products_to_open_campaign.py` |\n| Method / path | POST `api/v2/ams/add_all_products_to_open_campaign` |\n| 官方文档 | [add_all_products_to_open_campaign](https://open.shopee.com/documents/v2/v2.ams.add_all_products_to_open_campaign?module=127&type=1) |\n| 用途 | Add all eligible products to Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Add all eligible products to Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/add_all_products_to_open_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"add_all_products_to_open_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`addAllProductsToOpenCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准"},{"path":"references/apis/batch-add-products-to-open-campaign.md","content":"# batch_add_products_to_open_campaign\n\n| 项 | 值 |\n|----|-----|\n| 脚本 | `scripts/batch_add_products_to_open_campaign.py` |\n| Method / path | POST `api/v2/ams/batch_add_products_to_open_campaign` |\n| 官方文档 | [batch_add_products_to_open_campaign](https://open.shopee.com/documents/v2/v2.ams.batch_add_products_to_open_campaign?module=127&type=1) |\n| 用途 | Batch add products to Open Campaign |\n\n经 **`POST /shopee/developerProxy`** 转发；依赖 **`linkfox-shopee-store-auth`** 选店（通常传 `shopId` 或 `merchantId`）。\n\n---\n\n## 脚本 JSON 入参\n\n| 字段 | 类型 | 必填 | 说明 |\n|------|------|------|------|\n| `shopId` | string | 与 `merchantId` 二选一 | 店铺 ID（推荐；Public 等无店铺接口可省略） |\n| `merchantId` | string | 与 `shopId` 二选一 | 商户 ID |\n\n- Method：**POST**\n- POST：传 `body` / `requestBody`，或把 `body_fields` 列在 JSON 顶层\n- `shopId` / `merchantId` / `skipDepCheck` 等为网关选店保留字段，不会进 Shopee query/body\n- Registry notes：Batch add products to Open Campaign\n\n---\n\n## 调用示例\n\n```bash\nexport LINKFOXAGENT_API_KEY=\"<your-key>\"\n\npython scripts/batch_add_products_to_open_campaign.py '{\"shopId\": \"67890\"}'\n\n# 通用入口\npython scripts/ams_api.py '{\"api\": \"batch_add_products_to_open_campaign\", \"shopId\": \"67890\"}'\n```\n\n---\n\n## 响应要点\n\n1. 先看 **`developerProxy.httpStatus`** / `errcode`\n2. 再读 **`batchAddProductsToOpenCampaign`**（Shopee `response` 解析结果）\n3. 字段以官方文档为准"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1222,"uniquenessScore":30,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T22:03:34.004Z","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-11T22:03:34.004Z","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-12T16:48:36.610Z","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"}]}}}