1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "invoices": [
12 "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Invoice xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\" xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"><cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>2026-0042</cbc:ID><cbc:IssueDate>2026-11-02</cbc:IssueDate><cbc:DueDate>2026-12-02</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cbc:BuyerReference>PO-7781</cbc:BuyerReference><cac:AccountingSupplierParty><cac:Party><cbc:EndpointID schemeID=\"0208\">0123456749</cbc:EndpointID><cac:PartyName><cbc:Name>Voorbeeld Diensten</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>Voorbeeldstraat 1</cbc:StreetName><cbc:CityName>Brussel</cbc:CityName><cbc:PostalZone>1000</cbc:PostalZone><cac:Country><cbc:IdentificationCode>BE</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>BE0123456749</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Voorbeeld Diensten BV</cbc:RegistrationName><cbc:CompanyID schemeID=\"0208\">0123456749</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cbc:EndpointID schemeID=\"0208\">0200000043</cbc:EndpointID><cac:PartyName><cbc:Name>Exemple Clients</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>Rue de l'Exemple 7</cbc:StreetName><cbc:CityName>Liege</cbc:CityName><cbc:PostalZone>4000</cbc:PostalZone><cac:Country><cbc:IdentificationCode>BE</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>BE0200000043</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Exemple Clients SA</cbc:RegistrationName></cac:PartyLegalEntity></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>30</cbc:PaymentMeansCode><cbc:PaymentID>+++090/9337/55493+++</cbc:PaymentID><cac:PayeeFinancialAccount><cbc:ID>BE68539007547034</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans><cac:PaymentTerms><cbc:Note>Payable within 30 days</cbc:Note></cac:PaymentTerms><cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">189.00</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">900.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">189.00</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>21</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">900.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">900.00</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\"EUR\">1089.00</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">1089.00</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>1</cbc:ID><cbc:InvoicedQuantity unitCode=\"C62\">5</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"EUR\">600.00</cbc:LineExtensionAmount><cac:Item><cbc:Name>Consulting day</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>21</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"EUR\">120.00</cbc:PriceAmount></cac:Price></cac:InvoiceLine><cac:InvoiceLine><cbc:ID>2</cbc:ID><cbc:InvoicedQuantity unitCode=\"C62\">2</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"EUR\">300.00</cbc:LineExtensionAmount><cac:Item><cbc:Name>Workshop</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>21</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"EUR\">150.00</cbc:PriceAmount></cac:Price></cac:InvoiceLine></Invoice>"
13 ]
14};
15
16
17const run = await client.actor("bite-sized-insights/bulk-belgium-e-invoice-validator").call(input);
18
19
20console.log('Results from dataset');
21console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
22const { items } = await client.dataset(run.defaultDatasetId).listItems();
23items.forEach((item) => {
24 console.dir(item);
25});
26
27