1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "invoice": {
12 "invoice_number": "INV-2026-0001",
13 "issue_date": "2026-07-29",
14 "due_date": "2026-08-28",
15 "delivery_date": "2026-07-29",
16 "currency": "EUR",
17 "invoice_type_code": "380",
18 "buyer_reference": "BUYER-REF-1001",
19 "purchase_order_reference": "PO-2026-1001",
20 "seller": {
21 "name": "Example Supplier GmbH",
22 "address": {
23 "line1": "Musterstrasse 10",
24 "city": "Berlin",
25 "postal_code": "10115",
26 "country_code": "DE"
27 },
28 "vat_id": "DE123456789",
29 "registration_id": "HRB12345",
30 "endpoint_id": "4000001123452",
31 "endpoint_scheme": "0088",
32 "email": "billing@example-supplier.test",
33 "contact_name": "Billing Team",
34 "phone": "+49 30 1234567"
35 },
36 "buyer": {
37 "name": "Example Buyer GmbH",
38 "address": {
39 "line1": "Einkaufsweg 20",
40 "city": "Hamburg",
41 "postal_code": "20095",
42 "country_code": "DE"
43 },
44 "vat_id": "DE987654321",
45 "registration_id": "HRB54321",
46 "endpoint_id": "4000001987658",
47 "endpoint_scheme": "0088",
48 "email": "accounts@example-buyer.test"
49 },
50 "lines": [
51 {
52 "id": "1",
53 "description": "Consulting services",
54 "quantity": "2",
55 "unit_code": "HUR",
56 "unit_price": "500.00",
57 "tax_rate": "19",
58 "tax_category": "S"
59 }
60 ],
61 "payment": {
62 "means_code": "30",
63 "reference": "INV-2026-0001",
64 "iban": "DE89370400440532013000",
65 "bic": "COBADEFFXXX"
66 },
67 "notes": [
68 "Generated sample for technical preflight."
69 ],
70 "extensions": {
71 "xrechnung": {
72 "syntax": "ubl"
73 }
74 }
75 }
76};
77
78
79const run = await client.actor("kamerozkan/xrechnung-invoice-generator").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