TTokenySpace
返回 Skills 列表

Shopee-店铺授权

Shopee(虾皮)店铺授权与管理技能,提供完整的授权流程、已授权店铺查询以及访问令牌读取能力。授权时可填写店铺名 shopName 便于识别,region 支持 cn / global / br。当用户提到 Shopee 店铺授权、虾皮店铺绑定、授权虾皮店铺、查询已授权 Shopee 店铺、获取 Shopee...

#中文
0

安装到 Tokeny(自动)

下载 ZIP
安装"linkfox-shopee-store-auth"技能
技能信息:
- 名称: Shopee-店铺授权
- 标识: linkfox-shopee-store-auth
- 描述: Shopee(虾皮)店铺授权与管理技能,提供完整的授权流程、已授权店铺查询以及访问令牌读取能力。授权时可填写店铺名 shopName 便于识别,region 支持 cn / global / br。当用户提到 Shopee 店铺授权、虾皮店铺绑定、授权虾皮店铺、查询已授权 Shopee 店铺、获取 Shopee...
- 版本: 1.0.0
下载地址:
https://www.tokeny.space/api/skills/linkfox-shopee-store-auth/download
继续

复制上方内容到 Tokeny 客户端并在会话中发送即可自动安装;也可直接 下载 ZIP并拖动到技能窗口安装。

SKILL.md

Shopee 店铺授权与管理

Shopee Open Platform 的 OAuth 授权、已授权店铺列表、访问令牌读取。下游业务的前置依赖(经 /shopee/developerProxy 调用开放接口)。

Core Concepts

  • 授权流程:生成 URL → 用户浏览器授权 → Shopee 推送 Token → 系统按 state 落库
  • 店铺标识shopIdmerchantId 二选一即可定位授权;一次授权可含多个 shop(见 shopIdList
  • shopName 建议填写:调 authorize_url.py 前建议问用户要一个便于识别的店铺名(API 非必填)
  • accessToken 约 4 小时有效expireIn 通常 14400);当前网关无独立刷新接口,过期需重新授权

可用脚本

