1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "xml": """<?xml version=\"1.0\" encoding=\"UTF-8\"?>
9<!-- Fictional data written for this project, with deliberate errors. -->
10<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"
11 xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\"
12 xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">
13 <cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID>
14 <cbc:ID>EX-2026-0001</cbc:ID>
15 <cbc:IssueDate>2026-11-02</cbc:IssueDate>
16 <cbc:DueDate>2026-12-02</cbc:DueDate>
17 <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
18 <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
19 <cac:AccountingSupplierParty>
20 <cac:Party>
21 <cbc:EndpointID schemeID=\"EM\">billing@seller.example</cbc:EndpointID>
22 <cac:PostalAddress>
23 <cbc:CityName>Berlin</cbc:CityName>
24 <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>
25 </cac:PostalAddress>
26 <cac:PartyTaxScheme>
27 <cbc:CompanyID>DE123456789</cbc:CompanyID>
28 <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
29 </cac:PartyTaxScheme>
30 <cac:PartyLegalEntity>
31 <cbc:RegistrationName>Example Seller GmbH</cbc:RegistrationName>
32 </cac:PartyLegalEntity>
33 </cac:Party>
34 </cac:AccountingSupplierParty>
35 <cac:AccountingCustomerParty>
36 <cac:Party>
37 <cbc:EndpointID schemeID=\"EM\">accounts@buyer.example</cbc:EndpointID>
38 <cac:PostalAddress>
39 <cbc:CityName>Hamburg</cbc:CityName>
40 <cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country>
41 </cac:PostalAddress>
42 <cac:PartyLegalEntity>
43 <cbc:RegistrationName></cbc:RegistrationName>
44 </cac:PartyLegalEntity>
45 </cac:Party>
46 </cac:AccountingCustomerParty>
47 <cac:PaymentMeans>
48 <cbc:PaymentMeansCode>58</cbc:PaymentMeansCode>
49 <cac:PayeeFinancialAccount><cbc:ID>DE89370400440532013000</cbc:ID></cac:PayeeFinancialAccount>
50 </cac:PaymentMeans>
51 <cac:AllowanceCharge>
52 <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
53 <cbc:AllowanceChargeReason>Loyalty discount</cbc:AllowanceChargeReason>
54 <cbc:Amount currencyID=\"EUR\">10.00</cbc:Amount>
55 <cac:TaxCategory>
56 <cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent>
57 <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
58 </cac:TaxCategory>
59 </cac:AllowanceCharge>
60 <cac:AllowanceCharge>
61 <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
62 <cbc:AllowanceChargeReason>Freight</cbc:AllowanceChargeReason>
63 <cbc:Amount currencyID=\"EUR\">5.00</cbc:Amount>
64 <cac:TaxCategory>
65 <cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent>
66 <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
67 </cac:TaxCategory>
68 </cac:AllowanceCharge>
69 <cac:TaxTotal>
70 <cbc:TaxAmount currencyID=\"EUR\">95.80</cbc:TaxAmount>
71 <cac:TaxSubtotal>
72 <cbc:TaxableAmount currencyID=\"EUR\">495.00</cbc:TaxableAmount>
73 <cbc:TaxAmount currencyID=\"EUR\">99.75</cbc:TaxAmount>
74 <cac:TaxCategory>
75 <cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent>
76 <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
77 </cac:TaxCategory>
78 </cac:TaxSubtotal>
79 <cac:TaxSubtotal>
80 <cbc:TaxableAmount currencyID=\"EUR\">25.00</cbc:TaxableAmount>
81 <cbc:TaxAmount currencyID=\"EUR\">1.75</cbc:TaxAmount>
82 <cac:TaxCategory>
83 <cbc:ID>S</cbc:ID><cbc:Percent>7</cbc:Percent>
84 <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
85 </cac:TaxCategory>
86 </cac:TaxSubtotal>
87 </cac:TaxTotal>
88 <cac:LegalMonetaryTotal>
89 <cbc:LineExtensionAmount currencyID=\"EUR\">552.00</cbc:LineExtensionAmount>
90 <cbc:TaxExclusiveAmount currencyID=\"EUR\">520.00</cbc:TaxExclusiveAmount>
91 <cbc:TaxInclusiveAmount currencyID=\"EUR\">615.80</cbc:TaxInclusiveAmount>
92 <cbc:AllowanceTotalAmount currencyID=\"EUR\">10.00</cbc:AllowanceTotalAmount>
93 <cbc:ChargeTotalAmount currencyID=\"EUR\">5.00</cbc:ChargeTotalAmount>
94 <cbc:PrepaidAmount currencyID=\"EUR\">100.00</cbc:PrepaidAmount>
95 <cbc:PayableAmount currencyID=\"EUR\">515.805</cbc:PayableAmount>
96 </cac:LegalMonetaryTotal>
97 <cac:InvoiceLine>
98 <cbc:ID>1</cbc:ID>
99 <cbc:InvoicedQuantity unitCode=\"C62\">10</cbc:InvoicedQuantity>
100 <cbc:LineExtensionAmount currencyID=\"EUR\">500.00</cbc:LineExtensionAmount>
101 <cac:Item>
102 <cbc:Name>Widget</cbc:Name>
103 <cac:ClassifiedTaxCategory>
104 <cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent>
105 <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
106 </cac:ClassifiedTaxCategory>
107 </cac:Item>
108 <cac:Price><cbc:PriceAmount currencyID=\"EUR\">50.00</cbc:PriceAmount></cac:Price>
109 </cac:InvoiceLine>
110 <cac:InvoiceLine>
111 <cbc:ID>2</cbc:ID>
112 <cbc:InvoicedQuantity unitCode=\"C62\">2</cbc:InvoicedQuantity>
113 <cbc:LineExtensionAmount currencyID=\"EUR\">25.00</cbc:LineExtensionAmount>
114 <cac:Item>
115 <cbc:Name>Printed manual</cbc:Name>
116 <cac:ClassifiedTaxCategory>
117 <cbc:ID>S</cbc:ID><cbc:Percent>7</cbc:Percent>
118 <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
119 </cac:ClassifiedTaxCategory>
120 </cac:Item>
121 <cac:Price><cbc:PriceAmount currencyID=\"EUR\">12.50</cbc:PriceAmount></cac:Price>
122 </cac:InvoiceLine>
123</Invoice>
124""" }
125
126
127run = client.actor("agustin-recoba/einvoice-precheck-mcp").call(run_input=run_input)
128
129
130print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
131for item in client.dataset(run.default_dataset_id).iterate_items():
132 print(item)
133
134