Direct local connection disabled / fixed egress mode available: Due to IP whitelist restrictions on the Lingxing OpenAPI, the local environment cannot access it directly. If a fixed egress gateway has been deployed and
EIPhas been added to the whitelist, this Skill can continue to be used. Before deployment, when Amazon business data is needed, please prioritize switching to Amazon SP-API (MCP:amazon-api)。
Lingxing OpenAPI client foundationThis public version of the Skill is self-contained and does not depend on any private workspace files, internal protocols, or team manuals.
Core features
- Unified management of
access_tokenacquisition and renewal - Generate according to official rules
sign - Encapsulate GET/POST business requests
- Cache key official documentation locally
- Run a minimal smoke test to confirm the
SellerLists -> StoreSales -> Orderlists -> promotionListingListpipeline is available - Provide a shared service layer for the Lingxing MCP and other skills
Environment variables
| Variable name | Required | Description |
|---|---|---|
LINGXING_APP_ID |
Yes | Lingxing Open API App ID |
LINGXING_APP_SECRET |
Yes | Lingxing Open API App Secret |
LINGXING_TOKEN_CACHE_FILE |
No | token cache file path, default runtime/lingxing/token_cache.json |
LINGXING_DOC_ACCESS_KEY |
No | Documentation key used when syncing documentation |
Script Directory
Scripts are located in skills/zach-lingxing-openapi-client/scripts/:
lingxing_client.py: compatibility entry point, actually reuseslib/lingxing_openapi/client.pytimezone_map.py: compatibility entry point, actually reuseslib/lingxing_openapi/timezones.pysync_docs.py: automatically discovers and syncs Amazon-related read-only documentation from the official_sidebar.mdtoreferences/openapi_docs/smoke_check.py: minimal pipeline smoke test
Shared code is located in lib/lingxing_openapi/:
client.py: authentication, renewal, signing, unified request encapsulationservices.py: business-oriented encapsulation for stores, sales, orders, promotions, etc.promotions.py: promotion tag and window normalizationerrors.py: unified errors and promptsmcp.py: MCP tool registration, stdio/HTTP transport layer
Local documentation cache
Sync command:
python3 skills/zach-lingxing-openapi-client/scripts/sync_docs.py
Sync results will be written to:
skills/zach-lingxing-openapi-client/references/openapi_docs/
It will retain the existing 12-page compatibility filenames and automatically expand to more Amazon-related read-only pages. Compatibility pages include:
- GetToken
- RefreshToken
- SellerLists
- AllMarketplace
- StoreSales
- AsinDailyLists
- Orderlists
- promotionListingList
- promotionalActivitiesSecKillList
- promotionalActivitiesManageList
- promotionalActivitiesVipDiscountList
- promotionalActivitiesCouponList
Usage
Scenario 1: Reuse for other skills
Import directly in a Python script:
from lib.lingxing_openapi import LingxingOpenAPIClient, LingxingOpenAPIService
Scenario 2: Sync local documentation
export LINGXING_DOC_ACCESS_KEY="你的文档密钥"
python3 skills/zach-lingxing-openapi-client/scripts/sync_docs.py
Scenario 3: Smoke test
export LINGXING_APP_ID="ak_xxx"
export LINGXING_APP_SECRET="xxx"
python3 skills/zach-lingxing-openapi-client/scripts/smoke_check.py
Common rules
- All business APIs use
https://openapi.lingxing.com - All business APIs must include
access_token / app_key / timestamp / sign signGeneration rules strictly follow the official instructions:- All business parameters + 3 common parameters participate in signing together
- ASCII sort
- Empty strings do not participate,
nullparticipates - After concatenation, first perform
MD5(32位大写) - then use
appIdto performAES/ECB/PKCS5PADDING - Finally, URL encode when transmitting as a Query parameter
Output
- Local references documentation cache
- token cache file
- Smoke test JSON output
Dependency environment
- Python 3.11+
- System built-in
openssl
Risks and Boundaries
- risk-level: low — Only interface integration and authentication configuration are performed; no business data is written
Upstream / Downstream
- Upstream: None (foundational base Skill, requires environment variables to be configured)
- Downstream:
zach-lingxing-mcp(MCP service layer) and other scripts or Skills that depend on Lingxing data
After completion
Report completion status: DONE / DONE_WITH_CONCERNS / BLOCKED / NEEDS_CONTEXT