脚本作用
authorize_url.py生成授权 URL(可选 shopName / region
authorized_stores.py列出已授权店铺
store_tokens.py查 token(供下游使用)

入参、响应字段、错误码见 references/api.md

调用方式

  • API 端点POST /shopee/{authorizeUrl|storeTokens|authorizedStores}(完整参数/响应/错误码见 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(同样落盘)

读数据建议:先看摘要判断是否足够;需要具体字段时优先用 jqConvertFrom-Json 从保存的 json 文件按需抽取,避免整份 JSON 进入上下文。

解决认证和积分问题

发生以下异常情况时,采用以下措施来处理:

异常情况

  • 未配置API Key:环境变量未配置 LINKFOX_AGENT_API_KEY,也未配置 LINKFOXAGENT_API_KEY
  • 响应401或402状态码
  • 响应提示积分或余额不足:消息含"积分余额不足/计费不足/余额不足/quota exceeded/insufficient balance/套餐到期/需充值/请充值",或类似含义的内容。

措施

支持区域

cn(中国跨境,默认) / global(全球授权页) / br(巴西)。默认 cn

Usage Scenarios

1. 新授权店铺

  1. 建议问用户要 shopName(便于后续识别;API 非必填)
  2. 确认 region(默认 cn;全球站 global,巴西 br
  3. authorize_url.py 拿 URL → 给用户在浏览器打开(安全警告:为保障店铺安全,请务必在日常运营该店铺的安全网络环境中打开此链接。强烈建议使用紫鸟浏览器等专业的防关联浏览器进行授权,切勿在陌生或公共网络下操作。)
  4. 授权完成后系统自动存 token;浏览器跳转成功/失败页
  5. 可选:调 authorized_stores.py 确认

2. 列已授权店铺

authorized_stores.py,展示 shopName / shopId / merchantId / region

3. 给下游准备 accessToken(高频)

用户只说自然语言("我的虾皮店"、"67890 那家店"),不要让用户报冗长 token

用户上下文Agent 动作
只授权 1 家店铺直接取该店铺 shopId,不问
授权 ≥ 2 家 + 只说店名shopName 向用户澄清
同时给出 shopName 或 shopId直接定位
显式给出 shopId / merchantId直接用

静默原则:定位成功时不播报完整 accessToken;脚本已做掩码,不要在摘要里还原。

流程:先 authorized_stores.py 选店 → 再 store_tokens.py(传 shopIdmerchantId)→ 将 accessToken 交给 /shopee/developerProxy

调用原则

  • 授权前建议确认 shopNameregion
  • 不输出完整 accessToken / refreshToken;脚本已做掩码,不要在摘要里还原
  • 授权失败按错误码解释原因;不擅自重试
  • 令牌过期须重新走授权流程(无 refreshToken 公开接口)

常见问题

授权完成但查不到店铺

原因:Token 推送回调(/shopee/oauth/tokenCallback)未成功落库,或 state 不匹配。 解决:查看服务日志;重新调 authorize_url.py 完成授权。

查令牌返回 1004

原因:shopId / merchantId 错误,或授权不属于当前用户。 解决:先调 authorized_stores.py 核对店铺信息。

Not Applicable

  • Shopee 订单查询与处理linkfox-shopee-store-orders
  • Shopee 店铺信息与设置linkfox-shopee-store-shop
  • Shopee 店铺商品 listinglinkfox-shopee-store-product
  • Shopee 跨境全球商品 GlobalProductlinkfox-shopee-store-global-product
  • Shopee 跨境商户信息 Merchantlinkfox-shopee-store-merchant
  • Shopee 物流发货 Logisticslinkfox-shopee-store-logistics
  • Shopee 退货退款 Returnslinkfox-shopee-store-returns
  • Shopee 站内广告 Adslinkfox-shopee-store-ads
  • Shopee 支付结算 Paymentlinkfox-shopee-store-payment
  • Shopee 联盟营销 AMSlinkfox-shopee-store-ams
  • Shopee 店铺视频 Videolinkfox-shopee-store-video
  • Shopee 媒体上传 MediaSpacelinkfox-shopee-store-media-space
  • Shopee 媒体上传 Medialinkfox-shopee-store-mediaapi/v2/media/...,module=130)
  • Shopee 头程物流 FirstMilelinkfox-shopee-store-first-mile
  • Shopee 折扣促销 Discountlinkfox-shopee-store-discount
  • Shopee 套装优惠 Bundle Deallinkfox-shopee-store-bundle-deal
  • Shopee 加购优惠 Add-On Deallinkfox-shopee-store-add-on-deal
  • Shopee 店铺优惠券 Voucherlinkfox-shopee-store-voucher
  • Shopee 店铺秒杀 Shop Flash Salelinkfox-shopee-store-shop-flash-sale
  • Shopee 关注有礼 Follow Prizelinkfox-shopee-store-follow-prize
  • Shopee 精选商品 Top Pickslinkfox-shopee-store-top-picks
  • Shopee 店铺分类 Shop Categorylinkfox-shopee-store-shop-category
  • Shopee 账户健康 Account Healthlinkfox-shopee-store-account-health
  • Shopee Public 公共模块linkfox-shopee-store-publicv2.public.* 底层 OAuth / Partner 查询)
  • Shopee Push 推送机制linkfox-shopee-store-push
  • Shopee SBS 仓储服务linkfox-shopee-store-sbs
  • Shopee FBS 巴西仓储linkfox-shopee-store-fbs
  • Shopee 直播 Livestreamlinkfox-shopee-store-livestream
  • Shopee 选品(友鹰) → linkfox-youying-shopee-product-search
  • 商品 listing 管理 → 专用 product skill 或 developerProxy 商品 API

积分消耗规则

不消耗积分。

Feedback:

Auto-detect and report feedback via the Feedback API when any of the following apply:

  1. The functionality or purpose described in this skill does not match actual behavior
  2. The skill's results do not match the user's intent
  3. The user expresses dissatisfaction or praise about this skill
  4. 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.

评论

加载中…