1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "documentUrls": [
12 "https://raw.githubusercontent.com/itplr-kosit/xrechnung-testsuite/v2026-08-31/src/test/business-cases/standard/01.01a-INVOICE_ubl.xml",
13 "https://raw.githubusercontent.com/ZUGFeRD/mustangproject/b0c60e456e63596b3ec3ac76e94374dc6e109c4f/library/src/test/resources/ZF252_Beispiele/3.%20EN16931/E05_Einfach/E05_01_Einfach_fx.pdf"
14 ],
15 "invoices": [
16 {
17 "number": "INV-1001",
18 "issueDate": "2026-11-04",
19 "dueDate": "2026-12-04",
20 "currency": "EUR",
21 "buyerReference": "991-12345-67",
22 "seller": {
23 "name": "Example Software GmbH",
24 "vatId": "DE123456789",
25 "electronicAddress": {
26 "value": "DE123456789",
27 "scheme": "9930"
28 },
29 "address": {
30 "line1": "Hauptstraße 1",
31 "city": "Berlin",
32 "postalCode": "10115",
33 "countryCode": "DE"
34 },
35 "contact": {
36 "name": "Billing",
37 "phone": "+49 30 000000",
38 "email": "billing@example.com"
39 }
40 },
41 "buyer": {
42 "name": "Kunde AG",
43 "vatId": "DE987654321",
44 "electronicAddress": {
45 "value": "DE987654321",
46 "scheme": "9930"
47 },
48 "address": {
49 "line1": "Marktplatz 3",
50 "city": "München",
51 "postalCode": "80331",
52 "countryCode": "DE"
53 }
54 },
55 "payment": {
56 "meansCode": "58",
57 "accounts": [
58 {
59 "id": "DE02120300000000202051"
60 }
61 ],
62 "remittanceInformation": "INV-1001"
63 },
64 "lines": [
65 {
66 "name": "Consulting",
67 "quantity": 8,
68 "unitCode": "HUR",
69 "netPrice": 120,
70 "vatCategory": "S",
71 "vatRate": 19
72 }
73 ]
74 }
75 ]
76};
77
78
79const run = await client.actor("bahs/e-invoice-reader-converter").call(input);
80
81
82console.log('Results from dataset');
83console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
84const { items } = await client.dataset(run.defaultDatasetId).listItems();
85items.forEach((item) => {
86 console.dir(item);
87});
88
89