@clawpify/skills 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +73 -0
- package/clawpify/SKILL.md +134 -0
- package/clawpify/references/blogs.md +385 -0
- package/clawpify/references/bulk-operations.md +386 -0
- package/clawpify/references/collections.md +71 -0
- package/clawpify/references/customers.md +141 -0
- package/clawpify/references/discounts.md +431 -0
- package/clawpify/references/draft-orders.md +495 -0
- package/clawpify/references/files.md +355 -0
- package/clawpify/references/fulfillments.md +437 -0
- package/clawpify/references/gift-cards.md +453 -0
- package/clawpify/references/inventory.md +107 -0
- package/clawpify/references/locations.md +349 -0
- package/clawpify/references/marketing.md +352 -0
- package/clawpify/references/markets.md +346 -0
- package/clawpify/references/menus.md +313 -0
- package/clawpify/references/metafields.md +461 -0
- package/clawpify/references/orders.md +164 -0
- package/clawpify/references/pages.md +308 -0
- package/clawpify/references/products.md +277 -0
- package/clawpify/references/refunds.md +401 -0
- package/clawpify/references/segments.md +319 -0
- package/clawpify/references/shipping.md +406 -0
- package/clawpify/references/shop.md +307 -0
- package/clawpify/references/subscriptions.md +429 -0
- package/clawpify/references/translations.md +270 -0
- package/clawpify/references/webhooks.md +400 -0
- package/dist/agent.d.ts +18 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +100 -0
- package/dist/auth.d.ts +34 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +58 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/mcp-server.d.ts +3 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +236 -0
- package/dist/shopify.d.ts +29 -0
- package/dist/shopify.d.ts.map +1 -0
- package/dist/shopify.js +41 -0
- package/dist/skills.d.ts +8 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +36 -0
- package/package.json +100 -0
- package/src/agent.ts +133 -0
- package/src/auth.ts +109 -0
- package/src/index.ts +55 -0
- package/src/mcp-server.ts +190 -0
- package/src/shopify.ts +63 -0
- package/src/skills.ts +42 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
# Shopify Markets
|
|
2
|
+
|
|
3
|
+
Manage international markets for localized shopping experiences via the GraphQL Admin API.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Markets define customized shopping experiences for different regions, including pricing, currency, content, and fulfillment settings.
|
|
8
|
+
|
|
9
|
+
## List Markets
|
|
10
|
+
|
|
11
|
+
```graphql
|
|
12
|
+
query ListMarkets($first: Int!) {
|
|
13
|
+
markets(first: $first) {
|
|
14
|
+
nodes {
|
|
15
|
+
id
|
|
16
|
+
name
|
|
17
|
+
handle
|
|
18
|
+
enabled
|
|
19
|
+
primary
|
|
20
|
+
currencySettings {
|
|
21
|
+
baseCurrency {
|
|
22
|
+
currencyCode
|
|
23
|
+
}
|
|
24
|
+
localCurrencies
|
|
25
|
+
}
|
|
26
|
+
regions(first: 10) {
|
|
27
|
+
nodes {
|
|
28
|
+
... on MarketRegionCountry {
|
|
29
|
+
code
|
|
30
|
+
name
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
Variables: `{ "first": 10 }`
|
|
39
|
+
|
|
40
|
+
## Get Market
|
|
41
|
+
|
|
42
|
+
```graphql
|
|
43
|
+
query GetMarket($id: ID!) {
|
|
44
|
+
market(id: $id) {
|
|
45
|
+
id
|
|
46
|
+
name
|
|
47
|
+
handle
|
|
48
|
+
enabled
|
|
49
|
+
primary
|
|
50
|
+
currencySettings {
|
|
51
|
+
baseCurrency {
|
|
52
|
+
currencyCode
|
|
53
|
+
}
|
|
54
|
+
localCurrencies
|
|
55
|
+
}
|
|
56
|
+
priceInclusions {
|
|
57
|
+
includeTaxes
|
|
58
|
+
}
|
|
59
|
+
webPresence {
|
|
60
|
+
domain {
|
|
61
|
+
host
|
|
62
|
+
}
|
|
63
|
+
defaultLocale
|
|
64
|
+
alternateLocales
|
|
65
|
+
subfolderSuffix
|
|
66
|
+
}
|
|
67
|
+
regions(first: 20) {
|
|
68
|
+
nodes {
|
|
69
|
+
... on MarketRegionCountry {
|
|
70
|
+
code
|
|
71
|
+
name
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
Variables: `{ "id": "gid://shopify/Market/123" }`
|
|
79
|
+
|
|
80
|
+
## Create Market
|
|
81
|
+
|
|
82
|
+
```graphql
|
|
83
|
+
mutation CreateMarket($input: MarketCreateInput!) {
|
|
84
|
+
marketCreate(input: $input) {
|
|
85
|
+
market {
|
|
86
|
+
id
|
|
87
|
+
name
|
|
88
|
+
handle
|
|
89
|
+
enabled
|
|
90
|
+
}
|
|
91
|
+
userErrors {
|
|
92
|
+
field
|
|
93
|
+
message
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
Variables:
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"input": {
|
|
102
|
+
"name": "European Union",
|
|
103
|
+
"handle": "eu",
|
|
104
|
+
"enabled": true,
|
|
105
|
+
"regions": [
|
|
106
|
+
{ "countryCode": "DE" },
|
|
107
|
+
{ "countryCode": "FR" },
|
|
108
|
+
{ "countryCode": "IT" },
|
|
109
|
+
{ "countryCode": "ES" },
|
|
110
|
+
{ "countryCode": "NL" }
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Update Market
|
|
117
|
+
|
|
118
|
+
```graphql
|
|
119
|
+
mutation UpdateMarket($id: ID!, $input: MarketUpdateInput!) {
|
|
120
|
+
marketUpdate(id: $id, input: $input) {
|
|
121
|
+
market {
|
|
122
|
+
id
|
|
123
|
+
name
|
|
124
|
+
enabled
|
|
125
|
+
}
|
|
126
|
+
userErrors {
|
|
127
|
+
field
|
|
128
|
+
message
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
Variables:
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"id": "gid://shopify/Market/123",
|
|
137
|
+
"input": {
|
|
138
|
+
"name": "EU Market",
|
|
139
|
+
"enabled": true
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Delete Market
|
|
145
|
+
|
|
146
|
+
```graphql
|
|
147
|
+
mutation DeleteMarket($id: ID!) {
|
|
148
|
+
marketDelete(id: $id) {
|
|
149
|
+
deletedId
|
|
150
|
+
userErrors {
|
|
151
|
+
field
|
|
152
|
+
message
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Market Localizations
|
|
159
|
+
|
|
160
|
+
### Get Market Localizable Resource
|
|
161
|
+
|
|
162
|
+
```graphql
|
|
163
|
+
query GetMarketLocalizableResource($resourceId: ID!) {
|
|
164
|
+
marketLocalizableResource(resourceId: $resourceId) {
|
|
165
|
+
resourceId
|
|
166
|
+
marketLocalizableContent {
|
|
167
|
+
key
|
|
168
|
+
value
|
|
169
|
+
digest
|
|
170
|
+
marketLocalizationsCount {
|
|
171
|
+
count
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### List Market Localizable Resources
|
|
179
|
+
|
|
180
|
+
```graphql
|
|
181
|
+
query ListMarketLocalizableResources($resourceType: MarketLocalizableResourceType!, $first: Int!) {
|
|
182
|
+
marketLocalizableResources(resourceType: $resourceType, first: $first) {
|
|
183
|
+
nodes {
|
|
184
|
+
resourceId
|
|
185
|
+
marketLocalizableContent {
|
|
186
|
+
key
|
|
187
|
+
value
|
|
188
|
+
digest
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Register Market Localizations
|
|
196
|
+
|
|
197
|
+
```graphql
|
|
198
|
+
mutation RegisterMarketLocalizations($resourceId: ID!, $marketLocalizations: [MarketLocalizationRegisterInput!]!) {
|
|
199
|
+
marketLocalizationsRegister(resourceId: $resourceId, marketLocalizations: $marketLocalizations) {
|
|
200
|
+
marketLocalizations {
|
|
201
|
+
key
|
|
202
|
+
value
|
|
203
|
+
marketId
|
|
204
|
+
}
|
|
205
|
+
userErrors {
|
|
206
|
+
field
|
|
207
|
+
message
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
Variables:
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"resourceId": "gid://shopify/Product/123",
|
|
216
|
+
"marketLocalizations": [
|
|
217
|
+
{
|
|
218
|
+
"key": "title",
|
|
219
|
+
"value": "Summer Collection T-Shirt (EU Edition)",
|
|
220
|
+
"marketId": "gid://shopify/Market/456",
|
|
221
|
+
"marketLocalizableContentDigest": "abc123digest"
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Remove Market Localizations
|
|
228
|
+
|
|
229
|
+
```graphql
|
|
230
|
+
mutation RemoveMarketLocalizations($resourceId: ID!, $marketLocalizationKeys: [String!]!, $marketIds: [ID!]!) {
|
|
231
|
+
marketLocalizationsRemove(resourceId: $resourceId, marketLocalizationKeys: $marketLocalizationKeys, marketIds: $marketIds) {
|
|
232
|
+
marketLocalizations {
|
|
233
|
+
key
|
|
234
|
+
marketId
|
|
235
|
+
}
|
|
236
|
+
userErrors {
|
|
237
|
+
field
|
|
238
|
+
message
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Resolve Market for Buyer
|
|
245
|
+
|
|
246
|
+
```graphql
|
|
247
|
+
query ResolveMarket($buyerSignal: BuyerSignalInput!) {
|
|
248
|
+
marketsResolvedValues(buyerSignal: $buyerSignal) {
|
|
249
|
+
market {
|
|
250
|
+
id
|
|
251
|
+
name
|
|
252
|
+
}
|
|
253
|
+
country {
|
|
254
|
+
code
|
|
255
|
+
}
|
|
256
|
+
language
|
|
257
|
+
currency
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
Variables:
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"buyerSignal": {
|
|
265
|
+
"countryCode": "DE",
|
|
266
|
+
"language": "de"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Market Types
|
|
272
|
+
|
|
273
|
+
| Type | Description |
|
|
274
|
+
|------|-------------|
|
|
275
|
+
| `PRIMARY` | Default market (usually domestic) |
|
|
276
|
+
| `INTERNATIONAL` | Standard international markets |
|
|
277
|
+
| `B2B` | Business-to-business markets |
|
|
278
|
+
| `SINGLE_COUNTRY` | Market for one country |
|
|
279
|
+
| `MULTI_COUNTRY` | Market spanning multiple countries |
|
|
280
|
+
|
|
281
|
+
## Market Localizable Resource Types
|
|
282
|
+
|
|
283
|
+
| Type | Description |
|
|
284
|
+
|------|-------------|
|
|
285
|
+
| `PRODUCT` | Products |
|
|
286
|
+
| `PRODUCT_VARIANT` | Product variants |
|
|
287
|
+
| `COLLECTION` | Collections |
|
|
288
|
+
| `METAFIELD` | Metafields |
|
|
289
|
+
| `METAOBJECT` | Metaobjects |
|
|
290
|
+
|
|
291
|
+
## Currency Settings
|
|
292
|
+
|
|
293
|
+
Markets can use:
|
|
294
|
+
- **Base currency** - The shop's default currency
|
|
295
|
+
- **Local currencies** - Show prices in buyer's local currency
|
|
296
|
+
|
|
297
|
+
```graphql
|
|
298
|
+
query GetMarketCurrencySettings($id: ID!) {
|
|
299
|
+
market(id: $id) {
|
|
300
|
+
currencySettings {
|
|
301
|
+
baseCurrency {
|
|
302
|
+
currencyCode
|
|
303
|
+
currencyName
|
|
304
|
+
}
|
|
305
|
+
localCurrencies
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Web Presence
|
|
312
|
+
|
|
313
|
+
Configure how the market appears on the storefront:
|
|
314
|
+
|
|
315
|
+
```graphql
|
|
316
|
+
query GetMarketWebPresence($id: ID!) {
|
|
317
|
+
market(id: $id) {
|
|
318
|
+
webPresence {
|
|
319
|
+
domain {
|
|
320
|
+
host
|
|
321
|
+
}
|
|
322
|
+
subfolderSuffix
|
|
323
|
+
defaultLocale
|
|
324
|
+
alternateLocales
|
|
325
|
+
rootUrls {
|
|
326
|
+
locale
|
|
327
|
+
url
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## API Scopes Required
|
|
335
|
+
|
|
336
|
+
- `read_markets` - Read market configurations
|
|
337
|
+
- `write_markets` - Create, update, delete markets
|
|
338
|
+
- `read_translations` - Read market localizations
|
|
339
|
+
- `write_translations` - Manage market localizations
|
|
340
|
+
|
|
341
|
+
## Notes
|
|
342
|
+
|
|
343
|
+
- Each shop has one primary market (usually domestic sales)
|
|
344
|
+
- Markets can overlap in regions but buyers are matched to one market
|
|
345
|
+
- Market-specific content overrides default translations
|
|
346
|
+
- Currency conversion uses Shopify's exchange rates
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# Shopify Menus
|
|
2
|
+
|
|
3
|
+
Manage navigation menus for the online store via the GraphQL Admin API.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Menus organize navigation links that help customers find collections, products, pages, blogs, and external URLs. Menus support nested items up to three levels deep.
|
|
8
|
+
|
|
9
|
+
## List Menus
|
|
10
|
+
|
|
11
|
+
```graphql
|
|
12
|
+
query ListMenus($first: Int!) {
|
|
13
|
+
menus(first: $first) {
|
|
14
|
+
nodes {
|
|
15
|
+
id
|
|
16
|
+
title
|
|
17
|
+
handle
|
|
18
|
+
itemsCount {
|
|
19
|
+
count
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
Variables: `{ "first": 10 }`
|
|
26
|
+
|
|
27
|
+
## Get Menu
|
|
28
|
+
|
|
29
|
+
```graphql
|
|
30
|
+
query GetMenu($id: ID!) {
|
|
31
|
+
menu(id: $id) {
|
|
32
|
+
id
|
|
33
|
+
title
|
|
34
|
+
handle
|
|
35
|
+
items {
|
|
36
|
+
id
|
|
37
|
+
title
|
|
38
|
+
type
|
|
39
|
+
url
|
|
40
|
+
resourceId
|
|
41
|
+
items {
|
|
42
|
+
id
|
|
43
|
+
title
|
|
44
|
+
type
|
|
45
|
+
url
|
|
46
|
+
items {
|
|
47
|
+
id
|
|
48
|
+
title
|
|
49
|
+
url
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
Variables: `{ "id": "gid://shopify/Menu/123" }`
|
|
57
|
+
|
|
58
|
+
## Create Menu
|
|
59
|
+
|
|
60
|
+
```graphql
|
|
61
|
+
mutation CreateMenu($title: String!, $handle: String!, $items: [MenuItemCreateInput!]!) {
|
|
62
|
+
menuCreate(title: $title, handle: $handle, items: $items) {
|
|
63
|
+
menu {
|
|
64
|
+
id
|
|
65
|
+
title
|
|
66
|
+
handle
|
|
67
|
+
}
|
|
68
|
+
userErrors {
|
|
69
|
+
field
|
|
70
|
+
message
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
Variables:
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"title": "Main Menu",
|
|
79
|
+
"handle": "main-menu",
|
|
80
|
+
"items": [
|
|
81
|
+
{
|
|
82
|
+
"title": "Home",
|
|
83
|
+
"type": "FRONTPAGE",
|
|
84
|
+
"url": "/"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"title": "Shop",
|
|
88
|
+
"type": "COLLECTION",
|
|
89
|
+
"resourceId": "gid://shopify/Collection/123"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"title": "About",
|
|
93
|
+
"type": "PAGE",
|
|
94
|
+
"resourceId": "gid://shopify/Page/456"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"title": "Contact",
|
|
98
|
+
"type": "HTTP",
|
|
99
|
+
"url": "/pages/contact"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Create Menu with Nested Items
|
|
106
|
+
|
|
107
|
+
```graphql
|
|
108
|
+
mutation CreateMenuWithNesting($title: String!, $handle: String!, $items: [MenuItemCreateInput!]!) {
|
|
109
|
+
menuCreate(title: $title, handle: $handle, items: $items) {
|
|
110
|
+
menu {
|
|
111
|
+
id
|
|
112
|
+
title
|
|
113
|
+
items {
|
|
114
|
+
title
|
|
115
|
+
items {
|
|
116
|
+
title
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
userErrors {
|
|
121
|
+
field
|
|
122
|
+
message
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
Variables:
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"title": "Shop By Category",
|
|
131
|
+
"handle": "shop-categories",
|
|
132
|
+
"items": [
|
|
133
|
+
{
|
|
134
|
+
"title": "Clothing",
|
|
135
|
+
"type": "COLLECTION",
|
|
136
|
+
"resourceId": "gid://shopify/Collection/100",
|
|
137
|
+
"items": [
|
|
138
|
+
{
|
|
139
|
+
"title": "T-Shirts",
|
|
140
|
+
"type": "COLLECTION",
|
|
141
|
+
"resourceId": "gid://shopify/Collection/101"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"title": "Pants",
|
|
145
|
+
"type": "COLLECTION",
|
|
146
|
+
"resourceId": "gid://shopify/Collection/102"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"title": "Dresses",
|
|
150
|
+
"type": "COLLECTION",
|
|
151
|
+
"resourceId": "gid://shopify/Collection/103"
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"title": "Accessories",
|
|
157
|
+
"type": "COLLECTION",
|
|
158
|
+
"resourceId": "gid://shopify/Collection/200",
|
|
159
|
+
"items": [
|
|
160
|
+
{
|
|
161
|
+
"title": "Hats",
|
|
162
|
+
"type": "COLLECTION",
|
|
163
|
+
"resourceId": "gid://shopify/Collection/201"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"title": "Bags",
|
|
167
|
+
"type": "COLLECTION",
|
|
168
|
+
"resourceId": "gid://shopify/Collection/202"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Update Menu
|
|
177
|
+
|
|
178
|
+
```graphql
|
|
179
|
+
mutation UpdateMenu($id: ID!, $title: String!, $handle: String, $items: [MenuItemUpdateInput!]!) {
|
|
180
|
+
menuUpdate(id: $id, title: $title, handle: $handle, items: $items) {
|
|
181
|
+
menu {
|
|
182
|
+
id
|
|
183
|
+
title
|
|
184
|
+
handle
|
|
185
|
+
items {
|
|
186
|
+
title
|
|
187
|
+
url
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
userErrors {
|
|
191
|
+
field
|
|
192
|
+
message
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
Variables:
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"id": "gid://shopify/Menu/123",
|
|
201
|
+
"title": "Main Navigation",
|
|
202
|
+
"items": [
|
|
203
|
+
{
|
|
204
|
+
"title": "Home",
|
|
205
|
+
"type": "FRONTPAGE",
|
|
206
|
+
"url": "/"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"title": "New Arrivals",
|
|
210
|
+
"type": "COLLECTION",
|
|
211
|
+
"resourceId": "gid://shopify/Collection/789"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"title": "Sale",
|
|
215
|
+
"type": "COLLECTION",
|
|
216
|
+
"resourceId": "gid://shopify/Collection/999"
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Delete Menu
|
|
223
|
+
|
|
224
|
+
```graphql
|
|
225
|
+
mutation DeleteMenu($id: ID!) {
|
|
226
|
+
menuDelete(id: $id) {
|
|
227
|
+
deletedMenuId
|
|
228
|
+
userErrors {
|
|
229
|
+
field
|
|
230
|
+
message
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Menu Item Types
|
|
237
|
+
|
|
238
|
+
| Type | Description | Required Field |
|
|
239
|
+
|------|-------------|----------------|
|
|
240
|
+
| `FRONTPAGE` | Link to homepage | `url: "/"` |
|
|
241
|
+
| `COLLECTION` | Link to a collection | `resourceId` |
|
|
242
|
+
| `PRODUCT` | Link to a product | `resourceId` |
|
|
243
|
+
| `PAGE` | Link to a page | `resourceId` |
|
|
244
|
+
| `BLOG` | Link to a blog | `resourceId` |
|
|
245
|
+
| `ARTICLE` | Link to an article | `resourceId` |
|
|
246
|
+
| `HTTP` | Custom URL (internal) | `url` |
|
|
247
|
+
| `SEARCH` | Link to search page | - |
|
|
248
|
+
| `CATALOG` | Link to catalog | - |
|
|
249
|
+
|
|
250
|
+
## Common Menu Handles
|
|
251
|
+
|
|
252
|
+
| Handle | Description |
|
|
253
|
+
|--------|-------------|
|
|
254
|
+
| `main-menu` | Primary navigation |
|
|
255
|
+
| `footer` | Footer navigation |
|
|
256
|
+
| `header` | Header links |
|
|
257
|
+
|
|
258
|
+
## Footer Menu Example
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"title": "Footer",
|
|
263
|
+
"handle": "footer",
|
|
264
|
+
"items": [
|
|
265
|
+
{
|
|
266
|
+
"title": "Quick Links",
|
|
267
|
+
"type": "HTTP",
|
|
268
|
+
"url": "#",
|
|
269
|
+
"items": [
|
|
270
|
+
{
|
|
271
|
+
"title": "Search",
|
|
272
|
+
"type": "SEARCH"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"title": "About Us",
|
|
276
|
+
"type": "PAGE",
|
|
277
|
+
"resourceId": "gid://shopify/Page/123"
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"title": "Policies",
|
|
283
|
+
"type": "HTTP",
|
|
284
|
+
"url": "#",
|
|
285
|
+
"items": [
|
|
286
|
+
{
|
|
287
|
+
"title": "Privacy Policy",
|
|
288
|
+
"type": "PAGE",
|
|
289
|
+
"resourceId": "gid://shopify/Page/456"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"title": "Terms of Service",
|
|
293
|
+
"type": "PAGE",
|
|
294
|
+
"resourceId": "gid://shopify/Page/789"
|
|
295
|
+
}
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## API Scopes Required
|
|
303
|
+
|
|
304
|
+
- `read_online_store_navigation` - Read menus
|
|
305
|
+
- `write_online_store_navigation` - Create, update, delete menus
|
|
306
|
+
|
|
307
|
+
## Notes
|
|
308
|
+
|
|
309
|
+
- Default menus (`main-menu`, `footer`) cannot have their handles changed
|
|
310
|
+
- Maximum nesting depth is 3 levels
|
|
311
|
+
- Menu updates replace all items (not partial update)
|
|
312
|
+
- Resource IDs must be valid Shopify global IDs
|
|
313
|
+
- Use `HTTP` type for relative URLs within the store
|