@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,495 @@
|
|
|
1
|
+
# Shopify Draft Orders
|
|
2
|
+
|
|
3
|
+
Create and manage draft orders for phone, in-person, or B2B sales via the GraphQL Admin API.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Draft orders are orders created by merchants on behalf of customers. They can be sent as invoices or completed directly. Once paid, they convert to regular orders.
|
|
8
|
+
|
|
9
|
+
## List Draft Orders
|
|
10
|
+
|
|
11
|
+
```graphql
|
|
12
|
+
query ListDraftOrders($first: Int!, $after: String, $query: String) {
|
|
13
|
+
draftOrders(first: $first, after: $after, query: $query, sortKey: UPDATED_AT, reverse: true) {
|
|
14
|
+
pageInfo {
|
|
15
|
+
hasNextPage
|
|
16
|
+
endCursor
|
|
17
|
+
}
|
|
18
|
+
nodes {
|
|
19
|
+
id
|
|
20
|
+
name
|
|
21
|
+
status
|
|
22
|
+
totalPrice
|
|
23
|
+
currencyCode
|
|
24
|
+
createdAt
|
|
25
|
+
customer {
|
|
26
|
+
displayName
|
|
27
|
+
defaultEmailAddress {
|
|
28
|
+
emailAddress
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
Variables: `{ "first": 10 }`
|
|
36
|
+
|
|
37
|
+
## Get Draft Order
|
|
38
|
+
|
|
39
|
+
```graphql
|
|
40
|
+
query GetDraftOrder($id: ID!) {
|
|
41
|
+
draftOrder(id: $id) {
|
|
42
|
+
id
|
|
43
|
+
name
|
|
44
|
+
status
|
|
45
|
+
createdAt
|
|
46
|
+
invoiceUrl
|
|
47
|
+
totalPrice
|
|
48
|
+
subtotalPrice
|
|
49
|
+
totalTax
|
|
50
|
+
currencyCode
|
|
51
|
+
customer {
|
|
52
|
+
id
|
|
53
|
+
displayName
|
|
54
|
+
defaultEmailAddress {
|
|
55
|
+
emailAddress
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
shippingAddress {
|
|
59
|
+
address1
|
|
60
|
+
city
|
|
61
|
+
provinceCode
|
|
62
|
+
countryCode
|
|
63
|
+
zip
|
|
64
|
+
}
|
|
65
|
+
billingAddress {
|
|
66
|
+
address1
|
|
67
|
+
city
|
|
68
|
+
provinceCode
|
|
69
|
+
countryCode
|
|
70
|
+
zip
|
|
71
|
+
}
|
|
72
|
+
lineItems(first: 20) {
|
|
73
|
+
nodes {
|
|
74
|
+
id
|
|
75
|
+
title
|
|
76
|
+
quantity
|
|
77
|
+
originalUnitPrice
|
|
78
|
+
product {
|
|
79
|
+
id
|
|
80
|
+
}
|
|
81
|
+
variant {
|
|
82
|
+
id
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
appliedDiscount {
|
|
87
|
+
title
|
|
88
|
+
value
|
|
89
|
+
valueType
|
|
90
|
+
}
|
|
91
|
+
shippingLine {
|
|
92
|
+
title
|
|
93
|
+
price
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
Variables: `{ "id": "gid://shopify/DraftOrder/123" }`
|
|
99
|
+
|
|
100
|
+
## Create Draft Order
|
|
101
|
+
|
|
102
|
+
```graphql
|
|
103
|
+
mutation CreateDraftOrder($input: DraftOrderInput!) {
|
|
104
|
+
draftOrderCreate(input: $input) {
|
|
105
|
+
draftOrder {
|
|
106
|
+
id
|
|
107
|
+
name
|
|
108
|
+
invoiceUrl
|
|
109
|
+
status
|
|
110
|
+
}
|
|
111
|
+
userErrors {
|
|
112
|
+
field
|
|
113
|
+
message
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
Variables:
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"input": {
|
|
122
|
+
"customerId": "gid://shopify/Customer/123",
|
|
123
|
+
"lineItems": [
|
|
124
|
+
{
|
|
125
|
+
"variantId": "gid://shopify/ProductVariant/456",
|
|
126
|
+
"quantity": 2
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"variantId": "gid://shopify/ProductVariant/789",
|
|
130
|
+
"quantity": 1
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"shippingAddress": {
|
|
134
|
+
"firstName": "John",
|
|
135
|
+
"lastName": "Doe",
|
|
136
|
+
"address1": "123 Main St",
|
|
137
|
+
"city": "New York",
|
|
138
|
+
"provinceCode": "NY",
|
|
139
|
+
"countryCode": "US",
|
|
140
|
+
"zip": "10001"
|
|
141
|
+
},
|
|
142
|
+
"note": "Customer requested gift wrapping"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Create Draft Order with Custom Item
|
|
148
|
+
|
|
149
|
+
```graphql
|
|
150
|
+
mutation CreateDraftOrderCustomItem($input: DraftOrderInput!) {
|
|
151
|
+
draftOrderCreate(input: $input) {
|
|
152
|
+
draftOrder {
|
|
153
|
+
id
|
|
154
|
+
lineItems(first: 5) {
|
|
155
|
+
nodes {
|
|
156
|
+
title
|
|
157
|
+
originalUnitPrice
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
userErrors {
|
|
162
|
+
field
|
|
163
|
+
message
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
Variables:
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"input": {
|
|
172
|
+
"lineItems": [
|
|
173
|
+
{
|
|
174
|
+
"title": "Custom Engraving Service",
|
|
175
|
+
"quantity": 1,
|
|
176
|
+
"originalUnitPriceSet": {
|
|
177
|
+
"shopMoney": {
|
|
178
|
+
"amount": "25.00",
|
|
179
|
+
"currencyCode": "USD"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"taxable": true
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Create Draft Order with Discount
|
|
190
|
+
|
|
191
|
+
```graphql
|
|
192
|
+
mutation CreateDraftOrderWithDiscount($input: DraftOrderInput!) {
|
|
193
|
+
draftOrderCreate(input: $input) {
|
|
194
|
+
draftOrder {
|
|
195
|
+
id
|
|
196
|
+
appliedDiscount {
|
|
197
|
+
title
|
|
198
|
+
value
|
|
199
|
+
}
|
|
200
|
+
totalPrice
|
|
201
|
+
}
|
|
202
|
+
userErrors {
|
|
203
|
+
field
|
|
204
|
+
message
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
Variables:
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"input": {
|
|
213
|
+
"lineItems": [
|
|
214
|
+
{
|
|
215
|
+
"variantId": "gid://shopify/ProductVariant/456",
|
|
216
|
+
"quantity": 1
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
"appliedDiscount": {
|
|
220
|
+
"title": "VIP Discount",
|
|
221
|
+
"value": 15,
|
|
222
|
+
"valueType": "PERCENTAGE"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Update Draft Order
|
|
229
|
+
|
|
230
|
+
```graphql
|
|
231
|
+
mutation UpdateDraftOrder($id: ID!, $input: DraftOrderInput!) {
|
|
232
|
+
draftOrderUpdate(id: $id, input: $input) {
|
|
233
|
+
draftOrder {
|
|
234
|
+
id
|
|
235
|
+
lineItems(first: 10) {
|
|
236
|
+
nodes {
|
|
237
|
+
title
|
|
238
|
+
quantity
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
userErrors {
|
|
243
|
+
field
|
|
244
|
+
message
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
Variables:
|
|
250
|
+
```json
|
|
251
|
+
{
|
|
252
|
+
"id": "gid://shopify/DraftOrder/123",
|
|
253
|
+
"input": {
|
|
254
|
+
"lineItems": [
|
|
255
|
+
{
|
|
256
|
+
"variantId": "gid://shopify/ProductVariant/456",
|
|
257
|
+
"quantity": 3
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Calculate Draft Order
|
|
265
|
+
|
|
266
|
+
Preview pricing without creating:
|
|
267
|
+
|
|
268
|
+
```graphql
|
|
269
|
+
mutation CalculateDraftOrder($input: DraftOrderInput!) {
|
|
270
|
+
draftOrderCalculate(input: $input) {
|
|
271
|
+
calculatedDraftOrder {
|
|
272
|
+
subtotalPrice
|
|
273
|
+
totalPrice
|
|
274
|
+
totalTax
|
|
275
|
+
lineItems {
|
|
276
|
+
title
|
|
277
|
+
quantity
|
|
278
|
+
discountedTotal
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
userErrors {
|
|
282
|
+
field
|
|
283
|
+
message
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Send Invoice
|
|
290
|
+
|
|
291
|
+
```graphql
|
|
292
|
+
mutation SendDraftOrderInvoice($id: ID!, $email: EmailInput) {
|
|
293
|
+
draftOrderInvoiceSend(id: $id, email: $email) {
|
|
294
|
+
draftOrder {
|
|
295
|
+
id
|
|
296
|
+
invoiceSentAt
|
|
297
|
+
}
|
|
298
|
+
userErrors {
|
|
299
|
+
field
|
|
300
|
+
message
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
Variables:
|
|
306
|
+
```json
|
|
307
|
+
{
|
|
308
|
+
"id": "gid://shopify/DraftOrder/123",
|
|
309
|
+
"email": {
|
|
310
|
+
"to": "customer@example.com",
|
|
311
|
+
"subject": "Your Order Invoice",
|
|
312
|
+
"customMessage": "Thank you for your order! Please complete your payment."
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Complete Draft Order
|
|
318
|
+
|
|
319
|
+
> REQUIRES PERMISSION: Completing a draft order converts it to a real order, commits the transaction, and may deduct inventory. This action cannot be reversed. Always ask the user for explicit confirmation, show the draft order details and total, and wait for approval before executing this operation.
|
|
320
|
+
|
|
321
|
+
Convert to a real order:
|
|
322
|
+
|
|
323
|
+
```graphql
|
|
324
|
+
mutation CompleteDraftOrder($id: ID!) {
|
|
325
|
+
draftOrderComplete(id: $id) {
|
|
326
|
+
draftOrder {
|
|
327
|
+
id
|
|
328
|
+
status
|
|
329
|
+
order {
|
|
330
|
+
id
|
|
331
|
+
name
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
userErrors {
|
|
335
|
+
field
|
|
336
|
+
message
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## Complete with Payment Pending
|
|
343
|
+
|
|
344
|
+
```graphql
|
|
345
|
+
mutation CompleteDraftOrderPending($id: ID!) {
|
|
346
|
+
draftOrderComplete(id: $id, paymentPending: true) {
|
|
347
|
+
draftOrder {
|
|
348
|
+
order {
|
|
349
|
+
id
|
|
350
|
+
displayFinancialStatus
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
userErrors {
|
|
354
|
+
field
|
|
355
|
+
message
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
## Delete Draft Order
|
|
362
|
+
|
|
363
|
+
> REQUIRES PERMISSION: Deleting a draft order is PERMANENT and cannot be undone. All draft order data will be lost. Always ask the user for explicit confirmation, show the draft order details, and wait for approval before executing this operation.
|
|
364
|
+
|
|
365
|
+
```graphql
|
|
366
|
+
mutation DeleteDraftOrder($input: DraftOrderDeleteInput!) {
|
|
367
|
+
draftOrderDelete(input: $input) {
|
|
368
|
+
deletedId
|
|
369
|
+
userErrors {
|
|
370
|
+
field
|
|
371
|
+
message
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
Variables:
|
|
377
|
+
```json
|
|
378
|
+
{
|
|
379
|
+
"input": {
|
|
380
|
+
"id": "gid://shopify/DraftOrder/123"
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
## Duplicate Draft Order
|
|
386
|
+
|
|
387
|
+
```graphql
|
|
388
|
+
mutation DuplicateDraftOrder($id: ID!) {
|
|
389
|
+
draftOrderDuplicate(id: $id) {
|
|
390
|
+
draftOrder {
|
|
391
|
+
id
|
|
392
|
+
name
|
|
393
|
+
}
|
|
394
|
+
userErrors {
|
|
395
|
+
field
|
|
396
|
+
message
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
## Bulk Delete Draft Orders
|
|
403
|
+
|
|
404
|
+
> REQUIRES PERMISSION: Bulk deleting draft orders is PERMANENT and removes multiple draft orders at once. This cannot be undone. Always ask the user for explicit confirmation, list the draft orders to be deleted, and wait for approval before executing this operation.
|
|
405
|
+
|
|
406
|
+
```graphql
|
|
407
|
+
mutation BulkDeleteDraftOrders($ids: [ID!]) {
|
|
408
|
+
draftOrderBulkDelete(ids: $ids) {
|
|
409
|
+
job {
|
|
410
|
+
id
|
|
411
|
+
done
|
|
412
|
+
}
|
|
413
|
+
userErrors {
|
|
414
|
+
field
|
|
415
|
+
message
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
## Add Tags to Draft Orders
|
|
422
|
+
|
|
423
|
+
```graphql
|
|
424
|
+
mutation AddTagsToDraftOrders($ids: [ID!], $tags: [String!]!) {
|
|
425
|
+
draftOrderBulkAddTags(ids: $ids, tags: $tags) {
|
|
426
|
+
job {
|
|
427
|
+
id
|
|
428
|
+
}
|
|
429
|
+
userErrors {
|
|
430
|
+
field
|
|
431
|
+
message
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
Variables:
|
|
437
|
+
```json
|
|
438
|
+
{
|
|
439
|
+
"ids": ["gid://shopify/DraftOrder/123", "gid://shopify/DraftOrder/456"],
|
|
440
|
+
"tags": ["wholesale", "priority"]
|
|
441
|
+
}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
## Draft Order Status
|
|
445
|
+
|
|
446
|
+
| Status | Description |
|
|
447
|
+
|--------|-------------|
|
|
448
|
+
| `OPEN` | Not yet completed |
|
|
449
|
+
| `INVOICE_SENT` | Invoice emailed to customer |
|
|
450
|
+
| `COMPLETED` | Converted to order |
|
|
451
|
+
|
|
452
|
+
## Discount Value Types
|
|
453
|
+
|
|
454
|
+
| Type | Description |
|
|
455
|
+
|------|-------------|
|
|
456
|
+
| `FIXED_AMOUNT` | Fixed dollar/currency amount |
|
|
457
|
+
| `PERCENTAGE` | Percentage off |
|
|
458
|
+
|
|
459
|
+
## Reserve Inventory
|
|
460
|
+
|
|
461
|
+
```json
|
|
462
|
+
{
|
|
463
|
+
"input": {
|
|
464
|
+
"lineItems": [...],
|
|
465
|
+
"reserveInventoryUntil": "2025-01-20T00:00:00Z"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
## API Scopes Required
|
|
471
|
+
|
|
472
|
+
- `read_draft_orders` - Read draft orders
|
|
473
|
+
- `write_draft_orders` - Create, update, delete draft orders
|
|
474
|
+
|
|
475
|
+
## Notes
|
|
476
|
+
|
|
477
|
+
- Draft orders don't deduct inventory until completed
|
|
478
|
+
- Use `reserveInventoryUntil` to hold inventory temporarily
|
|
479
|
+
- Invoice URLs are secure checkout links
|
|
480
|
+
- Custom line items don't require product variants
|
|
481
|
+
- Completing a draft order creates a real order
|
|
482
|
+
|
|
483
|
+
## Dangerous Operations in This Skill
|
|
484
|
+
|
|
485
|
+
The following operations require explicit user permission before execution:
|
|
486
|
+
|
|
487
|
+
| Operation | Impact | Reversible |
|
|
488
|
+
|-----------|--------|------------|
|
|
489
|
+
| `draftOrderComplete` | Converts draft to real order, commits transaction, may deduct inventory | No - Creates permanent order |
|
|
490
|
+
| `draftOrderDelete` | Permanently deletes draft order | No - IRREVERSIBLE |
|
|
491
|
+
| `draftOrderBulkDelete` | Permanently deletes multiple draft orders at once | No - IRREVERSIBLE |
|
|
492
|
+
|
|
493
|
+
Permission Protocol:
|
|
494
|
+
- For completion: Show draft order ID, customer, line items, and total amount
|
|
495
|
+
- For deletions: Show draft order details, emphasize permanence, wait for explicit "yes", "confirm", or "proceed"
|