$npx -y skills add 40RTY-ai/shopify-admin-skills --skill shopify-admin-order-lookup-and-summaryRetrieve and summarize full order details for a customer by email, order number, or phone number.
| 1 | ## Purpose |
| 2 | Retrieves complete order details for a customer without requiring navigation through the Shopify admin UI. Useful for support agents answering customer queries about order status, shipping tracking, and refunds. This skill operates directly on the Shopify-native data layer, returning full order context in a single operation. |
| 3 | |
| 4 | ## Prerequisites |
| 5 | - Authenticated Shopify CLI session: `shopify auth login --store <domain>` |
| 6 | - API scopes: `read_orders`, `read_customers` |
| 7 | |
| 8 | ## Parameters |
| 9 | |
| 10 | | Parameter | Type | Required | Default | Description | |
| 11 | |-----------|------|----------|---------|-------------| |
| 12 | | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | |
| 13 | | format | string | no | human | Output format: `human` or `json` | |
| 14 | | dry_run | bool | no | false | Preview operations without executing mutations | |
| 15 | | lookup_by | string | yes | — | `order_number`, `email`, or `phone` | |
| 16 | | lookup_value | string | yes | — | The value to search for (e.g., `#1001`, `jane@example.com`, `+15551234567`) | |
| 17 | | limit | integer | no | 5 | Maximum number of orders to return | |
| 18 | |
| 19 | ## Workflow Steps |
| 20 | |
| 21 | 1. **OPERATION:** `orders` — query |
| 22 | **Inputs:** `first: <limit>`, `query: "name:<order_number>"` or `"email:<email>"` or `"phone:<phone>"` depending on `lookup_by` |
| 23 | **Expected output:** Full order objects with financial status, fulfillment status, line items, shipping address, tracking, refunds |
| 24 | |
| 25 | ## GraphQL Operations |
| 26 | |
| 27 | ```graphql |
| 28 | # orders:query — validated against api_version 2025-01 |
| 29 | query OrderLookup($first: Int!, $query: String) { |
| 30 | orders(first: $first, query: $query) { |
| 31 | edges { |
| 32 | node { |
| 33 | id |
| 34 | name |
| 35 | createdAt |
| 36 | processedAt |
| 37 | displayFinancialStatus |
| 38 | displayFulfillmentStatus |
| 39 | totalPriceSet { |
| 40 | shopMoney { amount currencyCode } |
| 41 | } |
| 42 | subtotalPriceSet { |
| 43 | shopMoney { amount currencyCode } |
| 44 | } |
| 45 | totalShippingPriceSet { |
| 46 | shopMoney { amount currencyCode } |
| 47 | } |
| 48 | totalRefundedSet { |
| 49 | shopMoney { amount currencyCode } |
| 50 | } |
| 51 | customer { |
| 52 | id |
| 53 | defaultEmailAddress { |
| 54 | emailAddress |
| 55 | } |
| 56 | firstName |
| 57 | lastName |
| 58 | phone |
| 59 | } |
| 60 | shippingAddress { |
| 61 | address1 |
| 62 | address2 |
| 63 | city |
| 64 | province |
| 65 | country |
| 66 | zip |
| 67 | phone |
| 68 | } |
| 69 | lineItems(first: 50) { |
| 70 | edges { |
| 71 | node { |
| 72 | title |
| 73 | quantity |
| 74 | variant { |
| 75 | sku |
| 76 | price |
| 77 | } |
| 78 | fulfillmentStatus |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | fulfillments { |
| 83 | trackingInfo { |
| 84 | number |
| 85 | url |
| 86 | company |
| 87 | } |
| 88 | status |
| 89 | createdAt |
| 90 | } |
| 91 | refunds { |
| 92 | createdAt |
| 93 | totalRefundedSet { |
| 94 | shopMoney { amount currencyCode } |
| 95 | } |
| 96 | } |
| 97 | note |
| 98 | tags |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | ``` |
| 104 | |
| 105 | ## Session Tracking |
| 106 | |
| 107 | **Claude MUST emit the following output at each stage. This is mandatory.** |
| 108 | |
| 109 | **On start**, emit: |
| 110 | ``` |
| 111 | ╔══════════════════════════════════════════════╗ |
| 112 | ║ SKILL: order-lookup-and-summary ║ |
| 113 | ║ Store: <store domain> ║ |
| 114 | ║ Started: <YYYY-MM-DD HH:MM UTC> ║ |
| 115 | ╚══════════════════════════════════════════════╝ |
| 116 | ``` |
| 117 | |
| 118 | **After each step**, emit: |
| 119 | ``` |
| 120 | [N/TOTAL] <QUERY|MUTATION> <OperationName> |
| 121 | → Params: <brief summary of key inputs> |
| 122 | → Result: <count or outcome> |
| 123 | ``` |
| 124 | |
| 125 | **On completion**, emit: |
| 126 | |
| 127 | For `format: human` (default): |
| 128 | ``` |
| 129 | ══════════════════════════════════════════════ |
| 130 | OUTCOME SUMMARY |
| 131 | Orders found: <n> |
| 132 | Errors: 0 |
| 133 | Output: none |
| 134 | ══════════════════════════════════════════════ |
| 135 | ``` |
| 136 | |
| 137 | For `format: json`, emit: |
| 138 | ```json |
| 139 | { |
| 140 | "skill": "order-lookup-and-summary", |
| 141 | "store": "<domain>", |
| 142 | "started_at": "<ISO8601>", |
| 143 | "completed_at": "<ISO8601>", |
| 144 | "dry_run": false, |
| 145 | "steps": [ |
| 146 | { "step": 1, "operation": "OrderLookup", "type": "query", "params_summary": "lookup_by: <type>, lookup_value: <value>, limit: <n>", "result_summary": "<n> orders", "skipped": false } |
| 147 | ], |
| 148 | "outcome": { |
| 149 | "orders_found": 0, |
| 150 | "errors": 0, |
| 151 | "output_file": null |
| 152 | } |
| 153 | } |
| 154 | ``` |
| 155 | |
| 156 | ## Output Format |
| 157 | Human-readable formatted summary for each order found (not a CSV). For each order, Claude presents: order number, date, financial and fulfillment status, customer details, line items, shipping address, tracking numbers, and any refunds. For `format: json`, the raw order objects array. |
| 158 | |
| 159 | ## Error Handling |
| 160 | | Error | Cause | Recovery | |
| 161 | |-------|-------|----------| |
| 162 | | No order |