亚马逊-店铺授权
亚马逊卖家店铺授权与账号连接管理。用于生成授权链接、绑定店铺、查询已授权店铺、检查授权状态、刷新访问令牌和本地取消/解绑授权;生成授权链接时需要 sellerName 区分店铺。用户提到亚马逊店铺授权、绑定或连接 Amazon Seller 账号、查看已授权店铺、授权失效、刷新令牌、token 状态、取消授权、解绑店铺、停用授权、Amazon seller authorization、bind seller account、refresh access token、disconnect seller account 时触发。即使未明确说“授权”,只要其他亚马逊店铺操作因未绑定店铺、凭证过期或需要选择授权账号而无法继续,也应触发此技能。 Skill: 亚马逊-店铺授权 Owner: linkfox-ai Summary: 亚马逊卖家店铺授权与账号连接管理。用于生成授权链接、绑定店铺、查询已授权店铺、检查授权状态、刷新访问令牌和本地取消/解绑授权;生成授权链接时需要 sellerName 区分店铺。用户提到亚马逊店铺授权、绑定或连接 Amazon Seller 账号、查看已授权店铺、授权失效、刷新令牌、token 状态、取消授权、解绑店铺、停用授权、Amazon seller authorization、bind seller account、refresh access token、disconnect seller account 时触发。即使未明确说“授权”,只要其他亚马逊店铺操作因未绑定店铺、凭证过期或需要选择授权账号而无法继续,也应触发此技能。 Tags: latest:1.0.8 Version history: v1.0.8 | 2026-09-14
Rank
62
Safety
84
Downloads
1.7k
Updated
Oct 10, 2026
Version
1.0.8
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.7K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 10, 2026
- Adoption signal
- 1.7K downloadsadoption · observed Oct 10, 2026
- Latest release
- 1.0.8release · observed Sep 14, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s171g8b6m2khwdy9ye8bxj0wx183vd4z:linkfox-amazon-store-auth- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-auth/snapshot"
Documentation
CLAWHUB
146,301 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: linkfox-amazon-store-auth
description: 亚马逊卖家店铺授权与账号连接管理。用于生成授权链接、绑定店铺、查询已授权店铺、检查授权状态、刷新访问令牌和本地取消/解绑授权;生成授权链接时需要 sellerName 区分店铺。用户提到亚马逊店铺授权、绑定或连接 Amazon Seller 账号、查看已授权店铺、授权失效、刷新令牌、token 状态、取消授权、解绑店铺、停用授权、Amazon seller authorization、bind seller account、refresh access token、disconnect seller account 时触发。即使未明确说“授权”,只要其他亚马逊店铺操作因未绑定店铺、凭证过期或需要选择授权账号而无法继续,也应触发此技能。
---
# Amazon 店铺授权与管理
本 skill 负责 **亚马逊卖家店铺的 OAuth 授权、已授权店铺列表、授权状态查询、令牌刷新与本地取消授权**,是拉取报告、查询库存、同步订单等所有下游操作的前置依赖。下游业务经 `developerProxy` 传入 `sellerId`+`region` 即可,**无需**先取 raw token。
> 📌 **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
| Field | Type | Description |
|-------|------|-------------|
| authorizeUrl | string | 让用户在浏览器打开的 Amazon 授权链接 |
### Authorized Store Item
| Field | Type | Description |
|-------|------|-------------|
| sellerId | string | Amazon Seller ID (Merchant ID) |
| sellerName | string | 店铺名(授权时必填) |
| region | string | 市场区域代码 NA / EU / FE |
### Store Tokens(授权状态,非 raw token 下发)
`POST /spApi/storeTokens` 返回**状态与元数据**(具体字段以网关为准),供确认授权是否有效、何时过期。**不要**将响应当作下游 `developerProxy` 的 token 来源。
| Field | Type | Description |
|-------|------|-------------|
| status | string | 授权/令牌状态(如有效、过期、缺失) |
| authRecordId | integer | 授权记录 ID(如有) |
| expiresIn | integer | 距 accessToken 过期的秒数(如有) |
| tokenExpiresAt | string | 绝对过期时间(如有) |
| message | string | 补充说明 |
| errcode / errmsg | integer / string | 网关错误(失败时) |
> 兼容说明:旧版网关可能仍返回 `accessToken`/`refreshToken`;Agent **不应**优先读取或传递给下游。下游应使用 `sellerId`+`region` 调 `developerProxy`。
## Supported Regions
| Code | Name | Marketplaces |
|------|------|--------------|
| NA | 北美 | 美国、加拿大、墨西哥 |
| EU | 欧洲 | 英国、德国、法国、意大利、西班牙、荷兰等 |
| FE | 远东 | 日本、澳大利亚、新加坡、印度 |
默认区域为 **NA**;解绑时按 Scenario 5 明确目标区域。
## 调用方式
- **API 端点**:`POST /spApi/{authorizeUrl|storeTokens|authorizedStores|refreshToken|cancelAuthorization}`(完整参数/响应/错误码见 `references/api.md`)
- **Python 脚本**:`python scripts/<脚本名>.py '<JSON 参数>' [--inline]`(可用脚本见上文)
- **成本约束**:本工具会消耗算力;失败/空结果不得自动连续试探;需要继续检索时先向用户说明会产生额外消耗。
**输出策略(脚本默认行为)**:
- **始终**将完整响应写入 `<cwd>/linkfox/<YYYY-MM-DD>/<session>/data/<skill-name>-<timestamp>.json`(`<cwd>` 为脚本执行时的工作目录,在 Claude Code 里即当前项目目录;`<session>` 取自环境变量 `SESSION_ID`,按用户任务自动聚合;**禁止写入 /tmp**,当前目录不可写则报错)
- 响应体 ≤ 8 KB:落盘后把完整 JSON 打印到 stdout
- 响应体 > 8 KB:落盘后 stdout 只输出摘要(顶层字段、常见计数、最大列表字段的长度 + 前 3 条样本)
- 加 `--inline` 强制全量打印到 stdout(同样落盘)
**读数据建议**:先看摘要判断是否足够;需要具体字段时优先用 `jq`或`ConvertFrom-Json` 从保存的 json 文件按需抽取,避免整份 JSON 进入上下文。
## 解决认证和算力问题
发生以下异常情况时,采用 references/onboarding.md 引导README.md
# Amazon Store Authorization Skill
亚马逊店铺 **授权与管理** Skill,提供授权流程、令牌管理、店铺查询、本地取消/解绑授权等能力,是所有下游业务 skill(如 `linkfox-amazon-store-report`)的前置依赖。
## 📋 目录结构
```
linkfox-amazon-store-auth/
├── SKILL.md # Skill 主文档
├── _meta.json # Skill 元数据
├── README.md # 本文件
├── references/
│ ├── api.md # API 详细说明
│ ├── authorization-flow.md # 完整授权流程
│ └── quick-start.md # 5 分钟快速授权
└── scripts/
├── README.md # 脚本使用指南
├── authorize_url.py # 生成授权 URL
├── authorized_stores.py # 列出已授权店铺
├── refresh_token.py # 刷新访问令牌
├── store_tokens.py # 查询授权状态
└── cancel_authorization.py # 本地取消/解绑授权
```
## 🚀 快速开始
### 1. 授权新店铺
```bash
POST /spApi/authorizeUrl
{
"region": "NA",
"sellerName": "My Store" # ⚠️ 必填:用于识别该授权店铺
}
# 在浏览器打开返回的 authorizeUrl
```
### 2. 查看已授权店铺
```bash
POST /spApi/authorizedStores
```
### 3. 查询授权状态
```bash
POST /spApi/storeTokens
{
"sellerId": "A1234567890",
"region": "NA"
}
```
### 4. 本地取消/解绑授权
```bash
POST /spApi/cancelAuthorization
{
"sellerId": "A1234567890",
"region": "NA"
}
```
说明:该接口只在 LinkFox 本地解绑/停用授权,不代表 Amazon Seller Central 侧 OAuth 授权已撤销。
## 🔗 关联 Skill
| Skill | 说明 |
|-------|------|
| `linkfox-amazon-store-report` | 获取亚马逊报告(依赖本 skill) |
## 🌍 支持的区域
- **NA**:美国、加拿大、墨西哥
- **EU**:英国、德国、法国、意大利、西班牙等
- **FE**:日本、澳大利亚、新加坡、印度
## 🔐 安全特性
- ✅ 用户级数据隔离
- ✅ 令牌自动刷新
- ✅ 完整错误处理
- ✅ HTTPS 加密
## 🔄 版本历史
- **v1.0.0**(2026-04-24)
- 从早期综合亚马逊 skill 拆分而来
- 保留所有授权、店铺管理、令牌管理能力
- 报告相关能力已拆出至 `linkfox-amazon-store-report`
## 📄 许可
本 Skill 是 LinkFoxAgent 项目的一部分。scripts/README.md
# Amazon Store Auth Scripts Usage Guide
本目录包含 **授权与店铺/令牌管理** 相关的 Python 脚本。若需要拉取报告,请使用 `linkfox-amazon-store-report` skill。
## Prerequisites
- Python 3.6 或更高
- 已设置 `LINKFOXAGENT_API_KEY` 环境变量
- 可访问 LinkFox 后端 API(默认 `https://tool-gateway.linkfox.com`)
```bash
export LINKFOXAGENT_API_KEY="your-api-key-here"
```
## Available Scripts
### 1. authorize_url.py
为新店铺生成授权 URL。
**`sellerName`(店铺名)必填**:必须为非空字符串。脚本会在缺失或为空白时直接退出并报错——调用前请先向用户询问一个可识别的店铺名。
```bash
python authorize_url.py '{"region": "NA", "sellerName": "My Store"}'
```
### 2. authorized_stores.py
列出当前用户已授权的所有亚马逊店铺。
```bash
python authorized_stores.py
```
### 3. refresh_token.py
刷新某店铺的 accessToken。
```bash
python refresh_token.py '{"sellerId": "A1234567890", "region": "NA"}'
```
### 4. store_tokens.py
查询某店铺的授权/令牌状态。响应只用于状态确认,不作为下游 raw token 来源。
```bash
python store_tokens.py '{"sellerId": "A1234567890", "region": "NA"}'
```
### 5. cancel_authorization.py
本地取消/解绑某店铺授权。该脚本调用 `/spApi/cancelAuthorization`,不会撤销 Amazon Seller Central 侧授权。
```bash
python cancel_authorization.py '{"sellerId": "A1234567890", "region": "NA"}'
```
## Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| LINKFOXAGENT_API_KEY | API 鉴权 key | 必需 |
| STORE_API_BASE_URL / SPAPI_BASE_URL | 后端网关 base URL(优先读前者) | https://tool-gateway.linkfox.com |
## Error Codes
- `0`:成功
- `1`:缺少 API key、参数错误、网络/HTTP/权限错误
## Troubleshooting
**API Key 未配置**
```bash
export LINKFOXAGENT_API_KEY="your-key-here"
```
**Connection Refused / 网络错误**
- 确认 `https://tool-gateway.linkfox.com` 能从你的网络访问(或设置 `STORE_API_BASE_URL` / `SPAPI_BASE_URL` 指向其他网关)
- 检查防火墙、代理设置
**403 Unauthorized**
- 店铺可能缺少必要的亚马逊接口权限
- 用更完整的权限集合重新授权
**查询令牌返回 1004**
- 核对 sellerId 与 region
- 确认该店铺已完成授权
## Further Documentation
- API Reference: `../references/api.md`
- 授权流程详解: `../references/authorization-flow.md`
- 快速上手: `../references/quick-start.md`
- Skill 文档: `../SKILL.md`_meta.json
{
"ownerId": "kn7dmc1t4j28hem1twwyav85p182pb1j",
"slug": "linkfox-amazon-store-auth",
"version": "1.0.8",
"publishedAt": 1789361747000
}references/api.md
# Amazon 店铺授权 API Reference
本文档描述 **授权与店铺/令牌管理** 相关的 API。若需经网关代理拉取报告或 **Listing 单条查询** 等,请参考 `linkfox-amazon-store-report`、`linkfox-amazon-store-listings` skill。
## Calling Conventions
- **Base URL**: `${LINKFOX_TOOL_GATEWAY}`(默认 `https://tool-gateway.linkfox.com`;可用 `LINKFOX_TOOL_GATEWAY` 覆盖,兼容旧名 `STORE_API_BASE_URL` / `SPAPI_BASE_URL`)
- **Request Method**: 所有接口均为 POST
- **Content-Type**: `application/json`
- **Authentication**: Header `Authorization: <api_key>`,API key 优先读取环境变量 `LINKFOX_AGENT_API_KEY`,未设置时回退到兼容旧名 `LINKFOXAGENT_API_KEY`(如未配置 按 SKILL.md 的 **## 解决认证和算力问题** 处理)
- **解绑脚本**: `LinkFox-Skill/2.0`;透传 `SESSION_ID` / `MESSAGE_ID` / `MODE_ID` / `APP_NAME`,超时 150s,不缓存、不自动重试。
## API Endpoints
### 1. Get Authorization URL
**Endpoint**: `/spApi/authorizeUrl`
**Request Parameters** (JSON):
| Parameter | Type | Required | Description | Example |
|-----------|------|----------|-------------|---------|
| region | string | Yes | 区域代码:NA / EU / FE | "NA" |
| sellerName | string | **Yes** | 店铺展示名(店铺名)— **必填,非空**;用于在已授权店铺列表中识别账号 | "My Store" |
**Response**:
```json
{
"authorizeUrl": "https://sellercentral.amazon.com/apps/authorize/consent?..."
}
```
> 说明:授权完成后的回调由 Amazon 直接回调服务端内部接口处理,属于系统内部流程,不作为本 skill 的用户调用接口。
---
### 2. List Authorized Stores
**Endpoint**: `/spApi/authorizedStores`
**Request Parameters**: 无(使用当前用户上下文)
**Response**:
```json
{
"stores": [
{
"sellerName": "My Store",
"sellerId": "A1234567890",
"region": "NA"
}
],
"total": 1
}
```
---
### 3. Refresh Token
**Endpoint**: `/spApi/refreshToken`
**Request Parameters** (JSON):
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| sellerId | string | Yes | Seller ID |
| region | string | No | 区域代码(精确匹配可选) |
**Response**:
```json
{
"authRecordId": 123,
"success": true,
"message": "刷新成功并已更新数据库,token 已后台化管理"
}
```
---
### 4. Query Store Tokens
**Endpoint**: `/spApi/storeTokens`
**Request Parameters** (JSON):
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| sellerId | string | Yes | Seller ID |
| region | string | Yes | 区域代码 |
**Response**:
```json
{
"sellerId": "A1234567890",
"region": "NA",
"authRecordId": 123,
"status": "ACTIVE",
"tokenExpiresAt": 3600,
"message": "授权信息已后台化管理,token 不再经由 Agent 返回"
}
```
返回值只用于确认授权状态,不作为下游 token 来源。下游业务应通过 `developerProxy` 传入 `sellerId` + `region`。
---
### 5. Cancel Authorization
**Endpoint**: `/spApi/cancelAuthorization`
**Request Parameters** (JSON):
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| sellerId | string | Yes | 非空 Seller ID,最多 64 字符 |
| region | string | Yes | NA / EU / FE;必传,不支持单站点解绑 |
**Response**:
```json
{
"success": true,
"sellerId": "A1234567890",
"region": "NA",
"removedBindings": 1,
"localAuthorizationRevoked": false,
"amazonRevoked": false,
"message": "已解除当前用户的店铺绑定;授权与 token 保留,其他用户不受影响;未撤销 Amazon 授权"
}
`AionUi
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!
activepieces
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
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-auth",
"sourceUrl": "https://clawhub.ai/linkfox-ai/skills/linkfox-amazon-store-auth",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T04:37:32.751Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-auth/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-auth/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T04:37:32.751Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.7K downloads",
"href": "https://clawhub.ai/linkfox-ai/linkfox-amazon-store-auth",
"sourceUrl": "https://clawhub.ai/linkfox-ai/linkfox-amazon-store-auth",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T04:37:32.751Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.8",
"href": "https://clawhub.ai/linkfox-ai/linkfox-amazon-store-auth",
"sourceUrl": "https://clawhub.ai/linkfox-ai/linkfox-amazon-store-auth",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-09-14T04:55:47.000Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-auth/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-linkfox-ai-linkfox-amazon-store-auth/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.8",
"description": "Update from 1.0.7 to 1.0.8",
"href": "https://clawhub.ai/linkfox-ai/linkfox-amazon-store-auth",
"sourceUrl": "https://clawhub.ai/linkfox-ai/linkfox-amazon-store-auth",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-09-14T04:55:47.000Z",
"isPublic": true
}
]
}Record generated Oct 10, 2026.
