1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "invoices": [
12 {
13 "vendor_id": "VEND-42",
14 "vendor_name": "Precision Parts Ltd",
15 "invoice_number": "INV-2026-505",
16 "invoice_date": "2026-11-22",
17 "currency": "USD",
18 "po_number": "PO-8801",
19 "subtotal": "1000.00",
20 "tax_total": "180.00",
21 "grand_total": "1180.00",
22 "lines": [
23 {
24 "sku": "BOLT-M8",
25 "description": "Steel Bolt M8",
26 "quantity": "100",
27 "unit_price": "10.00",
28 "tax_rate_pct": "18.00",
29 "line_total": "1000.00"
30 }
31 ]
32 }
33 ],
34 "purchase_orders": []
35};
36
37
38const run = await client.actor("digicrem/digicrem-ap-invoice-edi-validator").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48