1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "operation": "validate",
12 "fileUrl": "https://api.apify.com/v2/key-value-stores/DsZ5HTNC4PojX3A8a/records/facturx-sample-invoice.pdf",
13 "invoiceData": {
14 "numero": "FA-2026-0001",
15 "date_emission": "2026-08-26",
16 "type_code": "380",
17 "devise": "EUR",
18 "vendeur": {
19 "nom": "Ma Société SAS",
20 "siren_siret": "12345678900012",
21 "tva_intracom": "FR12345678900",
22 "adresse": {
23 "ligne1": "1 rue Exemple",
24 "code_postal": "75001",
25 "ville": "Paris",
26 "pays": "FR"
27 }
28 },
29 "acheteur": {
30 "nom": "Client SARL",
31 "siren_siret": "98765432100019",
32 "adresse": {
33 "ligne1": "2 avenue Client",
34 "code_postal": "69001",
35 "ville": "Lyon",
36 "pays": "FR"
37 }
38 },
39 "lignes": [
40 {
41 "designation": "Prestation de conseil",
42 "quantite": 1,
43 "prix_unitaire_ht": 1000,
44 "taux_tva": 20,
45 "categorie_tva": "S"
46 }
47 ],
48 "totaux": {
49 "total_ht": 1000,
50 "total_tva": 200,
51 "total_ttc": 1200
52 }
53 }
54};
55
56
57const run = await client.actor("comall-agency/facturx-validator-generator").call(input);
58
59
60console.log('Results from dataset');
61console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
62const { items } = await client.dataset(run.defaultDatasetId).listItems();
63items.forEach((item) => {
64 console.dir(item);
65});
66
67