Should I build this in-house or use an API?
The case for building looks straightforward at first. EN 16931 is a public standard. Saxon-HE handles Schematron. PDF libraries exist. How hard could it be?
The honest answer is that the spec itself is the small part. The hard parts are the country-specific profiles (Factur-X has five profiles, ZUGFeRD has four, each with different mandatory fields), the PDF/A-3b embedding requirements (the XML must be attached with specific metadata flags and the PDF must be PDF/A-3b conformant for archival), and the validation rule maintenance (Schematron rulesets update with every regulatory revision).
A realistic in-house build is 6 to 12 weeks of focused engineering work for a single format and 0.3 to 0.5 FTE permanently allocated to tracking spec changes. For a team that already has a roadmap, that engineering time has a real opportunity cost. We've seen multiple teams start an in-house build, ship version one, then pivot to an API once they realized the maintenance burden didn't end with the launch.
InvoiceXML exists for the case where compliance is a means to an end, not your product itself. If your customers need to send and receive compliant European invoices, you ship that capability through us in days. If e-invoice compliance is your product, building probably makes sense, but you're not our buyer.