1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "snapshotId": "demo-2026-10-04",
12 "snapshotCoverage": "partial",
13 "executionModel": "simultaneous-outbound",
14 "inventory": [
15 {
16 "rowId": "i-a",
17 "sku": "001",
18 "locationId": "A",
19 "unit": "each",
20 "availableQuantity": "10",
21 "reserveFloor": "3",
22 "snapshotId": "demo-2026-10-04"
23 },
24 {
25 "rowId": "i-b",
26 "sku": "001",
27 "locationId": "B",
28 "unit": "each",
29 "availableQuantity": "0",
30 "reserveFloor": "0",
31 "snapshotId": "demo-2026-10-04"
32 },
33 {
34 "rowId": "i-c",
35 "sku": "001",
36 "locationId": "C",
37 "unit": "each",
38 "availableQuantity": "0",
39 "reserveFloor": "0",
40 "snapshotId": "demo-2026-10-04"
41 },
42 {
43 "rowId": "i-d",
44 "sku": "002",
45 "locationId": "D",
46 "unit": "each",
47 "availableQuantity": "7.25",
48 "reserveFloor": "1",
49 "snapshotId": "demo-2026-10-04"
50 },
51 {
52 "rowId": "i-e",
53 "sku": "002",
54 "locationId": "E",
55 "unit": "each",
56 "availableQuantity": "0",
57 "reserveFloor": "0",
58 "snapshotId": "demo-2026-10-04"
59 },
60 {
61 "rowId": "i-f-case",
62 "sku": "003",
63 "locationId": "F",
64 "unit": "case",
65 "availableQuantity": "15",
66 "reserveFloor": "0",
67 "snapshotId": "demo-2026-10-04"
68 },
69 {
70 "rowId": "i-g",
71 "sku": "003",
72 "locationId": "G",
73 "unit": "each",
74 "availableQuantity": "0",
75 "reserveFloor": "0",
76 "snapshotId": "demo-2026-10-04"
77 },
78 {
79 "rowId": "i-n",
80 "sku": "004",
81 "locationId": "N",
82 "unit": "each",
83 "availableQuantity": "0",
84 "reserveFloor": "0",
85 "snapshotId": "demo-2026-10-04"
86 },
87 {
88 "rowId": "i-m-old",
89 "sku": "004",
90 "locationId": "M",
91 "unit": "each",
92 "availableQuantity": "99",
93 "reserveFloor": "0",
94 "snapshotId": "previous-snapshot"
95 },
96 {
97 "rowId": "i-z",
98 "sku": "005",
99 "locationId": "Z",
100 "unit": "kg",
101 "availableQuantity": "4.5",
102 "reserveFloor": "0.5",
103 "snapshotId": "demo-2026-10-04"
104 }
105 ],
106 "inventoryCsv": "",
107 "inventoryColumns": {
108 "rowId": "rowId",
109 "sku": "sku",
110 "locationId": "locationId",
111 "unit": "unit",
112 "availableQuantity": "availableQuantity",
113 "reserveFloor": "reserveFloor",
114 "snapshotId": "snapshotId"
115 },
116 "transfers": [
117 {
118 "rowId": "t-shared-1",
119 "sku": "001",
120 "fromLocationId": "A",
121 "toLocationId": "B",
122 "unit": "each",
123 "quantity": "4",
124 "sequence": 1
125 },
126 {
127 "rowId": "t-shared-2",
128 "sku": "001",
129 "fromLocationId": "A",
130 "toLocationId": "C",
131 "unit": "each",
132 "quantity": "4",
133 "sequence": 2
134 },
135 {
136 "rowId": "t-valid",
137 "sku": "002",
138 "fromLocationId": "D",
139 "toLocationId": "E",
140 "unit": "each",
141 "quantity": "2.125",
142 "sequence": 3
143 },
144 {
145 "rowId": "t-unit",
146 "sku": "003",
147 "fromLocationId": "F",
148 "toLocationId": "G",
149 "unit": "each",
150 "quantity": "1",
151 "sequence": 4
152 },
153 {
154 "rowId": "t-missing",
155 "sku": "004",
156 "fromLocationId": "M",
157 "toLocationId": "N",
158 "unit": "each",
159 "quantity": "2",
160 "sequence": 5
161 }
162 ],
163 "transfersCsv": "",
164 "transferColumns": {
165 "rowId": "rowId",
166 "sku": "sku",
167 "fromLocationId": "fromLocationId",
168 "toLocationId": "toLocationId",
169 "unit": "unit",
170 "quantity": "quantity",
171 "sequence": "sequence"
172 }
173};
174
175
176const run = await client.actor("h_murdock/stock-transfer-plan-evidence").call(input);
177
178
179console.log('Results from dataset');
180console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
181const { items } = await client.dataset(run.defaultDatasetId).listItems();
182items.forEach((item) => {
183 console.dir(item);
184});
185
186