1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "bom": [
12 {
13 "bundleSku": "KIT-STARTER",
14 "componentSku": "MUG-BLUE",
15 "quantity": 1
16 },
17 {
18 "bundleSku": "KIT-STARTER",
19 "componentSku": "TEA-SAMPLER",
20 "quantity": 2
21 },
22 {
23 "bundleSku": "KIT-GIFT",
24 "componentSku": "MUG-BLUE",
25 "quantity": 1
26 },
27 {
28 "bundleSku": "KIT-GIFT",
29 "componentSku": "CANDLE-S",
30 "quantity": 1
31 },
32 {
33 "bundleSku": "KIT-TRAVEL",
34 "componentSku": "BOTTLE-500",
35 "quantity": 1
36 },
37 {
38 "bundleSku": "KIT-TRAVEL",
39 "componentSku": "POUCH-GREY",
40 "quantity": 1
41 }
42 ],
43 "before": {
44 "label": "Monday export",
45 "capturedAt": "2026-11-02T09:00:00Z",
46 "rows": [
47 {
48 "sku": "MUG-BLUE",
49 "available": true
50 },
51 {
52 "sku": "TEA-SAMPLER",
53 "available": true
54 },
55 {
56 "sku": "CANDLE-S",
57 "available": true
58 },
59 {
60 "sku": "BOTTLE-500",
61 "available": false
62 },
63 {
64 "sku": "KIT-STARTER",
65 "available": true
66 },
67 {
68 "sku": "KIT-GIFT",
69 "available": true
70 },
71 {
72 "sku": "KIT-TRAVEL",
73 "available": true
74 }
75 ]
76 },
77 "after": {
78 "label": "Thursday export",
79 "capturedAt": "2026-11-05T09:00:00Z",
80 "rows": [
81 {
82 "sku": "MUG-BLUE",
83 "available": false
84 },
85 {
86 "sku": "TEA-SAMPLER",
87 "available": true
88 },
89 {
90 "sku": "CANDLE-S",
91 "available": true
92 },
93 {
94 "sku": "BOTTLE-500",
95 "available": true
96 },
97 {
98 "sku": "KIT-STARTER",
99 "available": true
100 },
101 {
102 "sku": "KIT-GIFT",
103 "available": true
104 },
105 {
106 "sku": "KIT-TRAVEL",
107 "available": true
108 }
109 ]
110 }
111};
112
113
114const run = await client.actor("practical_ai_lab_jp/pal-shopify-bundle-component-availability-audit").call(input);
115
116
117console.log('Results from dataset');
118console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
119const { items } = await client.dataset(run.defaultDatasetId).listItems();
120items.forEach((item) => {
121 console.dir(item);
122});
123
124