Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
linkfox-ai avatar

Linkfox Amazon Store Auth

  • 232 installs
  • 64 repo stars
  • Updated August 3, 2026
  • linkfox-ai/linkfox-skills

Helps with ai & agent building tasks.

About

linkfox-amazon-store-auth is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.

  • linkfox-amazon-store-auth
  • AI & Agent Building
  • AI-coding skill

Linkfox Amazon Store Auth by the numbers

  • 232 all-time installs (skills.sh)
  • +35 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #2,650 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/linkfox-ai/linkfox-skills --skill linkfox-amazon-store-auth

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs232
repo stars64
Last updatedAugust 3, 2026
Repositorylinkfox-ai/linkfox-skills

What it does

Helps with ai & agent building tasks.

Files

SKILL.mdMarkdownGitHub ↗

Amazon 店铺授权与管理

本 skill 负责 亚马逊卖家店铺的 OAuth 授权、已授权店铺列表、访问令牌获取与刷新,是拉取报告、查询库存、同步订单等所有下游操作的前置依赖。

📌 Related skill:如果用户需要 拉取亚马逊店铺报告(库存 / 订单 / 销售 / 财务报告等),请切换到 linkfox-amazon-store-report。该 skill 依赖本 skill 提供的授权与令牌能力。

Core Concepts

Selling Partner API 是亚马逊为卖家提供的官方接口。本 skill 负责 OAuth 2.0 授权流程与令牌生命周期管理:

授权流程:生成授权 URL → 用户在 Amazon 完成授权 → Amazon 回调并附带授权码 → 系统用授权码换取令牌 → 令牌安全保存。

店铺名(`sellerName`)必填:调用 /spApi/authorizeUrl必须向用户询问并获取一个清晰、非空的店铺名。它用来在"已授权店铺列表"中标记该账号;不要留空或使用空白字符串。

令牌生命周期accessToken 通常 1 小时过期;refreshToken 用于在不重新授权的前提下续签新的 accessToken

Data Fields

Authorization URL Response

FieldTypeDescription
authorizeUrlstring让用户在浏览器打开的 Amazon 授权链接

Authorized Store Item

FieldTypeDescription
sellerIdstringAmazon Seller ID (Merchant ID)
sellerNamestring店铺名(授权时必填)
regionstring市场区域代码 NA / EU / FE

Store Tokens

FieldTypeDescription
accessTokenstring调用亚马逊开放接口的凭证
refreshTokenstring用于续签 accessToken
expiresInintegeraccessToken 过期秒数
tokenTypestring通常为 "bearer"

Supported Regions

CodeNameMarketplaces
NA北美美国、加拿大、墨西哥
EU欧洲英国、德国、法国、意大利、西班牙、荷兰等
FE远东日本、澳大利亚、新加坡、印度

默认区域为 NA。当用户未指定区域时,使用 NA。

API Usage

本 skill 经 LinkFox 网关调用店铺授权相关接口,详见 references/api.md

Available Scripts

  • scripts/authorize_url.py — 为新店铺生成授权 URL(sellerName 必填)
  • scripts/authorized_stores.py — 列出所有已授权店铺
  • scripts/refresh_token.py — 刷新某店铺的访问令牌
  • scripts/store_tokens.py — 查询某店铺的访问令牌(供下游 skill 使用)

Usage Scenarios

Scenario 1: Authorize New Store

User request:「我要授权我的亚马逊北美站点」

Steps: 1. 询问店铺名 `sellerName`(若用户未提供)。/spApi/authorizeUrl 要求 sellerName 为非空字符串;向用户说明这只是在 LinkFox 里识别店铺的标签,建议与 Seller Central 后台名字保持一致。 2. 调用 /spApi/authorizeUrl,传入 regionsellerName 3. 把返回的 authorizeUrl 给用户,让其在浏览器中打开 4. 用户在 Amazon 完成授权 → Amazon 回调系统 → 系统自动保存授权 5. 可选:调用 /spApi/authorizedStores 确认授权成功

Scenario 2: View Authorized Stores

User request:「列一下我已授权的亚马逊店铺」

Steps: 1. 调用 /spApi/authorizedStores 2. 展示店铺列表(sellerName / sellerId / region) 3. 按 sellerId、region 排序

Scenario 3: Refresh Expired Token

User request:「我店铺的令牌过期了,帮我刷新」

Steps: 1. 调用 /spApi/refreshToken,传入 sellerId(可选 region) 2. 返回新的 accessToken / refreshToken 3. 数据库自动更新令牌信息

Scenario 4: Query Store Tokens

User request:「获取北美站点 A123 店铺的访问令牌」

Steps: 1. 调用 /spApi/storeTokens,传入 sellerIdregion 2. 返回全部令牌信息(供下游业务调用)

Scenario 5: Prepare Tokens for Any Store Operation (Standard Preparation Workflow)

当用户提出任何涉及卖家后台数据的请求(拉报告、查库存、看订单等),本 skill 负责前置的"选店 → 取令牌"流程,具体业务由相应的下游 skill 接手。

