shopify-admin-tracking-update-bulk

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Purpose

用途

Looks up existing fulfillments on orders and updates their tracking numbers and carrier URLs in bulk. Used when a carrier reissues tracking IDs after a label reprint, a 3PL batch-uploads corrected tracking, or a carrier integration pushes wrong tracking numbers. Replaces manual tracking corrections in Shopify Admin order by order.
批量查询订单中的现有履约单,并更新其跟踪号和物流商URL。适用于物流商在重新打印面单后重新发放跟踪ID、第三方物流(3PL)批量上传修正后的跟踪信息,或是物流商集成推送了错误跟踪号的场景。可替代在Shopify Admin中逐个订单手动修正跟踪信息的操作。

Prerequisites

前置要求

  • Authenticated Shopify CLI session:
    shopify store auth --store <domain> --scopes read_orders,write_fulfillments
  • API scopes:
    read_orders
    ,
    write_fulfillments
  • 已完成身份认证的Shopify CLI会话:
    shopify store auth --store <domain> --scopes read_orders,write_fulfillments
  • API权限:
    read_orders
    ,
    write_fulfillments

Parameters

参数

ParameterTypeRequiredDefaultDescription
storestringyesStore domain (e.g., mystore.myshopify.com)
updatesarrayyesList of
{order_id, fulfillment_id, tracking_number, tracking_url, carrier}
objects
notify_customerboolnofalseResend shipping confirmation with updated tracking
dry_runboolnotruePreview updates without executing mutations
formatstringnohumanOutput format:
human
or
json
参数类型必填默认值描述
storestring店铺域名(例如:mystore.myshopify.com)
updatesarray
{order_id, fulfillment_id, tracking_number, tracking_url, carrier}
对象组成的列表
notify_customerboolfalse是否使用更新后的跟踪信息重发发货确认通知
dry_runbooltrue预览更新效果而不实际执行变更操作
formatstringhuman输出格式:
human
json

Safety

安全提示

⚠️
fulfillmentUpdate
overwrites existing tracking info. Set
notify_customer: false
unless you explicitly want to resend shipment notifications — customers will receive a new email for every updated fulfillment if enabled. Run with
dry_run: true
to confirm the fulfillment list before committing.
⚠️
fulfillmentUpdate
会覆盖现有跟踪信息。除非你明确需要重发发货通知,否则请将
notify_customer
设为false——如果开启该选项,每个更新的履约单都会给客户发送一封新邮件,可能造成用户困扰。在实际执行前,请先使用
dry_run: true
运行,确认要更新的履约单列表无误。

Workflow Steps

工作流步骤

  1. OPERATION:
    order
    — query Inputs:
    id: <order_id>
    for each order in
    updates
    Expected output: Order with
    fulfillments { id, trackingInfo }
    to confirm existing fulfillment IDs match
  2. OPERATION:
    fulfillmentUpdate
    — mutation Inputs:
    fulfillmentId: <id>
    ,
    trackingInfoUpdateInput: { company, number, url }
    ,
    notifyCustomer
    Expected output:
    fulfillment { id, trackingInfo }
    ,
    userErrors
  1. 操作:
    order
    — 查询 输入:
    updates
    列表中每个订单的
    id: <order_id>
    预期输出: 包含
    fulfillments { id, trackingInfo }
    的订单信息,用于确认现有履约单ID匹配
  2. 操作:
    fulfillmentUpdate
    — 变更 输入:
    fulfillmentId: <id>
    ,
    trackingInfoUpdateInput: { company, number, url }
    ,
    notifyCustomer
    预期输出:
    fulfillment { id, trackingInfo }
    ,
    userErrors

GraphQL Operations

GraphQL操作

graphql
undefined
graphql
undefined

order:query — validated against api_version 2025-01

order:query — validated against api_version 2025-01

query OrderFulfillments($id: ID!) { order(id: $id) { id name fulfillments { id status trackingInfo { company number url } } } }

```graphql
query OrderFulfillments($id: ID!) { order(id: $id) { id name fulfillments { id status trackingInfo { company number url } } } }

```graphql

fulfillmentUpdate:mutation — validated against api_version 2025-01

fulfillmentUpdate:mutation — validated against api_version 2025-01

