Skip to content

Get started

Quickstart

Learn how to check your first e-invoice through the API and read its verdict.

This page takes you from an API key to your first verdict in a few minutes. You send one invoice to Certinvo, wait for the result, and read the validator’s report. The same steps work for one invoice or for many.

What Certinvo checks

Certinvo does not decide whether an invoice is valid. It hands the invoice to the official validator, loaded with the official rules of each rulebook, and gives you the validator’s answer. The rulebooks built today are:

Rulebook What it is
EN 16931 The European standard for e-invoices
Peppol BIS Billing 3.0 The rules of the Peppol network
XRechnung Germany’s own rules on top of EN 16931

Your validation policy decides which rulebooks run, and how strictly. See Change the validation policy.

Step 1: authenticate

Send your API key as a Bearer token:

Authorization: Bearer cvo_test_sk_0123456789abcdef0123456789abcdef
  • Use a cvo_test_sk_... key for Sandbox and a cvo_live_sk_... key for Live.
  • If a workspace key can reach more than one company, also send Certinvo-Company: <company-id>.

Your workspace also needs a processing plan. The plan says:

  • which features you have: validation, conversion and, on some plans, the GoBD archive, which keeps each invoice unchangeable under German record-keeping rules;
  • how many invoices one operation may carry;
  • how long results are kept.

A workspace made by a sign-up gets a plan once Certinvo approves it. GET /v1/plan shows yours. Without a plan, every operation is refused with 403 workspace_plan_unavailable.

Step 2: encode the invoice

You can send finished UBL XML, CII XML, or a ZUGFeRD or Factur-X PDF. Encode the file as base64:

base64 < received-invoice.xml | tr -d '\n' > invoice.base64

Then put it in a validation envelope. Create validation.json:

{
  "context": "received",
  "documents": [
    {
      "name": "received-invoice.xml",
      "data": "<contents of invoice.base64>"
    }
  ]
}

context says whose invoice it is:

  • received: an invoice someone sent you.
  • issued: a finished invoice your organisation produced.

To create invoice files from your own data, use POST /v1/conversions instead. It takes canonical JSON (Certinvo’s invoice model) or a mapped customer export. It writes XRechnung and ZUGFeRD for Germany, Peppol BIS 3.0, plain EN 16931, Factur-X and ZUGFeRD EXTENDED.

Step 3: submit the operation

curl -s -X POST "https://api.certinvo.com/v1/validations" \
  -H "Authorization: Bearer cvo_test_sk_0123456789abcdef0123456789abcdef" \
  -H "Content-Type: application/json" \
  --data-binary @validation.json

The API answers HTTP 202 with an operation: one request and its items, one item per invoice. Keep its id:

{
  "id": "2b369970-bdbc-49dc-bf4d-adf2d7017a78",
  "kind": "validation",
  "context": "received",
  "status": "processing",
  "itemCount": 1,
  "pending": 1,
  "policyVersion": 3,
  "retention": { "kind": "durable", "expiresAt": null },
  "items": [{ "index": 0, "status": "pending" }]
}

The operation may already be completed when the deployment processes work inline.

retention says how long the result is kept:

  • durable: the result is filed in the invoice archive and never expires.
  • temporary: a trial plan’s retention. expiresAt says when the operation and its reports are deleted. Nothing is added to the archive.

Step 4: poll and read the report

curl -s \
  -H "Authorization: Bearer cvo_test_sk_0123456789abcdef0123456789abcdef" \
  "https://api.certinvo.com/v1/validations/2b369970-bdbc-49dc-bf4d-adf2d7017a78"

When pending is 0, each item is either done or failed. A done item has one of three verdicts:

Verdict Meaning
clean Accepted, with no findings.
acceptable-with-findings Accepted, with findings to read.
rejected Not accepted.

A rejected invoice is a completed validation, not an HTTP error.

Read the complete report for item zero:

curl -s \
  -H "Authorization: Bearer cvo_test_sk_0123456789abcdef0123456789abcdef" \
  "https://api.certinvo.com/v1/validations/2b369970-bdbc-49dc-bf4d-adf2d7017a78/items/0/report"

The validator’s own HTML report pages are at /items/0/gate-reports, one page per validator run. Its German publisher calls this report the Prüfbericht. You get it for every verdict, a rejected invoice included.

To check many invoices, add more entries to documents. The route, the response, the polling and the report addresses stay the same.

TypeScript example

const data = Buffer.from(invoiceBytes).toString("base64");
const accepted = await fetch("https://api.certinvo.com/v1/validations", {
  method: "POST",
  headers: {
    Authorization: "Bearer cvo_test_sk_0123456789abcdef0123456789abcdef",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    context: "received",
    documents: [{ name: "received-invoice.xml", data }],
  }),
});

if (accepted.status !== 202) throw new Error(await accepted.text());
const operation = await accepted.json();
console.log(operation.id, operation.status);

See also

Navigation

Type to search…

↑↓ navigate↵ selectEsc close