canonical: https://jentic.com/apis/attestwire.com/attestwire

# Attestwire API

The Attestwire API validates electronic invoices against EN 16931 and its national CIUS rules such as XRechnung and Peppol BIS 3, returning the official rule id and a fix for every failure. It generates compliant invoice XML in either EN 16931 syntax, UBL 2.1 or UN/CEFACT CII, parses incoming invoice documents into a structured JSON model, and diagnoses and repairs invoices that do not pass. It also verifies VAT numbers against VIES and checks whether a buyer can receive documents over Peppol.

## For AI agents

Validate and generate EN 16931-compliant e-invoices, diagnose failures with the official rule id, verify VAT numbers, and check Peppol recipients. Reads invoice documents into a structured JSON model.

## Scope

Does not handle payment collection, double-entry bookkeeping, or tax return filing. Use for EN 16931 e-invoice validation, generation, and compliance checks only.

## Capabilities

- Validate an invoice against EN 16931 and national CIUS rules such as XRechnung and Peppol BIS 3
- Generate compliant invoice XML in UBL 2.1 or UN/CEFACT CII
- Diagnose and repair an invoice, returning the official rule id for each failure
- Verify a VAT number against the VIES registry
- Check whether a recipient can receive documents over Peppol
- Parse an invoice document into a structured JSON model

## Use cases

### Agent-Checked Invoice Compliance

Before an AI agent connected through Jentic sends an invoice to a buyer, it validates the document against EN 16931 and the national CIUS rules that apply, and reads back the rule id and fix for any failure so it can correct the document first. This keeps non-compliant invoices from leaving the agent's hands and gives it a precise reason whenever one is rejected.

Example prompt: Validate a draft invoice against EN 16931, read the returned rule id for each failure, and confirm the corrected invoice passes

### Compliant Invoice Generation

A billing workflow generates invoice XML in the EN 16931 syntax its recipient expects, UBL 2.1 or UN/CEFACT CII, with the profile choosing the syntax on generate. The API produces the structured document ready to transmit, so the workflow never hand-assembles XRechnung or Peppol BIS 3 output.

Example prompt: Generate a compliant invoice in UBL 2.1 for a given buyer and line items and verify it validates clean

### VAT and Peppol Pre-Flight

Ahead of invoicing a new buyer, automation verifies the buyer's VAT number against VIES and checks whether they can receive documents over Peppol, so the invoice is addressed correctly the first time. Both checks run from a single Attestwire integration rather than wiring VIES and a Peppol directory separately.

Example prompt: Verify a buyer's VAT number with VIES and check whether the buyer is reachable over Peppol

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v1/validate` | Validate an invoice against EN 16931 rules |
| POST | `/v1/generate` | Generate compliant invoice XML |
| POST | `/v1/diagnose` | Diagnose and repair an invoice |
| POST | `/v1/vat/verify` | Verify a VAT number with VIES |
| POST | `/v1/peppol/lookup` | Check a Peppol recipient |
| POST | `/v1/parse` | Read an invoice document into the JSON model |
| POST | `/v1/bundle` | Bundle the invoice, report, and signed manifest as a ZIP |

## Key resources

- **Invoices** — Validate, generate, diagnose, parse, and bundle EN 16931 invoices
- **Keys** — Issue a free-tier key, rotate the calling key, and read its current usage
- **Records** — Read a stored validation record by id

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 65 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 80 / 100
  - Developer Experience & Jentic Compatibility: 70 / 100
  - AI-Readiness & Agent Experience: 48 / 100
  - Agent Usability: 94 / 100
  - Security: 60 / 100
  - AI Discoverability: 61 / 100
- **View full report:** https://jentic.com/apis/attestwire.com/attestwire/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the Attestwire API by hand means handling its bearer token, learning which endpoints are open and which need the token, and matching the EN 16931 syntax your invoices use, UBL 2.1 or CII. Through Jentic you install once, import Attestwire from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Attestwire carries invoice content and keys in the request body, so rules bound which operations your agent may call rather than which invoice. Limit it to the operations it needs, such as validating and generating invoices, so operations like e-mailing an invoice or rotating your key are not included unless you add them.
- **Credential handling:** Your Attestwire bearer token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'validate an invoice' or 'verify a VAT number', and Jentic returns the matching Attestwire operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Avalara AvaTax API** — Covers tax calculation and compliance broadly, where Attestwire focuses on EN 16931 e-invoice validation and generation.
- **Xero Accounting API** — Keeps the ledger and invoice records that an Attestwire-validated invoice ultimately feeds into.
- **Stripe API** — Collects payment for an invoice that Attestwire validates and generates for compliance.

## FAQ

### What authentication does the Attestwire API use?

The Attestwire API authenticates with a bearer token per its OpenAPI spec, sent in the Authorization header. Some endpoints, such as issuing a free-tier key or checking service health, are open and need no token. Through Jentic the token is stored encrypted by your own Jentic One instance and injected at call time, so it never reaches the agent's context.

### Can I generate compliant invoice XML with the Attestwire API?

Yes. The generate operation produces invoice XML in either EN 16931 syntax, UBL 2.1 or UN/CEFACT CII, with the profile choosing the syntax. You can validate the result in the same integration and bundle the invoice, its validation report, and a signed manifest into a single ZIP.

### Can I limit what my agent is allowed to do with the Attestwire API?

Yes. Write a rule that allows only the validate, generate, and parse operations, so your agent can check and produce invoices but cannot e-mail one or rotate your key, and every call it makes is logged. Add the VAT-verify and Peppol-lookup operations when you want the agent to run buyer pre-flight checks too.

### What are the rate limits for the Attestwire API?

The OpenAPI spec does not state numeric rate limits for the Attestwire API. It exposes a usage endpoint that reports the calling key's current-period usage, and the ceilings that apply depend on your Attestwire plan, so check the usage endpoint and your plan details for current limits.

### How do I validate an invoice with the Attestwire API through Jentic?

Search Jentic for 'validate an invoice against EN 16931' and it returns the validate operation with its input schema; your agent submits the invoice and reads back the rule id and fix for any failure. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Is there an Attestwire MCP server?

You don't need an MCP server to give your agent the Attestwire API. Jentic connects it directly from the API Directory: import it, store your token once, and your agent calls the validation, generation, and lookup operations with scoping and credential isolation applied.
