1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "snapshotId": "promo-2026-10-02",
10 "stockPoolId": "warehouse-main",
11 "asOf": "2026-10-02T06:00:00Z",
12 "inventoryCoverage": "complete",
13 "demandCoverage": "complete",
14 "missingInventoryPolicy": "unresolved",
15 "inventory": [
16 {
17 "recordId": "stock-01",
18 "componentSku": "001",
19 "availableUnits": 10,
20 },
21 {
22 "recordId": "stock-02",
23 "componentSku": "002",
24 "availableUnits": 8,
25 },
26 {
27 "recordId": "stock-03",
28 "componentSku": "003",
29 "availableUnits": 6,
30 },
31 ],
32 "inventoryCsv": "",
33 "inventoryColumns": {
34 "recordId": "recordId",
35 "componentSku": "componentSku",
36 "availableUnits": "availableUnits",
37 },
38 "bom": [
39 {
40 "recordId": "bom-01",
41 "bundleSku": "gift-a",
42 "componentSku": "001",
43 "unitsPerBundle": 2,
44 },
45 {
46 "recordId": "bom-02",
47 "bundleSku": "gift-a",
48 "componentSku": "002",
49 "unitsPerBundle": 1,
50 },
51 {
52 "recordId": "bom-03",
53 "bundleSku": "gift-b",
54 "componentSku": "001",
55 "unitsPerBundle": 1,
56 },
57 {
58 "recordId": "bom-04",
59 "bundleSku": "gift-b",
60 "componentSku": "003",
61 "unitsPerBundle": 2,
62 },
63 ],
64 "bomCsv": "",
65 "bomColumns": {
66 "recordId": "recordId",
67 "bundleSku": "bundleSku",
68 "componentSku": "componentSku",
69 "unitsPerBundle": "unitsPerBundle",
70 },
71 "demand": [
72 {
73 "recordId": "plan-01",
74 "itemType": "bundle",
75 "sku": "gift-a",
76 "quantity": 4,
77 },
78 {
79 "recordId": "plan-02",
80 "itemType": "bundle",
81 "sku": "gift-b",
82 "quantity": 3,
83 },
84 {
85 "recordId": "plan-03",
86 "itemType": "component",
87 "sku": "001",
88 "quantity": 2,
89 },
90 ],
91 "demandCsv": "",
92 "demandColumns": {
93 "recordId": "recordId",
94 "itemType": "itemType",
95 "sku": "sku",
96 "quantity": "quantity",
97 },
98}
99
100
101run = client.actor("h_murdock/bundle-component-demand-audit").call(run_input=run_input)
102
103
104print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
105for item in client.dataset(run.default_dataset_id).iterate_items():
106 print(item)
107
108