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": "PLN",
17 "invoice_type_code": "380",
18 "buyer_reference": "BUYER-REF-1001",
19 "purchase_order_reference": "PO-2026-1001",
20 "seller": {
21 "name": "Przykladowy Sprzedawca Sp. z o.o.",
22 "address": {
23 "line1": "ul. Prosta 1",
24 "city": "Warszawa",
25 "postal_code": "00-001",
26 "country_code": "PL"
27 },
28 "vat_id": "PL5265877635",
29 "tax_id": "5265877635"
30 },
31 "buyer": {
32 "name": "Przykladowy Nabywca Sp. z o.o.",
33 "address": {
34 "line1": "ul. Dluga 2",
35 "city": "Krakow",
36 "postal_code": "30-001",
37 "country_code": "PL"
38 },
39 "vat_id": "PL1234563218",
40 "tax_id": "1234563218"
41 },
42 "lines": [
43 {
44 "id": "1",
45 "description": "Usluga doradcza",
46 "quantity": "2",
47 "unit_code": "HUR",
48 "unit_price": "500.00",
49 "tax_rate": "23",
50 "tax_category": "S"
51 }
52 ],
53 "payment": {
54 "means_code": "30",
55 "reference": "INV-2026-0001",
56 "iban": "PL61109010140000071219812874"
57 },
58 "notes": [],
59 "extensions": {
60 "ksef": {
61 "jst": false,
62 "gv": false
63 }
64 }
65 }
66};
67
68
69const run = await client.actor("kamerozkan/ksef-fa-invoice-generator").call(input);
70
71
72console.log('Results from dataset');
73console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
74const { items } = await client.dataset(run.defaultDatasetId).listItems();
75items.forEach((item) => {
76 console.dir(item);
77});
78
79