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 "id": "FF-2026-0042",
13 "typeCode": "380",
14 "issueDate": "2026-03-14",
15 "dueDate": "2026-04-13",
16 "currency": "EUR",
17 "buyerReference": "SERVEXEC-2026",
18 "purchaseOrderReference": "PO-91177",
19 "deliveryDate": "2026-03-12",
20 "paymentTerms": "Net 30 days from invoice date.",
21 "payeeIban": "FR7630006000011234567890189",
22 "notes": [
23 {
24 "content": "Services delivered under framework agreement FA-2025-11.",
25 "subjectCode": "AAI"
26 }
27 ],
28 "seller": {
29 "name": "Atelier Numerique SARL",
30 "vatId": "FR40303265045",
31 "legalRegistrationId": "30326504500011",
32 "address": {
33 "line1": "12 rue de la Fonderie",
34 "postcode": "31000",
35 "city": "Toulouse",
36 "countryCode": "FR"
37 },
38 "contact": {
39 "name": "Claire Moreau",
40 "email": "billing@atelier-numerique.example",
41 "phone": "+33 5 61 00 00 00"
42 }
43 },
44 "buyer": {
45 "name": "Nordwind Logistik GmbH",
46 "vatId": "DE811907980",
47 "address": {
48 "line1": "Speicherstrasse 8",
49 "postcode": "20457",
50 "city": "Hamburg",
51 "countryCode": "DE"
52 }
53 },
54 "lines": [
55 {
56 "id": "1",
57 "name": "Integration engineering",
58 "description": "API integration sprint, 3 weeks",
59 "sellerAssignedId": "SVC-INT",
60 "quantity": "112.5",
61 "unitCode": "HUR",
62 "netPrice": "95.00",
63 "vat": {
64 "categoryCode": "S",
65 "ratePercent": "20.00"
66 }
67 }
68 ]
69 }
70};
71
72
73const run = await client.actor("savagnic/facturforge").call(input);
74
75
76console.log('Results from dataset');
77console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
78const { items } = await client.dataset(run.defaultDatasetId).listItems();
79items.forEach((item) => {
80 console.dir(item);
81});
82
83