Steps: 1. 列出已授权店铺:调用 /spApi/authorizedStores 2. 让用户选择店铺:如果有多家店铺,请用户明确选哪一家 3. 获取该店铺令牌:调用 /spApi/storeTokens,传入所选店铺的 sellerIdregion 4. 把 `accessToken` 交给下游 skill(例如 linkfox-amazon-store-report)执行具体操作

Why this workflow is critical

  • 用户可能同时授权了多家不同区域的店铺
  • 每家店铺的令牌与权限彼此独立
  • 调用必须使用与店铺匹配的令牌,跳过"选店"会导致歧义和错误

Display Rules

1. 先有店铺名再生成授权链接:若用户未提供 sellerName必须先问,不允许带空值调用 /spApi/authorizeUrl。 2. 只呈现数据:展示授权结果、店铺列表、令牌信息即可,不做业务建议。 3. 安全意识:不要明文显示完整的 accessToken/refreshToken,只展示前 10 个字符等掩码形式。 4. 清晰引导:返回授权链接时,明确告知用户在浏览器中打开并完成授权。 5. 错误说明:授权失败时,基于错误码解释原因并给出建议。 6. 成功确认:授权完成后与用户确认,可选择展示该店铺基本信息。

Important Limitations

  • sellerName 必填/spApi/authorizeUrl 必须传入非空 sellerName;脚本与 agent 在调用前务必校验。
  • 令牌有效期accessToken 1 小时过期,需及时刷新。
  • 区域专属:每次店铺授权都与具体区域绑定,不同区域需分别授权。
  • 用户隔离:用户只能查看/管理自己授权的店铺。
  • 回调白名单:系统回调 URL 必须在授权方(紫鸟)处加白名单。

User Expression & Scenario Quick Reference

Applicable — 授权与令牌管理场景:

User SaysScenario
"授权我的亚马逊店铺" / "Authorize my Amazon store"新店铺授权
"看看已授权的亚马逊店铺" / "Show my authorized stores"列出已授权店铺
"令牌过期了" / "My token expired"刷新令牌
"获取 XXX 店铺的访问令牌" / "Get access token for store"查询店铺令牌
"绑定我的亚马逊账号" / "Connect my Amazon seller account"新店铺授权

Not applicable — 超出本 skill 的业务:

  • 拉取亚马逊报告 → 请使用 linkfox-amazon-store-report
  • 产品 listing 管理、订单处理、库存管理、广告投放 → 由其他 skill 负责

Boundary judgment

  • 本 skill 只负责「授权 + 管店铺 + 管令牌 + 为下游准备 accessToken」。
  • 当用户要做具体卖家后台业务(如拉报告)时:

1. 本 skill 执行 Scenario 5 的标准前置流程 2. 随后切换到对应下游 skill 完成业务逻辑

  • 不要直接越过本 skill 去调具体 Amazon 开放接口。

Quick Reference

Authorization & Token Management APIs

APIPathPurposeAuth Required
Get Authorization URL/spApi/authorizeUrl生成授权链接(需要 sellerName)✅ Yes
List Authorized Stores/spApi/authorizedStores查询用户的店铺列表✅ Yes
Refresh Token/spApi/refreshToken刷新访问令牌✅ Yes
Query Store Tokens/spApi/storeTokens获取某店铺的令牌(给下游 skill 用)✅ Yes

详细请求参数、响应结构、错误码,见 references/api.md。完整授权流程图,见 references/authorization-flow.md。快速上手示例,见 references/quick-start.md

Feedback

当出现以下任一情况时,自动通过 Feedback API 上报反馈: 1. 本 skill 描述的功能与实际行为不符 2. skill 的结果与用户意图不符 3. 用户表达了对本 skill 的不满或赞赏 4. 任何你认为可以改进的点

references/api.md 中的规范调用 Feedback API,不要打断用户的主流程。

<!-- LF_LARGE_RESPONSE_BLOCK -->

Handling Large Responses

To avoid overflowing the agent context, persist the response to disk and extract only the fields you need:

python scripts/response_io.py run --script scripts/authorize_url.py --out-dir <DIR> '<params>'
python scripts/response_io.py read <file> --fields "<paths>"   # or --path "<JMESPath>"
Pick --out-dir outside any git working tree (e.g. /tmp/... on Unix, %TEMP%/... on Windows). Persisted responses may contain PII, pricing, or auth-sensitive data — do not commit them. Files are not auto-deleted; clean up when the task is done.
This skill exposes multiple entry scripts: authorize_url.py, authorized_stores.py, refresh_token.py, store_tokens.py. Pass --script scripts/<name>.py to choose the one you need.

run writes the full response to a file and emits only a schema preview + file path. read projects specific fields, with --limit/--offset for slicing and --format json|jsonl|csv|table for output.

When to prefer this pattern — apply your judgment based on the response characteristics, e.g.:

  • High field count per record, or fields you don't need
  • Batch/paginated results (multiple items per call)
  • Long-text fields (descriptions, reviews, HTML, time series)
  • Output reused across later steps rather than consumed immediately

For small, single-use responses, calling the main script directly is fine.

⚠️ The preview is a truncated schema + sample, not the full data. Any field-level decision must read from the persisted file via read. <!-- /LF_LARGE_RESPONSE_BLOCK -->

--- For more high-quality, professional cross-border e-commerce skills, visit [LinkFox Skills](https://skill.linkfox.com/).

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.