shopify-admin-tracking-update-bulk
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePurpose
用途
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_orderswrite_fulfillments
- 已完成身份认证的Shopify CLI会话:
shopify store auth --store <domain> --scopes read_orders,write_fulfillments - API权限:,
read_orderswrite_fulfillments
Parameters
参数
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| store | string | yes | — | Store domain (e.g., mystore.myshopify.com) |
| updates | array | yes | — | List of |
| notify_customer | bool | no | false | Resend shipping confirmation with updated tracking |
| dry_run | bool | no | true | Preview updates without executing mutations |
| format | string | no | human | Output format: |
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
| store | string | 是 | — | 店铺域名(例如:mystore.myshopify.com) |
| updates | array | 是 | — | 由 |
| notify_customer | bool | 否 | false | 是否使用更新后的跟踪信息重发发货确认通知 |
| dry_run | bool | 否 | true | 预览更新效果而不实际执行变更操作 |
| format | string | 否 | human | 输出格式: |
Safety
安全提示
⚠️overwrites existing tracking info. SetfulfillmentUpdateunless you explicitly want to resend shipment notifications — customers will receive a new email for every updated fulfillment if enabled. Run withnotify_customer: falseto confirm the fulfillment list before committing.dry_run: true
⚠️会覆盖现有跟踪信息。除非你明确需要重发发货通知,否则请将fulfillmentUpdate设为false——如果开启该选项,每个更新的履约单都会给客户发送一封新邮件,可能造成用户困扰。在实际执行前,请先使用notify_customer运行,确认要更新的履约单列表无误。dry_run: true
Workflow Steps
工作流步骤
-
OPERATION:— query Inputs:
orderfor each order inid: <order_id>Expected output: Order withupdatesto confirm existing fulfillment IDs matchfulfillments { id, trackingInfo } -
OPERATION:— mutation Inputs:
fulfillmentUpdate,fulfillmentId: <id>,trackingInfoUpdateInput: { company, number, url }Expected output:notifyCustomer,fulfillment { id, trackingInfo }userErrors
-
操作:— 查询 输入:
order列表中每个订单的updates预期输出: 包含id: <order_id>的订单信息,用于确认现有履约单ID匹配fulfillments { id, trackingInfo } -
操作:— 变更 输入:
fulfillmentUpdate,fulfillmentId: <id>,trackingInfoUpdateInput: { company, number, url }预期输出:notifyCustomer,fulfillment { id, trackingInfo }userErrors
GraphQL Operations
GraphQL操作
graphql
undefinedgraphql
undefinedorder: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
}
}
}
}
```graphqlquery OrderFulfillments($id: ID!) {
order(id: $id) {
id
name
fulfillments {
id
status
trackingInfo {
company
number
url
}
}
}
}
```graphqlfulfillmentUpdate: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
}
}
}
undefinedmutation FulfillmentUpdate($fulfillmentId: ID!, $trackingInfoInput: FulfillmentTrackingInput!, $notifyCustomer: Boolean) {
fulfillmentUpdate(
fulfillmentId: $fulfillmentId
trackingInfoUpdateInput: $trackingInfoInput
notifyCustomer: $notifyCustomer
) {
fulfillment {
id
status
trackingInfo {
company
number
url
}
}
userErrors {
field
message
}
}
}
undefinedSession 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 , prefix every mutation step with and do not execute it.
dry_run: true[DRY RUN]On completion, emit:
For (default):
format: human══════════════════════════════════════════════
OUTCOME SUMMARY
Fulfillments targeted: <n>
Tracking numbers updated: <n>
Notifications sent: <n>
Errors: <n>
Output: tracking_update_<date>.csv
══════════════════════════════════════════════For , emit:
format: jsonjson
{
"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: jsonjson
{
"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 with columns:
, , , , , ,
tracking_update_<YYYY-MM-DD>.csvorder_namefulfillment_idold_tracking_numbernew_tracking_numbercarriernotify_customerstatusCSV文件,包含以下列:
, , , , , ,
tracking_update_<YYYY-MM-DD>.csvorder_namefulfillment_idold_tracking_numbernew_tracking_numbercarriernotify_customerstatusError Handling
错误处理
| Error | Cause | Recovery |
|---|---|---|
| API rate limit exceeded | Wait 2 seconds, retry up to 3 times |
| Fulfillment cancelled or not found | Log error, skip, continue |
| Fulfillment ID not on order | Stale ID in updates list | Log mismatch, skip, continue |
| 错误 | 原因 | 解决方案 |
|---|---|---|
| API速率超限 | 等待2秒,最多重试3次 |
| 履约单已取消或不存在 | 记录错误,跳过该条,继续执行 |
| 履约单ID不在对应订单中 | updates列表中的ID已失效 | 记录不匹配信息,跳过该条,继续执行 |
Best Practices
最佳实践
- Keep unless the carrier is tracking a replacement shipment — customers find repeated shipping emails confusing and may open unnecessary support tickets.
notify_customer: false - Provide directly in the
fulfillment_idinput when possible to skip the order lookup step entirely.updates - For 3PL integrations that send corrected tracking via CSV, parse the CSV into the array before running this skill.
updates
- 除非物流商正在跟踪补发的货物,否则保持——客户会对重复的发货邮件感到困惑,可能会发起不必要的咨询工单。
notify_customer: false - 尽可能直接在输入中提供
updates,可以完全跳过订单查询步骤。fulfillment_id - 对于通过CSV发送修正后跟踪信息的3PL集成,在运行本skill前先将CSV解析为数组格式。
updates