REST API

One endpoint that matters. Send an invoice, get back what the network would say about it.

Authentication

Every request carries an API key as a bearer token. Create one in your dashboard; the plaintext is shown once and only its hash is stored, so keep it somewhere your CI can read it.

Authorization: Bearer pk_live_…

POST /v1/validate

curl https://pintprobe.ledgerrook.com/v1/validate \
  -H "Authorization: Bearer $PEPPOLPROBE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "document":   "<Invoice xmlns=\"urn:oasis:…:Invoice-2\">…</Invoice>",
    "rulePackId": "pint-ae-2026.5",
    "profile":    "billing"
  }'

Request

FieldTypeNotes
documentstringRequired. Raw XML or base64 — we detect which.
rulePackIdstringlatest, a pack id, or id@sha256:… to pin. Defaults to latest.
profilestringbilling or self-billing. Defaults to billing.
options.includeXPathValuesbooleanEcho the offending value back. Honoured only if your org has opted in; off by default.

Response

{
  "runId":        "run_9f2c…",
  "rulePack":     { "id": "pint-ae-2026.5", "hash": "sha256:…", "aka": "1.0.4" },
  "documentType": "invoice",
  "verdict":      "fail",
  "layers": [
    { "layer": "wellformed", "status": "pass",    "durationMs": 3 },
    { "layer": "xsd",        "status": "pass",    "durationMs": 12 },
    { "layer": "pint-base",  "status": "pass",    "durationMs": 14 },
    { "layer": "pint-ae",    "status": "fail",    "durationMs": 10,
      "findings": [{
        "assertionId":  "ibr-132-ae",
        "severity":     "error",
        "layer":        "pint-ae",
        "location":     "/Invoice[1]/cac:AccountingSupplierParty[1]/…/cbc:CompanyID[1]",
        "officialText": "VAT identifier … must be 15 digits, starting with 1, ending with 03.",
        "field":        { "id": "IBT-031", "name": "Seller VAT identifier", "category": "seller" },
        "explanation":  { "plainEnglish": "…", "fixHint": "…", "goodExample": "…" },
        "value":        null
      }]
    }
  ],
  "summary":      { "errors": 1, "warnings": 0 },
  "timings":      { "totalMs": 39 },
  "documentHash": "sha256:…"
}

Reading the layers

Layers are reported separately because they fail for different reasons and different people fix them. Two statuses matter more than they look:

Errors

StatusCodeMeaning
400bad_requestMalformed JSON, or a missing/unknown field.
401invalid_credentialsThe key is unknown or revoked.
403plan_requiredYour plan does not include this. Pinning needs Solo or above.
404rulepack_not_foundUnknown pack, or a pinned hash that does not match ours.
413payload_too_largeOver the 16 MB body limit.
429quota_exceededMonthly allowance used up. X-RateLimit-Remaining tracks it.
503validator_unavailableThe validation service is down. Retry; nothing was consumed.

GET /v1/rulepacks

Lists every pack with its hash, which is what you pin against.

curl https://pintprobe.ledgerrook.com/v1/rulepacks -H "Authorization: Bearer $PEPPOLPROBE_API_KEY"

Which pack “latest” means

Three jurisdictions have active packs, so a bare latest is ambiguous on its own. We resolve it to the newest active pack for your organisation’s country, which you set once in settings. Name a country explicitly with latest:AE, or a pack with pint-ae-2026.5. In CI we recommend pinning a hash — pint-ae-2026.5@sha256:… — so your build cannot change because we shipped something.

We never infer the country from the document. Judging a UAE invoice against Omani rules and returning a pass is the one answer worse than no answer.

POST /v1/regression

Records a verdict for a labelled document and reports what changed since the last run under the same corpus label. This is what peppolprobe regress calls; exit 1 means a verdict flipped. Included from the Team plan.

peppolprobe regress ./test/fixtures/invoices --corpus nightly --rulepack pint-ae-2026.5

/v1/network — the mock 5-corner network

Transmit to the simulated network, drive the twenty built-in scenarios, and read your own transmission log. Everything under /v1/network is scoped to your organisation: your transmissions, your custom scenarios, your active default. Included from the Team plan; defining your own scenarios is a Business feature.

curl -X POST https://pintprobe.ledgerrook.com/v1/network/as4 \
  -H "Authorization: Bearer $PEPPOLPROBE_API_KEY" \
  -H "X-PeppolProbe-Scenario: uae-smp-lookup-fails" \
  -H "Content-Type: application/xml" \
  --data-binary @invoice.xml

curl https://pintprobe.ledgerrook.com/v1/network/scenarios -H "Authorization: Bearer $PEPPOLPROBE_API_KEY"
curl https://pintprobe.ledgerrook.com/v1/network/transmissions -H "Authorization: Bearer $PEPPOLPROBE_API_KEY"

What we do with your invoice

We parse it, judge it, and drop it. We record its SHA-256, the rule-pack that judged it, the assertion identifiers that fired and their XPaths. The XPath tells us which field was wrong without telling us what was in it — that distinction is the whole privacy design.