1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "orders": [
12 {
13 "orderId": "DEMO-1001",
14 "status": "processing",
15 "promisedDate": "2025-01-08",
16 "lastUpdatedAt": "2025-01-07",
17 "sku": "DEMO-SKU",
18 "quantity": 10,
19 "orderValue": 800,
20 "supplierId": "DEMO-SUP"
21 }
22 ],
23 "inventory": [
24 {
25 "sku": "DEMO-SKU",
26 "availableQuantity": 3,
27 "reorderPoint": 5
28 }
29 ],
30 "suppliers": [
31 {
32 "supplierId": "DEMO-SUP",
33 "status": "pending",
34 "expectedDeliveryDate": "2025-01-09"
35 }
36 ]
37};
38
39
40const run = await client.actor("northpeak_data/order-risk-radar").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50