$npx -y skills add 40RTY-ai/shopify-admin-skills --skill shopify-admin-fulfillment-location-routingReassign fulfillment orders from one location to another for warehouse overflow or regional routing.
| 1 | ## Purpose |
| 2 | 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. |
| 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 | - Both source and destination locations must be active fulfillment locations in Shopify |
| 8 | |
| 9 | ## Parameters |
| 10 | |
| 11 | | Parameter | Type | Required | Default | Description | |
| 12 | |-----------|------|----------|---------|-------------| |
| 13 | | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | |
| 14 | | source_location_id | string | yes | — | GID of the location to move orders FROM | |
| 15 | | destination_location_id | string | yes | — | GID of the location to move orders TO | |
| 16 | | order_filter | string | no | — | Optional order name filter (e.g., "#1001,#1002") | |
| 17 | | dry_run | bool | no | true | Preview moves without executing mutations | |
| 18 | | format | string | no | human | Output format: `human` or `json` | |
| 19 | |
| 20 | ## Safety |
| 21 | |
| 22 | > ⚠️ `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. |
| 23 | |
| 24 | ## Workflow Steps |
| 25 | |
| 26 | 1. **OPERATION:** `fulfillmentOrders` — query |
| 27 | **Inputs:** `assignedLocationId: <source_location_id>`, `status: OPEN`, `first: 250`, pagination cursor |
| 28 | **Expected output:** List of open fulfillment orders; paginate until `hasNextPage: false` |
| 29 | |
| 30 | 2. **OPERATION:** `fulfillmentOrderMove` — mutation |
| 31 | **Inputs:** `id: <fulfillment_order_id>`, `newLocationId: <destination_location_id>` |
| 32 | **Expected output:** `movedFulfillmentOrder { id, assignedLocation { name } }`, `userErrors` |
| 33 | |
| 34 | ## GraphQL Operations |
| 35 | |
| 36 | ```graphql |
| 37 | # fulfillmentOrders:query — validated against api_version 2025-01 |
| 38 | query FulfillmentOrdersByLocation($locationId: ID!, $after: String) { |
| 39 | fulfillmentOrders( |
| 40 | assignedLocationId: $locationId |
| 41 | first: 250 |
| 42 | after: $after |
| 43 | query: "status:open" |
| 44 | ) { |
| 45 | edges { |
| 46 | node { |
| 47 | id |
| 48 | status |
| 49 | order { |
| 50 | id |
| 51 | name |
| 52 | } |
| 53 | assignedLocation { |
| 54 | location { |
| 55 | id |
| 56 | name |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | pageInfo { |
| 62 | hasNextPage |
| 63 | endCursor |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | ``` |
| 68 | |
| 69 | ```graphql |
| 70 | # fulfillmentOrderMove:mutation — validated against api_version 2025-01 |
| 71 | mutation FulfillmentOrderMove($id: ID!, $newLocationId: ID!) { |
| 72 | fulfillmentOrderMove(id: $id, newLocationId: $newLocationId) { |
| 73 | movedFulfillmentOrder { |
| 74 | id |
| 75 | assignedLocation { |
| 76 | location { |
| 77 | id |
| 78 | name |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | originalFulfillmentOrder { |
| 83 | id |
| 84 | status |
| 85 | } |
| 86 | remainingFulfillmentOrder { |
| 87 | id |
| 88 | status |
| 89 | } |
| 90 | userErrors { |
| 91 | field |
| 92 | message |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | ``` |
| 97 | |
| 98 | ## Session Tracking |
| 99 | |
| 100 | **Claude MUST emit the following output at each stage. This is mandatory.** |
| 101 | |
| 102 | **On start**, emit: |
| 103 | ``` |
| 104 | ╔══════════════════════════════════════════════╗ |
| 105 | ║ SKILL: Fulfillment Location Routing ║ |
| 106 | ║ Store: <store domain> ║ |
| 107 | ║ Started: <YYYY-MM-DD HH:MM UTC> ║ |
| 108 | ╚══════════════════════════════════════════════╝ |
| 109 | ``` |
| 110 | |
| 111 | **After each step**, emit: |
| 112 | ``` |
| 113 | [N/TOTAL] <QUERY|MUTATION> <OperationName> |
| 114 | → Params: <brief summary of key inputs> |
| 115 | → Result: <count or outcome> |
| 116 | ``` |
| 117 | |
| 118 | If `dry_run: true`, prefix every mutation step with `[DRY RUN]` and do not execute it. |
| 119 | |
| 120 | **On completion**, emit: |
| 121 | |
| 122 | For `format: human` (default): |
| 123 | ``` |
| 124 | ══════════════════════════════════════════════ |
| 125 | OUTCOME SUMMARY |
| 126 | Orders at source location: <n> |
| 127 | Orders moved: <n> |
| 128 | Errors: <n> |
| 129 | Output: routing_log_<date>.csv |
| 130 | ══════════════════════════════════════════════ |
| 131 | ``` |
| 132 | |
| 133 | For `format: json`, emit: |
| 134 | ```json |
| 135 | { |
| 136 | "skill": "fulfillment-location-routing", |
| 137 | "store": "<domain>", |
| 138 | "started_at": "<ISO8601>", |
| 139 | "completed_at": "<ISO8601>", |
| 140 | "dry_run": true, |
| 141 | "outcome": { |
| 142 | "orders_at_source": 0, |
| 143 | "orders_moved": 0, |
| 144 | "errors": 0, |
| 145 | "output_file": "routing_log_<date>.csv" |
| 146 | } |
| 147 | } |
| 148 | ``` |
| 149 | |
| 150 | ## Output Format |
| 151 | CSV file `routing_log_<YYYY-MM-DD>.csv` with columns: |
| 152 | `order_name`, `fulfillment_order_id`, `source_location`, `destination_location`, `status` |
| 153 | |
| 154 | ## Error H |