mutation FulfillmentUpdate($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) { fulfillmentUpdate( fulfillmentId: $fulfillmentId trackingInfoUpdateInput: $trackingInfoInput notifyCustomer: $notifyCustomer ) { fulfillment { id status trackingInfo { company number url } } userErrors { field message } } }
undefined
mutation FulfillmentUpdate($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) { fulfillmentUpdate( fulfillmentId: $fulfillmentId trackingInfoUpdateInput: $trackingInfoInput notifyCustomer: $notifyCustomer ) { fulfillment { id status trackingInfo { company number url } } userErrors { field message } } }
undefined

Session Tracking

会话跟踪

Claude MUST emit the following output at each stage. This is mandatory.
On start, emit:
╔══════════════════════════════════════════════╗
║  SKILL: Tracking Update Bulk                 ║
║  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
  Fulfillments targeted:   <n>
  Tracking numbers updated: <n>
  Notifications sent:       <n>
  Errors:                   <n>
  Output:                   tracking_update_<date>.csv
══════════════════════════════════════════════
For
format: json
, emit:
json
{
  "skill": "tracking-update-bulk",
  "store": "<domain>",
  "started_at": "<ISO8601>",
  "completed_at": "<ISO8601>",
  "dry_run": true,
  "outcome": {
    "targeted": 0,
    "updated": 0,
    "notifications_sent": 0,
    "errors": 0,
    "output_file": "tracking_update_<date>.csv"
  }
}
Claude必须在每个阶段输出以下内容,这是强制要求。
启动时输出:
╔══════════════════════════════════════════════╗
║  SKILL: Tracking Update Bulk                 ║
║  Store: <store domain>                       ║
║  Started: <YYYY-MM-DD HH:MM UTC>             ║
╚══════════════════════════════════════════════╝
每个步骤完成后输出:
[N/TOTAL] <QUERY|MUTATION>  <OperationName>
          → Params: <brief summary of key inputs>
          → Result: <count or outcome>
如果
dry_run: true
,请在每个变更步骤前添加
[DRY RUN]
前缀,且不实际执行该步骤。
完成时输出:
对于
format: human
(默认):
══════════════════════════════════════════════
OUTCOME SUMMARY
  Fulfillments targeted:   <n>
  Tracking numbers updated: <n>
  Notifications sent:       <n>
  Errors:                   <n>
  Output:                   tracking_update_<date>.csv
══════════════════════════════════════════════
对于
format: json
,输出:
json
{
  "skill": "tracking-update-bulk",
  "store": "<domain>",
  "started_at": "<ISO8601>",
  "completed_at": "<ISO8601>",
  "dry_run": true,
  "outcome": {
    "targeted": 0,
    "updated": 0,
    "notifications_sent": 0,
    "errors": 0,
    "output_file": "tracking_update_<date>.csv"
  }
}

Output Format

输出格式

CSV file
tracking_update_<YYYY-MM-DD>.csv
with columns:
order_name
,
fulfillment_id
,
old_tracking_number
,
new_tracking_number
,
carrier
,
notify_customer
,
status
CSV文件
tracking_update_<YYYY-MM-DD>.csv
,包含以下列:
order_name
,
fulfillment_id
,
old_tracking_number
,
new_tracking_number
,
carrier
,
notify_customer
,
status

Error Handling

错误处理

ErrorCauseRecovery
THROTTLED
API rate limit exceededWait 2 seconds, retry up to 3 times
userErrors
on fulfillmentUpdate
Fulfillment cancelled or not foundLog error, skip, continue
Fulfillment ID not on orderStale ID in updates listLog mismatch, skip, continue
错误原因解决方案
THROTTLED
API速率超限等待2秒,最多重试3次
fulfillmentUpdate
返回
userErrors
履约单已取消或不存在记录错误,跳过该条,继续执行
履约单ID不在对应订单中updates列表中的ID已失效记录不匹配信息,跳过该条,继续执行

Best Practices

最佳实践

  • Keep
    notify_customer: false
    unless the carrier is tracking a replacement shipment — customers find repeated shipping emails confusing and may open unnecessary support tickets.
  • Provide
    fulfillment_id
    directly in the
    updates
    input when possible to skip the order lookup step entirely.
  • For 3PL integrations that send corrected tracking via CSV, parse the CSV into the
    updates
    array before running this skill.
  • 除非物流商正在跟踪补发的货物,否则保持
    notify_customer: false
    ——客户会对重复的发货邮件感到困惑,可能会发起不必要的咨询工单。
  • 尽可能直接在
    updates
    输入中提供
    fulfillment_id
    ,可以完全跳过订单查询步骤。
  • 对于通过CSV发送修正后跟踪信息的3PL集成,在运行本skill前先将CSV解析为
    updates
    数组格式。