shopify-admin-fulfillment-location-routing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Purpose

用途

Queries open fulfillment orders assigned to a source location and moves them to a destination location. Used when a warehouse is at capacity, a location is closing, or regional routing rules change. Replaces manual reassignment in Shopify Admin — this skill handles bulk location transfers for any number of open orders in a single workflow.
查询分配给源地址的未完成履约订单,并将其转移到目标地址。适用于仓库满负荷、站点关闭或区域路由规则变更的场景。可替代Shopify Admin中的手动重新分配操作——该skill可在单个工作流中完成任意数量未结订单的批量地址转移。

Prerequisites

前置要求

  • Authenticated Shopify CLI session:
    shopify store auth --store <domain> --scopes read_orders,write_fulfillments
  • API scopes:
    read_orders
    ,
    write_fulfillments
  • Both source and destination locations must be active fulfillment locations in Shopify
  • 已完成身份验证的Shopify CLI会话:
    shopify store auth --store <domain> --scopes read_orders,write_fulfillments
  • API权限范围:
    read_orders
    write_fulfillments
  • 源地址和目标地址都必须是Shopify中处于激活状态的履约地点

Parameters

参数

ParameterTypeRequiredDefaultDescription
storestringyesStore domain (e.g., mystore.myshopify.com)
source_location_idstringyesGID of the location to move orders FROM
destination_location_idstringyesGID of the location to move orders TO
order_filterstringnoOptional order name filter (e.g., "#1001,#1002")
dry_runboolnotruePreview moves without executing mutations
formatstringnohumanOutput format:
human
or
json
ParameterTypeRequiredDefaultDescription
storestring店铺域名(例如:mystore.myshopify.com)
source_location_idstring要转出订单的地址的GID
destination_location_idstring要转入订单的地址的GID
order_filterstring可选的订单名称筛选条件(例如:"#1001,#1002")
dry_runbooltrue试运行模式,仅预览转移操作而不实际执行变更
formatstringhuman输出格式:
human
json

Safety

安全提示

⚠️
fulfillmentOrderMove
reassigns fulfillment responsibility. This affects which warehouse picks and ships the order. Verify destination location has sufficient stock for all products before moving. Run with
dry_run: true
to confirm the order list and destination before committing.
⚠️
fulfillmentOrderMove
会重新分配履约责任,这将决定由哪个仓库拣货并发货。转移前请确认目标地址有足够的库存支撑所有商品。正式执行前请先设置
dry_run: true
运行,确认订单列表和目标地址无误。

Workflow Steps

工作流步骤

  1. OPERATION:
    fulfillmentOrders
    — query Inputs:
    assignedLocationId: <source_location_id>
    ,
    status: OPEN
    ,
    first: 250
    , pagination cursor Expected output: List of open fulfillment orders; paginate until
    hasNextPage: false
  2. OPERATION:
    fulfillmentOrderMove
    — mutation Inputs:
    id: <fulfillment_order_id>
    ,
    newLocationId: <destination_location_id>
    Expected output:
    movedFulfillmentOrder { id, assignedLocation { name } }
    ,
    userErrors
  1. 操作:
    fulfillmentOrders
    — 查询 输入:
    assignedLocationId: <source_location_id>
    status: OPEN
    first: 250
    、分页游标 预期输出: 未结履约订单列表;分页查询直到
    hasNextPage: false
  2. 操作:
    fulfillmentOrderMove
    — mutation 输入:
    id: <fulfillment_order_id>
    newLocationId: <destination_location_id>
    预期输出:
    movedFulfillmentOrder { id, assignedLocation { name } }
    userErrors

GraphQL Operations

GraphQL操作

graphql
undefined
graphql
undefined

fulfillmentOrders:query — validated against api_version 2025-01

fulfillmentOrders:query — validated against api_version 2025-01

query FulfillmentOrdersByLocation($locationId: ID!, $after: String) { fulfillmentOrders( assignedLocationId: $locationId first: 250 after: $after query: "status:open" ) { edges { node { id status order { id name } assignedLocation { location { id name } } } } pageInfo { hasNextPage endCursor } } }

```graphql
query FulfillmentOrdersByLocation($locationId: ID!, $after: String) { fulfillmentOrders( assignedLocationId: $locationId first: 250 after: $after query: "status:open" ) { edges { node { id status order { id name } assignedLocation { location { id name } } } } pageInfo { hasNextPage endCursor } } }

```graphql

fulfillmentOrderMove:mutation — validated against api_version 2025-01

fulfillmentOrderMove:mutation — validated against api_version 2025-01

