1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "quote": {
12 "schema_version": "1.0",
13 "quote_id": "SQ-001",
14 "currency": "USD",
15 "items": [
16 {
17 "line_id": "A",
18 "quantity": "3",
19 "quantity_unit": "carton",
20 "units_per_carton": "24",
21 "unit_price": "1.20",
22 "price_unit": "piece",
23 "quoted_line_total": "86.40",
24 "moq_quantity": "48",
25 "moq_unit": "piece"
26 }
27 ],
28 "quoted_subtotal": "86.40",
29 "charges": [
30 {
31 "id": "F",
32 "type": "freight",
33 "amount": "20.00",
34 "currency": "USD"
35 }
36 ],
37 "quoted_grand_total": "106.40",
38 "packages": [
39 {
40 "package_id": "P1",
41 "package_count": 3,
42 "length": "40",
43 "width": "30",
44 "height": "25",
45 "dimension_unit": "cm",
46 "gross_weight": "9",
47 "net_weight": "8",
48 "weight_unit": "kg",
49 "quoted_cbm": "0.090000"
50 }
51 ],
52 "quoted_cbm": "0.09"
53 }
54};
55
56
57const run = await client.actor("bewildering_tapestry/supplier-quote-validator").call(input);
58
59
60console.log('Results from dataset');
61console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
62const { items } = await client.dataset(run.defaultDatasetId).listItems();
63items.forEach((item) => {
64 console.dir(item);
65});
66
67