1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "payload": {
12 "movements": [
13 {
14 "destination": "PLANT",
15 "movement_id": "D-0001",
16 "quantity": 35,
17 "sku": "BATH_TOWEL",
18 "source": "CLIENT_A",
19 "timestamp": "2026-01-05T08:00:00-05:00",
20 "type": "dispatch",
21 "unit": "pieces"
22 },
23 {
24 "destination": "CLIENT_A",
25 "movement_id": "R-0001",
26 "quantity": 20,
27 "sku": "BATH_TOWEL",
28 "source": "PLANT",
29 "timestamp": "2026-01-06T08:00:00-05:00",
30 "type": "receipt",
31 "unit": "pieces"
32 }
33 ],
34 "openings": [
35 {
36 "account": "CLIENT_A",
37 "quantity": 100,
38 "sku": "BATH_TOWEL",
39 "unit": "pieces"
40 }
41 ],
42 "policy": {
43 "period": {
44 "end": "2026-02-01T00:00:00-05:00",
45 "start": "2026-01-01T00:00:00-05:00"
46 },
47 "timezone": "America/New_York",
48 "tracked_accounts": [
49 "CLIENT_A"
50 ]
51 }
52 }
53};
54
55
56const run = await client.actor("usta/linenbalance-laundry-piece-reconciliation").call(input);
57
58
59console.log('Results from dataset');
60console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
61const { items } = await client.dataset(run.defaultDatasetId).listItems();
62items.forEach((item) => {
63 console.dir(item);
64});
65
66