@stanzaapi/peppol-validator
v1.0.0
Published
Official zero-dependency, high-speed JavaScript/TypeScript client for Peppol BIS Billing 3.0 & EN 16931 E-Invoice Engine
Maintainers
Readme
Peppol BIS Billing 3.0 & EN 16931 E-Invoice Engine — TypeScript / JavaScript SDK
Sub-5ms Peppol BIS Billing 3.0 & EN 16931 e-invoice validation and XML-to-JSON parsing supporting OASIS UBL 2.1 and UN/CEFACT CII.
Official, zero-dependency Node.js and TypeScript client for Peppol BIS Billing 3.0 & EN 16931 E-Invoice Engine, powered by the Stanza Micro-API Network. Delivers deterministic, sub-5ms V8 isolate execution directly to your application without 3rd-party proxies.
- 🌐 Live Web Sandbox: Try interactive queries online
- 📚 API Reference: Read complete OpenAPI specification
- ⚡ Platform Overview: Discover the Stanza Edge Portfolio
📦 Installation
npm install @stanzaapi/peppol-validator
# or
pnpm add @stanzaapi/peppol-validator
# or
yarn add @stanzaapi/peppol-validator🚀 Quickstart
import { PeppolValidatorClient } from '@stanzaapi/peppol-validator';
// Initialize client (API key optional for sandbox tier evaluation)
const client = new PeppolValidatorClient({
apiKey: process.env.STANZA_API_KEY,
});
async function main() {
const result = await client.validate('<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">...</Invoice>');
if (result.success) {
console.log('Verification Success:', result.data);
} else {
console.error('Validation Error:', result.error, result.code);
}
}
main().catch(console.error);📄 Example JSON Response
{
"success": true,
"data": {
"valid": true,
"profile": "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0",
"invoice_number": "INV-2026-001"
}
}⚙️ Client Configuration Options
| Option | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| apiKey | string | process.env.STANZA_API_KEY | Your Stanza API Key. Required for high-throughput production tiers. |
| baseUrl | string | https://api.stanzaapi.com/peppol-validator | Public edge API base URL. |
| timeoutMs | number | 15000 | Request timeout in milliseconds (uses native AbortSignal.timeout). |
🛡️ Response Envelope & Error Handling
All responses return a typed envelope:
export interface ApiResponse<T> {
success: boolean;
data?: T;
error?: string;
code?: 'VALIDATION_ERROR' | 'UNAUTHORIZED' | 'PAYLOAD_TOO_LARGE' | 'RATE_LIMITED' | 'INTERNAL_ERROR';
}🔗 Related Resources
- Peppol BIS Billing 3.0 & EN 16931 E-Invoice Engine Interactive Playground
- Stanza Microservices Directory
- Report an Issue on GitHub
📄 License
MIT © Stanza — Powered by Stanza.
