1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "countFile": {
12 "rows": [
13 {
14 "warehouse": "DEMO-WH",
15 "location": "A-01",
16 "sku": "SKU-001",
17 "qty": "8",
18 "unit": "EA",
19 "count_id": "CNT-001",
20 "counted_at": "2026-11-11T10:00:00Z"
21 },
22 {
23 "warehouse": "DEMO-WH",
24 "location": "A-01",
25 "sku": "SKU-002",
26 "qty": "12",
27 "unit": "EA",
28 "count_id": "CNT-002",
29 "counted_at": "2026-11-11T10:00:00Z"
30 },
31 {
32 "warehouse": "DEMO-WH",
33 "location": "A-01",
34 "sku": "SKU-003",
35 "qty": "4",
36 "unit": "EA",
37 "count_id": "CNT-003",
38 "counted_at": "2026-11-11T10:00:00Z"
39 }
40 ]
41 },
42 "inventorySnapshotFile": {
43 "rows": [
44 {
45 "warehouse": "DEMO-WH",
46 "location": "A-01",
47 "sku": "SKU-001",
48 "qty": "10",
49 "unit": "EA"
50 },
51 {
52 "warehouse": "DEMO-WH",
53 "location": "A-01",
54 "sku": "SKU-002",
55 "qty": "10",
56 "unit": "EA"
57 },
58 {
59 "warehouse": "DEMO-WH",
60 "location": "A-01",
61 "sku": "SKU-003",
62 "qty": "5",
63 "unit": "EA"
64 },
65 {
66 "warehouse": "DEMO-WH",
67 "location": "A-01",
68 "sku": "SKU-004",
69 "qty": "7",
70 "unit": "EA"
71 }
72 ]
73 },
74 "unitCostsFile": {
75 "rows": [
76 {
77 "sku": "SKU-001",
78 "unit": "EA",
79 "unit_cost": "2.50",
80 "currency": "USD"
81 },
82 {
83 "sku": "SKU-002",
84 "unit": "EA",
85 "unit_cost": "3.00",
86 "currency": "EUR"
87 }
88 ]
89 },
90 "snapshotTime": "2026-11-11T10:00:00Z"
91};
92
93
94const run = await client.actor("afkdigital/newapi88-warehouse-cycle-count-variance").call(input);
95
96
97console.log('Results from dataset');
98console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
99const { items } = await client.dataset(run.defaultDatasetId).listItems();
100items.forEach((item) => {
101 console.dir(item);
102});
103
104