mutation FulfillmentOrderMove($id: ID!, $newLocationId: ID!) { fulfillmentOrderMove(id: $id, newLocationId: $newLocationId) { movedFulfillmentOrder { id assignedLocation { location { id name } } } originalFulfillmentOrder { id status } remainingFulfillmentOrder { id status } userErrors { field message } } }
undefined
mutation FulfillmentOrderMove($id: ID!, $newLocationId: ID!) { fulfillmentOrderMove(id: $id, newLocationId: $newLocationId) { movedFulfillmentOrder { id assignedLocation { location { id name } } } originalFulfillmentOrder { id status } remainingFulfillmentOrder { id status } userErrors { field message } } }
undefined

Session Tracking

会话追踪

Claude MUST emit the following output at each stage. This is mandatory.
On start, emit:
╔══════════════════════════════════════════════╗
║  SKILL: Fulfillment Location Routing         ║
║  Store: <store domain>                       ║
║  Started: <YYYY-MM-DD HH:MM UTC>             ║
╚══════════════════════════════════════════════╝
After each step, emit:
[N/TOTAL] <QUERY|MUTATION>  <OperationName>
          → Params: <brief summary of key inputs>
          → Result: <count or outcome>
If
dry_run: true
, prefix every mutation step with
[DRY RUN]
and do not execute it.
On completion, emit:
For
format: human
(default):
══════════════════════════════════════════════
OUTCOME SUMMARY
  Orders at source location:  <n>
  Orders moved:               <n>
  Errors:                     <n>
  Output:                     routing_log_<date>.csv
══════════════════════════════════════════════
For
format: json
, emit:
json
{
  "skill": "fulfillment-location-routing",
  "store": "<domain>",
  "started_at": "<ISO8601>",
  "completed_at": "<ISO8601>",
  "dry_run": true,
  "outcome": {
    "orders_at_source": 0,
    "orders_moved": 0,
    "errors": 0,
    "output_file": "routing_log_<date>.csv"
  }
}
Claude在每个阶段必须输出以下内容,这是强制要求。
启动时输出:
╔══════════════════════════════════════════════╗
║  SKILL: Fulfillment Location Routing         ║
║  Store: <store domain>                       ║
║  Started: <YYYY-MM-DD HH:MM UTC>             ║
╚══════════════════════════════════════════════╝
每步执行完成后输出:
[N/TOTAL] <QUERY|MUTATION>  <OperationName>
          → Params: <关键输入的简要说明>
          → Result: <数量或执行结果>
如果
dry_run: true
,每个mutation步骤前要加
[DRY RUN]
前缀,且不实际执行操作。
执行完成后输出:
format: human
(默认)时:
══════════════════════════════════════════════
OUTCOME SUMMARY
  Orders at source location:  <n>
  Orders moved:               <n>
  Errors:                     <n>
  Output:                     routing_log_<date>.csv
══════════════════════════════════════════════
format: json
时:
json
{
  "skill": "fulfillment-location-routing",
  "store": "<domain>",
  "started_at": "<ISO8601>",
  "completed_at": "<ISO8601>",
  "dry_run": true,
  "outcome": {
    "orders_at_source": 0,
    "orders_moved": 0,
    "errors": 0,
    "output_file": "routing_log_<date>.csv"
  }
}

Output Format

输出格式

CSV file
routing_log_<YYYY-MM-DD>.csv
with columns:
order_name
,
fulfillment_order_id
,
source_location
,
destination_location
,
status
CSV文件
routing_log_<YYYY-MM-DD>.csv
,包含以下列:
order_name
fulfillment_order_id
source_location
destination_location
status

Error Handling

错误处理

ErrorCauseRecovery
THROTTLED
API rate limit exceededWait 2 seconds, retry up to 3 times
userErrors
on fulfillmentOrderMove
Order already fulfilled or location inactiveLog error, skip order, continue
Destination location not stockedInsufficient inventory at destinationLog warning per SKU, continue move
No open orders at sourceSource has no pending workExit with summary: 0 orders found
错误原因解决方法
THROTTLED
API请求超出频率限制等待2秒,最多重试3次
fulfillmentOrderMove返回
userErrors
订单已完成履约或地址未激活记录错误,跳过该订单,继续执行后续操作
目标地址无库存目标地址库存不足按SKU记录警告,继续执行转移操作
源地址无未结订单源地址没有待处理的订单输出摘要后退出:共找到0个订单

Best Practices

最佳实践

  • Always run with
    dry_run: true
    first — moving a fulfillment order does not move inventory; verify destination stock levels separately using the
    multi-location-inventory-audit
    skill.
  • Use
    order_filter
    to move specific high-priority orders first rather than the entire queue.
  • For location closures, run this skill before the location is deactivated in Shopify Admin.
  • 始终先以
    dry_run: true
    模式运行——转移履约订单不会转移库存;请使用
    multi-location-inventory-audit
    skill单独确认目标地址的库存水平。
  • 优先使用
    order_filter
    转移特定高优先级订单,而不是一次性转移整个队列。
  • 如果要关闭站点,请在Shopify Admin中停用该站点前先运行本skill。