$npx -y skills add 40RTY-ai/shopify-admin-skills --skill shopify-admin-bulk-fulfillment-creationBatch-fulfill open fulfillment orders with tracking numbers. Supports partial fulfillment and customer notification toggle.
| 1 | ## Purpose |
| 2 | Queries all open fulfillment orders for a location and batch-creates fulfillments with tracking numbers in a single workflow. No third-party app required — this skill handles the fulfillment creation layer; carrier label generation requires a separate tool or carrier integration. |
| 3 | |
| 4 | ## Prerequisites |
| 5 | - Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_orders,write_fulfillments` |
| 6 | - API scopes: `read_orders`, `write_fulfillments` |
| 7 | |
| 8 | ## Parameters |
| 9 | |
| 10 | | Parameter | Type | Required | Default | Description | |
| 11 | |-----------|------|----------|---------|-------------| |
| 12 | | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | |
| 13 | | location_id | string | yes | — | GID of the fulfillment location (e.g., gid://shopify/Location/123) | |
| 14 | | tracking_numbers | array | no | [] | List of `{fulfillment_order_id, tracking_number, tracking_url, carrier}` objects | |
| 15 | | notify_customer | bool | no | true | Send shipping confirmation email to customer | |
| 16 | | dry_run | bool | no | true | Preview fulfillments without executing mutations | |
| 17 | | format | string | no | human | Output format: `human` or `json` | |
| 18 | |
| 19 | ## Safety |
| 20 | |
| 21 | > ⚠️ `fulfillmentCreate` is irreversible — fulfilled orders cannot be unfulfilled via the API. Run with `dry_run: true` first to confirm the list of fulfillment orders before committing. Each mutation creates one fulfillment record per fulfillment order. |
| 22 | |
| 23 | ## Workflow Steps |
| 24 | |
| 25 | 1. **OPERATION:** `fulfillmentOrders` — query |
| 26 | **Inputs:** `assignedLocationId: <location_id>`, `status: OPEN`, `first: 250`, pagination cursor |
| 27 | **Expected output:** List of open fulfillment orders with `id`, `order { name }`, `lineItems`; paginate until `hasNextPage: false` |
| 28 | |
| 29 | 2. **OPERATION:** `fulfillmentCreate` — mutation |
| 30 | **Inputs:** For each fulfillment order: `fulfillmentOrderId`, `trackingInfo { company, number, url }`, `notifyCustomer` |
| 31 | **Expected output:** `fulfillment { id, status, trackingInfo }`, `userErrors` |
| 32 | |
| 33 | ## GraphQL Operations |
| 34 | |
| 35 | ```graphql |
| 36 | # fulfillmentOrders:query — validated against api_version 2025-01 |
| 37 | query OpenFulfillmentOrders($locationId: ID!, $after: String) { |
| 38 | fulfillmentOrders( |
| 39 | assignedLocationId: $locationId |
| 40 | first: 250 |
| 41 | after: $after |
| 42 | query: "status:open" |
| 43 | ) { |
| 44 | edges { |
| 45 | node { |
| 46 | id |
| 47 | status |
| 48 | order { |
| 49 | id |
| 50 | name |
| 51 | } |
| 52 | lineItems(first: 10) { |
| 53 | edges { |
| 54 | node { |
| 55 | id |
| 56 | remainingQuantity |
| 57 | variant { |
| 58 | sku |
| 59 | title |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | pageInfo { |
| 67 | hasNextPage |
| 68 | endCursor |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | ``` |
| 73 | |
| 74 | ```graphql |
| 75 | # fulfillmentCreate:mutation — validated against api_version 2025-01 |
| 76 | mutation FulfillmentCreate($fulfillment: FulfillmentInput!) { |
| 77 | fulfillmentCreate(fulfillment: $fulfillment) { |
| 78 | fulfillment { |
| 79 | id |
| 80 | status |
| 81 | trackingInfo { |
| 82 | company |
| 83 | number |
| 84 | url |
| 85 | } |
| 86 | } |
| 87 | userErrors { |
| 88 | field |
| 89 | message |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | ``` |
| 94 | |
| 95 | ## Session Tracking |
| 96 | |
| 97 | **Claude MUST emit the following output at each stage. This is mandatory.** |
| 98 | |
| 99 | **On start**, emit: |
| 100 | ``` |
| 101 | ╔══════════════════════════════════════════════╗ |
| 102 | ║ SKILL: Bulk Fulfillment Creation ║ |
| 103 | ║ Store: <store domain> ║ |
| 104 | ║ Started: <YYYY-MM-DD HH:MM UTC> ║ |
| 105 | ╚══════════════════════════════════════════════╝ |
| 106 | ``` |
| 107 | |
| 108 | **After each step**, emit: |
| 109 | ``` |
| 110 | [N/TOTAL] <QUERY|MUTATION> <OperationName> |
| 111 | → Params: <brief summary of key inputs> |
| 112 | → Result: <count or outcome> |
| 113 | ``` |
| 114 | |
| 115 | If `dry_run: true`, prefix every mutation step with `[DRY RUN]` and do not execute it. |
| 116 | |
| 117 | **On completion**, emit: |
| 118 | |
| 119 | For `format: human` (default): |
| 120 | ``` |
| 121 | ══════════════════════════════════════════════ |
| 122 | OUTCOME SUMMARY |
| 123 | Open fulfillment orders found: <n> |
| 124 | Fulfillments created: <n> |
| 125 | Customer notifications sent: <n> |
| 126 | Errors: <n> |
| 127 | Output: fulfillment_batch_<date>.csv |
| 128 | ══════════════════════════════════════════════ |
| 129 | ``` |
| 130 | |
| 131 | For `format: json`, emit: |
| 132 | ```json |
| 133 | { |
| 134 | "skill": "bulk-fulfillment-creation", |
| 135 | "store": "<domain>", |
| 136 | "started_at": "<ISO8601>", |
| 137 | "completed_at": "<ISO8601>", |
| 138 | "dry_run": true, |
| 139 | "steps": [ |
| 140 | { "step": 1, "operation": "OpenFulfillmentOrders", "type": "query", "params_summary": "location <id>, status open", "result_summary": "<n> orders", "skipped": false }, |
| 141 | { "step": 2, "operation": "FulfillmentCreate", "type": "mutation", "params_summary": "<n> fulfillments", "result_summary": "<n> created", "skipped": |