设计与多媒体

亚马逊-店铺External Fulfillment

试用

亚马逊店铺 External Fulfillment(与 linkfox-amazon-store-auth / orders / listings 同系列),经 /spApi/developerProxy 调用 SP-API External Fulfillment v2024-09-11:Inventory 的 batchInventory(按 location 查/写库存);Shipping 的 getShipments、getShipment、processShipment、createPackages、updatePackage、updatePackageStatus、retrieveShippingOptions、generateInvoice、retrieveInvoice、generateShipLabels;Returns 的 listReturns、getReturn。覆盖 Seller Flex / Easy Ship / Self Ship / MFN Self Delivery 等。当用户提到 External Fulfillment、SmartConnect、Seller Flex、FBA Onsite、Easy Ship、Self Ship、batchInventory、location 库存、履约单 shipment、面单、发票、EF 退货、externalFulfillment 时触发。与普通 Orders/Feeds 库存不同,本技能专指 External Fulfillment API。

它能做什么

亚马逊店铺 External Fulfillment(与 linkfox-amazon-store-auth / orders / listings 同系列),经 /spApi/developerProxy 调用 SP-API External Fulfillment v2024-09-11:Inventory 的 batchInventory(按 location 查/写库存);Shipping 的 getShipments、getShipment、processShipment、createPackages、updatePackage、updatePackageStatus、retrieveShippingOptions、generateInvoice、retrieveInvoice、generateShipLabels;Returns 的 listReturns、getReturn。覆盖 Seller Flex / Easy Ship / Self Ship / MFN Self Delivery 等。当用户提到 External Fulfillment、SmartConnect、Seller Flex、FBA Onsite、Easy Ship、Self Ship、batchInventory、location 库存、履约单 shipment、面单、发票、EF 退货、externalFulfillment 时触发。与普通 Orders/Feeds 库存不同,本技能专指 External Fulfillment API。

技能文档

Amazon 店铺 External Fulfillment

本 skill 与 linkfox-amazon-store-auth 等同属 Amazon Store 系列:依赖 linkfox-amazon-store-auth 选店(sellerId+region);直接 POST /spApi/developerProxy 传入 sellerId+region,由服务端解析 token(勿传 amzAccessToken,除非兼容旧调用)。转发上游 GET / POST / PUT / PATCH

适用渠道:Seller Flex / FBA Onsite、Multi Seller Flex、Easy Ship、Self Ship、MFN Self Delivery、Amazon Pharmacy 等(以商家 allowlist 与角色为准)。

