Skip to content
Back to News
Changelog

SDK 2.6.0 — validate results now type the country-rule findings

sdkvalidation

@getpeppr/sdk 2.6.0 brings the published type in sync with the gateway.

POST /v1/validate/server has been returning a countryRules array since the Dutch send-rules guard shipped earlier today — gateway-level findings (currently the Dutch document rules NL-R-001..008) that the client-side validators can't detect because they need your registered Peppol identity. The runtime response already carried it; this release adds it to the ServerValidationResult type so TypeScript users get it typed instead of having to cast.

const result = await peppol.invoices.validateServer(invoice);
for (const finding of result.countryRules ?? []) {
  console.warn(`${finding.code}: ${finding.message} — ${finding.docs}`);
}

The field is additive and never changes valid. A non-empty array means POST /v1/invoices would reject the same payload with a 422 country_rule_violation carrying the same rule code — so you can catch it before spending a send.

No CLI update is needed for this release: the change is type-only and the CLI bundle does not use this type.