1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "oldFeeSchedule": [
12 {
13 "sku": "MUG-BLUE-12",
14 "fulfillmentFee": 3.22,
15 "sizeTier": "Standard",
16 "lengthIn": 5,
17 "widthIn": 4,
18 "heightIn": 4,
19 "weightLb": 0.9
20 },
21 {
22 "sku": "YOGA-MAT-6",
23 "fulfillmentFee": 5.4,
24 "sizeTier": "Standard",
25 "lengthIn": 24,
26 "widthIn": 6,
27 "heightIn": 6,
28 "weightLb": 2.4
29 },
30 {
31 "sku": "LAMP-DESK-1",
32 "fulfillmentFee": 6.1,
33 "sizeTier": "Large",
34 "lengthIn": 18,
35 "widthIn": 10,
36 "heightIn": 8,
37 "weightLb": 3.1
38 }
39 ],
40 "newFeeSchedule": [
41 {
42 "sku": "MUG-BLUE-12",
43 "fulfillmentFee": 3.4,
44 "sizeTier": "Standard",
45 "lengthIn": 5,
46 "widthIn": 4,
47 "heightIn": 4,
48 "weightLb": 0.9
49 },
50 {
51 "sku": "YOGA-MAT-6",
52 "fulfillmentFee": 6.25,
53 "sizeTier": "Large",
54 "lengthIn": 26,
55 "widthIn": 7,
56 "heightIn": 7,
57 "weightLb": 2.4
58 },
59 {
60 "sku": "LAMP-DESK-1",
61 "fulfillmentFee": 6.1,
62 "sizeTier": "Large",
63 "lengthIn": 18,
64 "widthIn": 10,
65 "heightIn": 8,
66 "weightLb": 3.1
67 }
68 ],
69 "products": [
70 {
71 "sku": "MUG-BLUE-12",
72 "price": 18.99,
73 "unitCost": 4.1,
74 "monthlyUnits": 300,
75 "lengthIn": 5,
76 "widthIn": 4,
77 "heightIn": 4,
78 "weightLb": 0.9
79 },
80 {
81 "sku": "YOGA-MAT-6",
82 "price": 24.99,
83 "unitCost": 8.5,
84 "otherCostPerUnit": 0.6,
85 "monthlyUnits": 120,
86 "lengthIn": 24,
87 "widthIn": 6,
88 "heightIn": 6,
89 "weightLb": 2.4
90 },
91 {
92 "sku": "LAMP-DESK-1",
93 "price": 29.99,
94 "unitCost": 11,
95 "monthlyUnits": 80,
96 "lengthIn": 18,
97 "widthIn": 10,
98 "heightIn": 8,
99 "weightLb": 3.1
100 },
101 {
102 "sku": "NO-FEE-SKU",
103 "price": 15,
104 "unitCost": 5
105 }
106 ]
107};
108
109
110const run = await client.actor("practical_ai_lab_jp/pal-amazon-fulfillment-fee-change-impact-audit").call(input);
111
112
113console.log('Results from dataset');
114console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
115const { items } = await client.dataset(run.defaultDatasetId).listItems();
116items.forEach((item) => {
117 console.dir(item);
118});
119
120