Skip to content

CLI

Validate Peppol invoices from your terminal — offline, instant, no API key needed.

Installation

Install @getpeppr/cli globally or run it directly with npx.

Install globally

Terminal
npm install -g @getpeppr/cli

Or use npx (no install)

Terminal
npx @getpeppr/cli validate invoice.json

Validate an Invoice

Pass a JSON file to getpeppr validate to check it against three validation engines:

  • Structure — required fields, types, and format checks
  • Business Rules — Peppol BIS 3.0 / EN 16931 compliance
  • Country Rules — Belgium, France, Italy, Netherlands, Germany
Terminal
getpeppr validate invoice.json

Example output

Output
Validating: invoice.json

── Structure ──────────────────────────────
 No errors
 to.vatNumber Buyer VAT number not provided. May be required for B2B.

── Business Rules (Peppol BIS 3.0) ───────
 All rules passed

── Country Rules ────────────────────────────
 No structured communication reference (BE-02)

── Summary ──────────────────────────────────
 Invoice is valid (2 warnings)
All validation runs offline — no API key, no network connection, no account required. The CLI uses the same validation engine as the SDK (validateInvoice, validateSchematron, validateCountryRules).

Flags

Flag Description
--json Machine-readable JSON output
--quiet Exit code only, no output
--version Show version number
--help Show help

Exit Codes

Code Meaning
0 Invoice is valid (may have warnings)
1 Invoice has errors — non-compliant
2 File not found or invalid JSON

JSON Output

Use --json for machine-readable output, ideal for CI pipelines and tooling.

Terminal
getpeppr validate invoice.json --json
Result
{
  "structure": { "errors": [], "warnings": [...] },
  "schematron": { "errors": [], "warnings": [] },
  "countryRules": { "errors": [], "warnings": [...] },
  "totalErrors": 0,
  "totalWarnings": 2,
  "valid": true
}

CI/CD Integration

Use --quiet in CI pipelines to gate deployments on invoice compliance.

ci.yml
# Fail the pipeline if the invoice is invalid
getpeppr validate invoice.json --quiet || exit 1

# Or validate multiple files
for file in invoices/*.json; do
  getpeppr validate "$file" --quiet || exit 1
done
The --quiet flag suppresses all output and relies only on exit codes. Combine with --json in CI to capture structured results for reporting.

Invoice Format

The input file must be a JSON object matching the InvoiceInput type. See the Type Definitions for all available fields.

invoice.json
{
  "number": "INV-2026-001",
  "date": "2026-04-07",
  "dueDate": "2026-05-07",
  "currency": "EUR",
  "buyerReference": "PO-12345",
  "to": {
    "name": "Wayne Enterprises",
    "peppolId": "0208:BE0123456789",
    "street": "Avenue Louise 54",
    "city": "Brussels",
    "postalCode": "1050",
    "country": "BE"
  },
  "lines": [
    {
      "description": "Consulting services",
      "quantity": 10,
      "unitPrice": 150,
      "vatRate": 21
    }
  ]
}

Ready to Send?

Once your invoice validates, send it to the Peppol network with the SDK. Sign up at getpeppr.dev to get your API key.