调用方式

  • API 端点POST /spApi/developerProxy(完整参数/响应见 references/api.md
  • Python 脚本python scripts/<脚本名>.py '' [--inline]
  • 成本约束:本工具会消耗积分;失败/空结果不得自动翻页或连续试探;需要继续时先向用户说明会产生额外消耗。

输出策略(脚本默认行为)

  • 始终将完整响应写入 /linkfox///data/linkfox-amazon-store-external-fulfillment-.json
  • 响应体 ≤ 8 KB:落盘后把完整 JSON 打印到 stdout
  • 响应体 > 8 KB:落盘后 stdout 只输出摘要
  • --inline 强制全量打印(同样落盘)

读数据建议:先看摘要;需要具体字段时用 jq / ConvertFrom-Json 从落盘文件抽取。

解决认证和积分问题

发生以下异常情况时,采用 references/onboarding.md 引导解决问题:

异常情况

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

官方参考索引

模块能力文档
InventorybatchInventorybatchInventory
ShippinggetShipmentsgetShipments
ShippinggetShipmentgetShipment
ShippingprocessShipmentprocessShipment
ShippingcreatePackagescreatePackages
ShippingupdatePackageupdatePackage
ShippingupdatePackageStatusupdatePackageStatus
ShippingretrieveShippingOptionsretrieveShippingOptions
ShippinggenerateInvoicegenerateInvoice
ShippingretrieveInvoiceretrieveInvoice
ShippinggenerateShipLabelsgenerateShipLabels
ReturnslistReturnslistReturns
ReturnsgetReturngetReturn

Prerequisites(必须先读)

本 skill 依赖 linkfox-amazon-store-auth

  1. 运行 python scripts/check_auth_dependency.py;若 exit code 42 且 stderr 含 DEPENDENCY_MISSING:,请先安装 linkfox-amazon-store-auth
  2. 不要在本 skill 内绕过依赖实现授权或令牌逻辑。
  3. 商家需 External Fulfillment allowlist,应用需 Direct-to-Consumer Shipping (Restricted) 角色。

Current Capabilities(脚本一览)

能力developerProxy path(要点)脚本
batchInventoryexternalFulfillment/inventory/2024-09-11/inventories,POSTpost_batch_inventory.py
getShipmentsexternalFulfillment/2024-09-11/shipments + Queryget_shipments.py
getShipment.../shipments/{shipmentId}get_shipment.py
processShipment.../shipments/{shipmentId}?operation=,POSTprocess_shipment.py
createPackages.../shipments/{shipmentId}/packages,POSTcreate_packages.py
updatePackage.../shipments/{shipmentId}/packages/{packageId},PUTupdate_package.py
updatePackageStatus同上 path,PATCHupdate_package_status.py
retrieveShippingOptions.../shipments/{shipmentId}/shippingOptions + packageIdretrieve_shipping_options.py
generateInvoice.../shipments/{shipmentId}/invoice,POSTgenerate_invoice.py
retrieveInvoice同上 path,GETretrieve_invoice.py
generateShipLabels.../shipments/{shipmentId}/shipLabels?operation=,PUTgenerate_ship_labels.py
listReturnsexternalFulfillment/2024-09-11/returns + Querylist_returns.py
getReturn.../returns/{returnId}get_return.py

共享逻辑见 scripts/_spapi_ef_common.py(仅供同目录脚本 import)。


Quick Parameters(摘要)

  • batchInventoryrequests 1~10 条。简化项:action=fetch|updatelocationIdskuId;update 必填 quantity。MFN 单仓常用 locationId=DEFAULT;Seller Flex 用 4 位仓码。高级:useAmazonRequestShape:true 直传官方 requests
  • getShipments:必填 status(如 ACCEPTED/CREATED);可选 locationIdmarketplaceIdchannelNamelastUpdatedAfter/BeforemaxResultspaginationToken
  • processShipmentoperation=CONFIRM|REJECT;REJECT 时可传 referenceId/lineItemsrequestBody
  • createPackages / updatePackage:包裹尺寸重量与 packageLineItems 按官方 schema 放在 packagesrequestBody
  • updatePackageStatus:主要用于 Self Delivery;传 status/subStatus/reason
  • generateShipLabelsoperation=GENERATE|REGENERATE;可选 shippingOptionIdpackageIds
  • listReturns:可选 status(新退货常用 CREATED)、returnLocationId、时间窗、nextToken

典型履约流程:getShipmentsprocessShipment(CONFIRM)createPackagesretrieveShippingOptionsgenerateInvoicegenerateShipLabels →(Self Delivery)updatePackageStatus


Scripts

export LINKFOXAGENT_API_KEY=""

python scripts/post_batch_inventory.py '{"sellerId":"A1...","region":"NA","requests":[{"action":"fetch","locationId":"DEFAULT","skuId":"SKU-1","marketplaceAttributes":{"marketplaceId":"ATVPDKIKX0DER","channelName":"MFN"}}]}'

python scripts/get_shipments.py '{"sellerId":"A1...","region":"NA","status":"ACCEPTED","locationId":"ABCD"}'

python scripts/process_shipment.py '{"sellerId":"A1...","region":"NA","shipmentId":"...","operation":"CONFIRM"}'

Display Rules

  1. 先看网关 developerProxy.errcode / httpStatus,再解析脚本附加字段(如 batchInventoryshipmentsinvoice)。
  2. batchInventory 成功时常为 207 Multi-Status;逐条看 responses[].status
  3. 多数写操作成功可能为 204(无 body);stdout 会标 success: true
  4. 发票/面单文档多为 Base64 或预签名 URL,勿把整段大 base64 反复贴进上下文。
  5. 路径白名单:若返回 1005,需后端放行 externalFulfillment/ 前缀。

Important Limitations

  • 权限:Direct-to-Consumer Shipping (Restricted);商家需 allowlist。
  • 写库存为绝对值发布,非增量;只同步有变化的 SKU;SKU 特殊字符需 URL 编码(脚本已处理简化入参)。
  • linkfox-amazon-store-orders(普通 Orders)、linkfox-amazon-store-feeds(Feed 改库存)、linkfox-amazon-store-report(库存报告)边界不同,勿混用。
  • Seller Flex 上 retrieveShippingOptions 常返回空;Easy Ship 全球多数站点可能不支持 generateInvoice(印度除外)。
  • 返回结构以 Amazon schema 为准;详见 references/api.md

积分消耗规则

不消耗积分(以网关实际计费为准;若网关计费则按积分规则处理)。

Feedback:references/api.mdskillNamelinkfox-amazon-store-external-fulfillment


更多跨境 skill:LinkFox Skills

相关技能

亚马逊 Multi-Channel Fulfillment(MCF)出仓履约 Skill,经 LinkFox /spApi/developerProxy 调用 Fulfillment Outbound API v2026-07-04,并提供该文档角色列表关联的 Invoices v2026-06-25 getInvoiceHeaders;支持配送报价与预览、创建/查询/列出/更新/取消履约订单、动态沙箱订单/包裹状态更新及发票头分页查询。用户提到 Fulfillment Outbound、MCF、多渠道配送、getOffers、getOrderPreview、createOrder、getInvoiceHeaders、Amazon 库存配送到站外客户、订单包裹与跟踪、签收证明或投递照片、receivedBy、locker/drop-off location、商品序列号/unitIdentifiers、v2026-07-04 时触发。与 External Fulfillment、普通 Orders API 和旧版 v2020-07-01 不同。

亚马逊店铺 Fulfillment by Amazon(FBA)系列(与 linkfox-amazon-store-auth 同系列),经 /spApi/developerProxy 调用 SP-API:FBA Inbound Eligibility(getItemEligibilityPreview)、FBA Inventory(getInventorySummaries/createInventoryItem/deleteInventoryItem/addInventory)、Fulfillment Inbound v2024-03-20(InboundPlan/装箱/放置/运输/货件等)与 v0(prepInstructions/labels/BOL/shipments)、Fulfillment Outbound 2020-07-01(MCF 履约单/预览/退货/tracking/features)。当用户提到 FBA、入仓资格、Inbound Eligibility、FBA 库存摘要、Send to Amazon、Inbound Plan、FBA 货件、MCF、多渠道履约、getItemEligibilityPreview、getInventorySummaries、createInboundPlan、createFulfillmentOrder 时触发。与 External Fulfillment / 普通 Orders 不同。

1 次安装

亚马逊 FBA 入仓与 Fulfillment Inbound SP-API 能力,经 LinkFox /spApi/developerProxy 管理 inbound plan、装箱、placement、shipment、shipment content update、delivery window、自配送预约、运输方案、合规、预处理、标签及 BOL。用户提到 createInboundPlan、packing option、placement option、transportation option、FBA 入库计划、货件箱唛、入仓标签、送仓预约、shipmentConfirmationId、Fulfillment Inbound API 或 v2024-03-20/v0 时触发。

通过 /spApi/developerProxy 调用 SP-API Orders,覆盖 v2026-01-01 与 v0 的查询、发货与管制订单接口。

14 次安装

亚马逊店铺授权与管理技能,提供完整的授权流程、令牌刷新、已授权店铺查询以及授权状态查询能力。获取授权链接时店铺名 sellerName 为必填,用于区分已授权店铺。当用户提到亚马逊店铺授权、绑定亚马逊店铺、刷新令牌、查询店铺授权状态、管理授权店铺、Amazon seller authorization, bind Amazon seller account, refresh access token, query store token status, manage authorized stores时触发此技能。只要其需求涉及亚马逊卖家账号授权、令牌生命周期管理或店铺列表查询,也应触发此技能。

19 次安装

亚马逊店铺 Feeds(与 linkfox-amazon-store-auth / report / listings / pricing / orders 同系列),经 /spApi/developerProxy 调用 SP-API Feeds v2021-06-30:createFeedDocument、getFeedDocument、createFeed、getFeed、getFeeds、cancelFeed;另含 upload_feed_document 向预签名 URL 上传内容。当用户提到亚马逊 Feed、提交库存/Listing Feed、POST_FLAT_FILE、feedType、feedDocumentId、feedId、取消 Feed、查询 Feed 处理状态、Feeds API、SP-API 上传文件 时触发。

14 次安装