Shopee Open Platform AMS (Affiliate Marketing Solutions) module(36 APIs).Depends on linkfox-shopee-store-auth store selection; via POST /shopee/developerProxy pass in shopId(or merchantId), the server parses the token and forwards (path must be api/v2/ams/...)。
How to call
- API endpoint:
POST /shopee/developerProxy(different operations are distinguished by the request body; for complete parameters/responses/error codes seereferences/api.md) - Python script:
python scripts/<脚本名>.py '<JSON 参数>' [--inline](available scripts see the script list above) - Cost constraint: This tool consumes compute; on failure/empty results you must not automatically switch keywords, paginate, or repeatedly probe; if you need to continue searching, first explain to the user that it will incur additional consumption.
Output strategy (script default behavior):
- Alwayswrite the complete response to
<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/linkfox-shopee-store-ams-<timestamp>.json(<cwd>is the working directory when the script runs, which in Claude Code is the current project directory;<session>is taken from the environment variableSESSION_ID, automatically aggregated according to the user task;Writing to /tmp is prohibited, if the current directory is not writable then report an error) - Response body ≤ 8 KB: after writing to disk, print the complete JSON to stdout
- Response body > 8 KB: after writing to disk, stdout outputs only a summary (top-level fields, common counts such as
total/costToken, the length of the largest list field + the first 3 samples) - Add
--inlineto force full printing to stdout (also written to disk)
Data reading suggestions: First look at the summary to judge whether it is sufficient; when specific fields are needed, prefer to use jqorConvertFrom-Json to extract on demand from the saved json file, avoiding bringing the entire JSON into context.
Resolve authentication and compute issues
When the following abnormal situations occur, use references/onboarding.md to guide resolution:
Abnormal situation
- API Key not configured: The environment variable is not configured with
LINKFOX_AGENT_API_KEY, andLINKFOXAGENT_API_KEY。 - Response 401 or 402 status code
- Response indicates insufficient compute or balance: The message contains "insufficient compute balance/insufficient billing/insufficient balance/quota exceeded/insufficient balance/package expired/recharge required/please recharge", or content with a similar meaning.
Official reference
AMS module index:v2.ams.get_open_campaign_added_product
Prerequisites (must read first)
- Run
python scripts/check_auth_dependency.py;exit code 42 → first installlinkfox-shopee-store-authand authorize the store. - Do notimplement authorization/token logic within this skill.
- AMS vs Ads: This skill is for affiliate marketing/influencer selling; for on-platform CPC ads see
linkfox-shopee-store-ads(module=117)。
Core Concepts
- Forwarding chain:
developerProxy(shopId/merchantIdstore selection, server injects token) → ZiNiaoshopee-proxy→ Shopee API - Open Campaign: Open promotion, all influencers can promote →
get_open_campaign_added_product、batch_add_products_to_open_campaign - Targeted Campaign: Targeted promotion, specified influencers →
create_new_targeted_campaign、edit_affiliate_list_of_targeted_campaign - Performance:
get_shop_performance、get_product_performance、get_affiliate_performance - Commission:
get_shop_suggested_rate、batch_get_products_suggested_rate
Available scripts (AMS module 36 APIs)
| Group | Script |
|---|---|
| Open Campaign | get_open_campaign_added_product.py、batch_add_products_to_open_campaign.py、get_open_campaign_performance.py etc. |
| Targeted Campaign | create_new_targeted_campaign.py、get_targeted_campaign_list.py、terminate_targeted_campaign.py etc. |
| Influencer/Affiliate | get_recommended_affiliate_list.py、query_affiliate_list.py、get_affiliate_performance.py |
| Performance report | get_shop_performance.py、get_product_performance.py、get_conversion_report.py |
| General entry | ams_api.py(JSON contains api field) |
See references/api.mdfor the full list. Shared:_shopee_ams_common.py、_ams_endpoints.py、_ams_api_runner.py。
API Reference (by API)
Request parameters and response details are in references/apis/; SKILL only keeps the index.
For the module overview / Feedback, see references/api.md。
Usage Scenarios
1. Manage Open Campaign products
get_open_campaign_added_product.pyView added productsget_open_campaign_not_added_product.pyView addable productsbatch_add_products_to_open_campaign.pyBulk add
2. Create a targeted creator Campaign
get_recommended_affiliate_list.pySelect creatorscreate_new_targeted_campaign.pyUpload completebodyget_targeted_campaign_performance.pyView performance
Calling principles
- First look at
developerProxy.httpStatus, then read the*Responsefield - GET: put business parameters at the top level of JSON
- POST: for complex APIs pass
body - Each script docstring contains official documentation URL(
module=127)
Not Applicable
- Store authorization →
linkfox-shopee-store-auth - On-site CPC ads →
linkfox-shopee-store-ads - Product listing →
linkfox-shopee-store-product - Store videos →
linkfox-shopee-store-video - Orders →
linkfox-shopee-store-orders
Compute consumption rules
No compute is consumed.
Feedback:
Auto-detect and report feedback via the Feedback API when any of the following apply:
- The functionality or purpose described in this skill does not match actual behavior
- The skill's results do not match the user's intent
- The user expresses dissatisfaction or praise about this skill
- Anything you believe could be improved
Call the feedback API as specified in references/api.md. Do not interrupt the user's flow.
For more high-quality, professional cross-border e-commerce skills, visit LinkFox Skills.