# Romania e-Factura Validator (`kamerozkan/romania-efactura-validator`) Actor

Preflight Romanian UBL Invoice and CreditNote XML against pinned UBL 2.1, CIUS-RO 1.0.1, and ro16931-ubl 1.0.9 rules.

- **URL**: https://apify.com/kamerozkan/romania-efactura-validator.md
- **Developed by:** [Kamer Ozkan](https://apify.com/kamerozkan) (community)
- **Categories:** Developer tools
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 invoice validateds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Romania e-Factura Validator

[![CIUS-RO](https://img.shields.io/badge/CIUS--RO-1.0.1-0057a8)](https://static.anaf.ro/static/10/Anaf/Informatii_R/Informatii_modificare_CIUS_RO.pdf)
[![Romanian rules](https://img.shields.io/badge/ro16931--ubl-1.0.9-fcd116)](https://mfinante.gov.ro/ro/web/efactura/informatii-tehnice)
[![UBL](https://img.shields.io/badge/OASIS_UBL-2.1-0a7f5a)](https://docs.oasis-open.org/ubl/os-UBL-2.1/)
[![Billing](https://img.shields.io/badge/Billing-%240.004%20per%20evaluated%20invoice-6f42c1)](https://apify.com/kamerozkan/romania-efactura-validator)

Preflight Romanian e-Factura UBL XML before submission. Each evaluated Invoice or CreditNote receives a deterministic technical result, structured rule findings, an input SHA-256 digest, and the exact pinned ruleset versions.

> Technical offline preflight only. `ACCEPTED` means the XML passed the pinned XSD and Schematron layers. It is not an ANAF acceptance, delivery, signature, identity, legal, accounting, or tax-validity guarantee.

[Run the live Actor](https://apify.com/kamerozkan/romania-efactura-validator)

### Supported documents

| Document | Support | Required checks |
|---|---|---|
| UBL 2.1 Invoice | Yes | OASIS UBL 2.1 XSD and Romanian `ro16931-ubl 1.0.9` Schematron |
| UBL 2.1 CreditNote | Yes | OASIS UBL 2.1 XSD and Romanian `ro16931-ubl 1.0.9` Schematron |
| CII | No | Returned as unsupported and not evaluated |
| PDF | No | Returned as unsupported and not evaluated |

The Romanian ruleset requires this specification identifier:

```text
urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1
```

The pinned national package contains:

- CIUS-RO `1.0.1`
- Romanian Schematron package `1.0.9`, effective `2024-06-05`
- Its embedded EN 16931 layer `1.3.8`
- UBL 2.1 Invoice and CreditNote bindings

The current EU EN 16931 release is not substituted into the national package. Doing so would stop this product from matching the published Romanian artifact composition.

### Quick start

Run the Actor with an empty input:

```json
{}
```

The Actor then validates its project-authored synthetic CIUS-RO 1.0.1 sample. The sample contains fictional names and identifiers and is intended only to prove the offline pipeline.

For production use, send one source per document:

```json
{
  "documents": [
    {
      "documentId": "supplier-invoice-1042",
      "fileName": "supplier-invoice-1042.xml",
      "xml": "<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\">...</Invoice>"
    }
  ],
  "resultDetail": "FINDINGS",
  "maxFindingsPerDocument": 100,
  "storeXmlReport": false,
  "storeHtmlReport": false
}
```

Each item must contain exactly one of `url`, `xml`, or `base64`. HTTPS URLs, console uploads, and records in a customer key-value store are also supported.

The input and output schemas are agent-readable and work through the Apify API, MCP clients, webhooks, Make, n8n, and standard SDKs.

### Result semantics

| Processing | Conformance | Meaning | Validation event |
|---|---|---|---|
| `SUCCEEDED` | `ACCEPTED` | Every pinned technical layer passed | Charged |
| `SUCCEEDED` | `REJECTED` | The XML was evaluated and at least one required rule failed | Charged |
| `FAILED` | `NOT_EVALUATED` | Input, format, source, engine, timeout, or budget failure prevented a decision | Not charged |

One dataset item is returned for every submitted entry. A technically rejected invoice is a successful validation operation, not a processing failure.

Important output fields:

- `validationScope`: always `OFFLINE_PREFLIGHT`
- `externalStateStatus`: always `NOT_EVALUATED_EXTERNAL_STATE`
- `rulesetEffectiveAt`: `2024-06-05`
- `syntax`: `UBL_INVOICE` or `UBL_CREDIT_NOTE`
- `profile`: `CIUS_RO_1_0_1`
- `counts` and `findings`: XSD, EN 16931, and CIUS-RO results
- `sha256`: digest of the submitted XML
- `versions`: pinned versions and artifact hashes

The shared family output contains preview fields. This product has no preview ruleset, so `previewConformanceStatus` is always `NOT_EVALUATED` and preview findings are empty.

### Real output examples

These compact records are taken from successful live run
`FVLTBJAZyNfTn2epm`, dataset `JAkABPptE7mBiYAng`. The run emitted exactly two
`invoice-validated` events for the evaluated documents. The unsafe HTTP source
was not billed.

<details>
<summary><strong>01. ACCEPTED</strong> - CIUS-RO UBL Invoice passed</summary>

```json
{
  "documentId": "ro-valid",
  "processingStatus": "SUCCEEDED",
  "conformanceStatus": "ACCEPTED",
  "validationScope": "OFFLINE_PREFLIGHT",
  "rulesetEffectiveAt": "2024-06-05",
  "validationFamily": "ROMANIA_EFACTURA_CIUS_RO",
  "syntax": "UBL_INVOICE",
  "profile": "CIUS_RO_1_0_1",
  "counts": {
    "fatal": 0,
    "error": 0,
    "warning": 0,
    "information": 0
  },
  "findings": [],
  "sha256": "4a51789dc322ccbdbfa8066e7b313971842a7c53e57e70957de453c4a5b99c4a",
  "error": null
}
```

</details>

<details>
<summary><strong>02. REJECTED</strong> - arithmetic consistency failed</summary>

```json
{
  "documentId": "ro-invalid",
  "processingStatus": "SUCCEEDED",
  "conformanceStatus": "REJECTED",
  "validationScope": "OFFLINE_PREFLIGHT",
  "rulesetEffectiveAt": "2024-06-05",
  "validationFamily": "ROMANIA_EFACTURA_CIUS_RO",
  "syntax": "UBL_INVOICE",
  "profile": "CIUS_RO_1_0_1",
  "counts": {
    "fatal": 2,
    "error": 0,
    "warning": 0,
    "information": 0
  },
  "findings": [
    {
      "severity": "FATAL",
      "stage": "BUSINESS_RULE",
      "ruleId": "BR-CO-10",
      "message": "[BR-CO-10]-Sum of Invoice line net amount (BT-106) = Σ Invoice line net amount (BT-131)."
    },
    {
      "severity": "FATAL",
      "stage": "BUSINESS_RULE",
      "ruleId": "BR-CO-13",
      "message": "[BR-CO-13]-Invoice total amount without VAT (BT-109) = Σ Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108)."
    }
  ],
  "sha256": "db8b2bc2b631db1e12416cbc4885bca3893e6f9c6066705a7284ef76cb348f86",
  "error": null
}
```

</details>

<details>
<summary><strong>03. NOT_EVALUATED</strong> - insecure HTTP source blocked</summary>

```json
{
  "documentId": "ro-not-evaluated",
  "processingStatus": "FAILED",
  "conformanceStatus": "NOT_EVALUATED",
  "validationScope": "OFFLINE_PREFLIGHT",
  "rulesetEffectiveAt": "2024-06-05",
  "validationFamily": "UNKNOWN",
  "syntax": "UNKNOWN",
  "profile": "UNKNOWN",
  "counts": {
    "fatal": 0,
    "error": 0,
    "warning": 0,
    "information": 0
  },
  "findings": [],
  "sha256": null,
  "error": {
    "code": "SOURCE_FETCH_FAILED",
    "message": "Only HTTPS source URLs are allowed"
  }
}
```

</details>

### Pricing

- `invoice-validated`: `$0.004` for each invoice that produces `ACCEPTED` or `REJECTED`
- `apify-actor-start`: the platform Actor-start event when applicable

Unsupported CII/PDF files and other `NOT_EVALUATED` processing failures do not trigger the invoice validation event. Platform start charges can still apply.

### Optional reports

Both optional records are off by default:

- `storeXmlReport`: normalized validation result XML
- `storeHtmlReport`: human-readable findings report

Returned keys appear in the row's `reports` object. Reports can contain invoice values and follow the retention settings of the customer's Apify account.

### Security and limits

- Validation runs locally inside the Actor container.
- Invoice XML is not sent to ANAF or another third-party validation API.
- Raw invoice content is not copied to the output dataset or logs.
- HTTPS downloads block private, local, reserved, and cloud metadata targets.
- DTDs, entities, external XML resources, and network schema resolution are blocked.
- Schematron execution has a timeout and bounded report size.
- Each XML document is limited to 5 MiB.
- A run can evaluate up to 100 XML documents and 100 MiB total input.
- Finding text and total returned findings are bounded.

Findings can quote an offending invoice value. Treat the dataset and optional reports as sensitive invoice data.

### Pinned artifacts

| Artifact | Exact source | SHA-256 |
|---|---|---|
| Romanian CIUS-RO UBL rules `1.0.9` | `https://mfinante.gov.ro/static/10/eFactura/ro16931-ubl-1.0.9.zip` | `818e7dd77e429f5dbde7c60b43dddbdf1a9a82a1773c359caa80a36ef89ea7f2` |
| OASIS UBL `2.1` | `https://docs.oasis-open.org/ubl/os-UBL-2.1/UBL-2.1.zip` | `60b80d76394a8a2add90723ecb8e0e2e9d826775de9749df37a72d60703f86ed` |
| OASIS UBL Invoice main XSD | Inside the pinned UBL `2.1` archive | `40fae8cb436f3a9506d7acce65ba162caef3b0bed4d5cbc0992b2153ded4edf4` |
| OASIS UBL CreditNote main XSD | Inside the pinned UBL `2.1` archive | `a54651b1225052f811bf2ba01346f13f2454e7cc3e0be290c91dd680dc7b7b1a` |
| Saxon-HE `10.9` | Maven Central | `491d8edf4ec811d15c2b2417b007218b9b938f15e4dfbad004025beb4e70e960` |
| Compiled CIUS-RO Schematron XSLT | Deterministic build from the pinned source and skeleton | `3088b39e24dab440dc98b55cb4ba6845a5fd22b382da1f376f592ee6e0d0f2eb` |
| Schematron skeleton | Commit `02f3707b194ce5792bf77b14a66d782c060abba3` | `bea534eac69918d2efca963e18fac2964f7b53c65bcced25fc4612e18958a71d` |
| Eclipse Temurin JRE 21 Jammy image | Docker Hub OCI index | `d63bd8d9b171999cbed8576f2c76e874dd4856791a358536e5c4d407e77edc13` |

The Java and Python base images are digest-pinned. The Docker build downloads every runtime artifact from its exact URL and stops if its SHA-256 differs. The runtime also rechecks the two routed main XSD files before evaluating an invoice. License texts and the OASIS specification notice are retained in `/opt/licenses`; the unmodified Romanian Schematron source tree is retained in `/opt/rules/cius-ro-source`.

### Release fixtures

The repository contains only project-authored synthetic fixtures:

- accepted UBL Invoice
- accepted UBL CreditNote
- retired CIUS-RO identifier rejection
- arithmetic inconsistency rejection
- explicit CII unsupported case

The accepted fixtures pass the pinned offline XSD and Schematron layers. They are not official ANAF examples and do not prove online acceptance or legal validity.

### Current boundary

This Actor does not:

- submit invoices to ANAF or SPV
- guarantee ANAF acceptance or delivery
- support CII or PDF
- validate electronic signatures, certificates, or timestamps
- query live company, VAT, tax, or registry status
- confirm that a CUI, CNP, NIF, IBAN, or party identity exists
- reproduce extra procedural identifier checks that may exist in the separate ANAF standalone application but are not present in the published XSD and Schematron artifacts
- provide legal, accounting, or tax advice

Rule artifacts can change. A future release must update the pinned URL, checksum, tests, version metadata, and documentation together.

This Actor is also exposed to AI agents through Apify's MCP server
(mcp.apify.com): an agent can discover it by search and run it with the same
pay-per-event billing, with no separate integration.

### E-invoice validator family

Same engine, same output contract, one validator per market:
[XRechnung & ZUGFeRD (Germany)](https://apify.com/kamerozkan/xrechnung-xml-batch-validator-api) | [Peppol BIS Billing](https://apify.com/kamerozkan/peppol-bis-preflight-validator) | [Poland KSeF FA(3)](https://apify.com/kamerozkan/poland-ksef-preflight-validator)

# Actor input Schema

## `invoiceFiles` (type: `array`):

Upload Romanian UBL 2.1 Invoice or CreditNote XML. CII and PDF are not supported. Source XML is not copied to the output dataset.

## `documents` (type: `array`):

Each object needs exactly one XML source: url, xml, or base64. URLs must use HTTPS. documentId and fileName are optional.

## `sourceKeyValueStoreId` (type: `string`):

Optional. Select a key-value store containing invoice XML records, then list the record keys below.

## `keyValueStoreKeys` (type: `array`):

Record keys to read from the selected source key-value store.

## `resultDetail` (type: `string`):

FINDINGS returns rule IDs, messages, and locations. SUMMARY returns only status and counts.

## `maxFindingsPerDocument` (type: `integer`):

Caps the findings array without changing the total severity counts.

## `storeXmlReport` (type: `boolean`):

Optional. Stores a normalized XML report in the run key-value store. It can contain invoice values.

## `storeHtmlReport` (type: `boolean`):

Optional. Stores a human-readable findings report in the run key-value store. It can contain invoice values.

## Actor input object example

```json
{
  "documents": [
    {
      "documentId": "synthetic-cius-ro-valid",
      "fileName": "synthetic-cius-ro-valid.xml",
      "xml": "<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\"><cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1</cbc:CustomizationID><cbc:ID>RO-SYNTH-INV-001</cbc:ID><cbc:IssueDate>2026-07-29</cbc:IssueDate><cbc:DueDate>2026-08-28</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>RON</cbc:DocumentCurrencyCode><cbc:BuyerReference>RO-SYNTH-BUYER-001</cbc:BuyerReference><cac:AccountingSupplierParty><cac:Party><cac:PartyName><cbc:Name>Fictional Supplier SRL</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>Strada Exemplu 1</cbc:StreetName><cbc:CityName>SECTOR1</cbc:CityName><cbc:PostalZone>010101</cbc:PostalZone><cbc:CountrySubentity>RO-B</cbc:CountrySubentity><cac:Country><cbc:IdentificationCode>RO</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>RO12345674</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Fictional Supplier SRL</cbc:RegistrationName><cbc:CompanyID>12345674</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cac:PartyName><cbc:Name>Fictional Buyer SRL</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>Strada Test 2</cbc:StreetName><cbc:CityName>Cluj-Napoca</cbc:CityName><cbc:PostalZone>400001</cbc:PostalZone><cbc:CountrySubentity>RO-CJ</cbc:CountrySubentity><cac:Country><cbc:IdentificationCode>RO</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>RO98765438</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Fictional Buyer SRL</cbc:RegistrationName><cbc:CompanyID>98765438</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>30</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>RO49AAAA1B31007593840000</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans><cac:TaxTotal><cbc:TaxAmount currencyID=\"RON\">19.00</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"RON\">100.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"RON\">19.00</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"RON\">100.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"RON\">100.00</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\"RON\">119.00</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"RON\">119.00</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>1</cbc:ID><cbc:InvoicedQuantity unitCode=\"C62\">1</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"RON\">100.00</cbc:LineExtensionAmount><cac:Item><cbc:Name>Synthetic consulting service</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"RON\">100.00</cbc:PriceAmount><cbc:BaseQuantity unitCode=\"C62\">1</cbc:BaseQuantity></cac:Price></cac:InvoiceLine></Invoice>"
    }
  ],
  "resultDetail": "FINDINGS",
  "maxFindingsPerDocument": 100,
  "storeXmlReport": false,
  "storeHtmlReport": false
}
```

# Actor output Schema

## `validationResults` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "documents": [
        {
            "documentId": "synthetic-cius-ro-valid",
            "fileName": "synthetic-cius-ro-valid.xml",
            "xml": "<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\"><cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1</cbc:CustomizationID><cbc:ID>RO-SYNTH-INV-001</cbc:ID><cbc:IssueDate>2026-07-29</cbc:IssueDate><cbc:DueDate>2026-08-28</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>RON</cbc:DocumentCurrencyCode><cbc:BuyerReference>RO-SYNTH-BUYER-001</cbc:BuyerReference><cac:AccountingSupplierParty><cac:Party><cac:PartyName><cbc:Name>Fictional Supplier SRL</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>Strada Exemplu 1</cbc:StreetName><cbc:CityName>SECTOR1</cbc:CityName><cbc:PostalZone>010101</cbc:PostalZone><cbc:CountrySubentity>RO-B</cbc:CountrySubentity><cac:Country><cbc:IdentificationCode>RO</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>RO12345674</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Fictional Supplier SRL</cbc:RegistrationName><cbc:CompanyID>12345674</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cac:PartyName><cbc:Name>Fictional Buyer SRL</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>Strada Test 2</cbc:StreetName><cbc:CityName>Cluj-Napoca</cbc:CityName><cbc:PostalZone>400001</cbc:PostalZone><cbc:CountrySubentity>RO-CJ</cbc:CountrySubentity><cac:Country><cbc:IdentificationCode>RO</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>RO98765438</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Fictional Buyer SRL</cbc:RegistrationName><cbc:CompanyID>98765438</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>30</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>RO49AAAA1B31007593840000</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans><cac:TaxTotal><cbc:TaxAmount currencyID=\"RON\">19.00</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"RON\">100.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"RON\">19.00</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"RON\">100.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"RON\">100.00</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\"RON\">119.00</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"RON\">119.00</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>1</cbc:ID><cbc:InvoicedQuantity unitCode=\"C62\">1</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"RON\">100.00</cbc:LineExtensionAmount><cac:Item><cbc:Name>Synthetic consulting service</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"RON\">100.00</cbc:PriceAmount><cbc:BaseQuantity unitCode=\"C62\">1</cbc:BaseQuantity></cac:Price></cac:InvoiceLine></Invoice>"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kamerozkan/romania-efactura-validator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "documents": [{
            "documentId": "synthetic-cius-ro-valid",
            "fileName": "synthetic-cius-ro-valid.xml",
            "xml": "<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\"><cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1</cbc:CustomizationID><cbc:ID>RO-SYNTH-INV-001</cbc:ID><cbc:IssueDate>2026-07-29</cbc:IssueDate><cbc:DueDate>2026-08-28</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>RON</cbc:DocumentCurrencyCode><cbc:BuyerReference>RO-SYNTH-BUYER-001</cbc:BuyerReference><cac:AccountingSupplierParty><cac:Party><cac:PartyName><cbc:Name>Fictional Supplier SRL</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>Strada Exemplu 1</cbc:StreetName><cbc:CityName>SECTOR1</cbc:CityName><cbc:PostalZone>010101</cbc:PostalZone><cbc:CountrySubentity>RO-B</cbc:CountrySubentity><cac:Country><cbc:IdentificationCode>RO</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>RO12345674</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Fictional Supplier SRL</cbc:RegistrationName><cbc:CompanyID>12345674</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cac:PartyName><cbc:Name>Fictional Buyer SRL</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>Strada Test 2</cbc:StreetName><cbc:CityName>Cluj-Napoca</cbc:CityName><cbc:PostalZone>400001</cbc:PostalZone><cbc:CountrySubentity>RO-CJ</cbc:CountrySubentity><cac:Country><cbc:IdentificationCode>RO</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>RO98765438</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Fictional Buyer SRL</cbc:RegistrationName><cbc:CompanyID>98765438</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>30</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>RO49AAAA1B31007593840000</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans><cac:TaxTotal><cbc:TaxAmount currencyID=\"RON\">19.00</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"RON\">100.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"RON\">19.00</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"RON\">100.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"RON\">100.00</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\"RON\">119.00</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"RON\">119.00</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>1</cbc:ID><cbc:InvoicedQuantity unitCode=\"C62\">1</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"RON\">100.00</cbc:LineExtensionAmount><cac:Item><cbc:Name>Synthetic consulting service</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"RON\">100.00</cbc:PriceAmount><cbc:BaseQuantity unitCode=\"C62\">1</cbc:BaseQuantity></cac:Price></cac:InvoiceLine></Invoice>",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("kamerozkan/romania-efactura-validator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "documents": [
    {
      "documentId": "synthetic-cius-ro-valid",
      "fileName": "synthetic-cius-ro-valid.xml",
      "xml": "<Invoice xmlns=\\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\\" xmlns:cac=\\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\\" xmlns:cbc=\\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\\"><cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1</cbc:CustomizationID><cbc:ID>RO-SYNTH-INV-001</cbc:ID><cbc:IssueDate>2026-07-29</cbc:IssueDate><cbc:DueDate>2026-08-28</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>RON</cbc:DocumentCurrencyCode><cbc:BuyerReference>RO-SYNTH-BUYER-001</cbc:BuyerReference><cac:AccountingSupplierParty><cac:Party><cac:PartyName><cbc:Name>Fictional Supplier SRL</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>Strada Exemplu 1</cbc:StreetName><cbc:CityName>SECTOR1</cbc:CityName><cbc:PostalZone>010101</cbc:PostalZone><cbc:CountrySubentity>RO-B</cbc:CountrySubentity><cac:Country><cbc:IdentificationCode>RO</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>RO12345674</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Fictional Supplier SRL</cbc:RegistrationName><cbc:CompanyID>12345674</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cac:PartyName><cbc:Name>Fictional Buyer SRL</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>Strada Test 2</cbc:StreetName><cbc:CityName>Cluj-Napoca</cbc:CityName><cbc:PostalZone>400001</cbc:PostalZone><cbc:CountrySubentity>RO-CJ</cbc:CountrySubentity><cac:Country><cbc:IdentificationCode>RO</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>RO98765438</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Fictional Buyer SRL</cbc:RegistrationName><cbc:CompanyID>98765438</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>30</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>RO49AAAA1B31007593840000</cbc:ID></cac:PayeeFinancialAccount></cac:PaymentMeans><cac:TaxTotal><cbc:TaxAmount currencyID=\\"RON\\">19.00</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\\"RON\\">100.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\\"RON\\">19.00</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\\"RON\\">100.00</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\\"RON\\">100.00</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\\"RON\\">119.00</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\\"RON\\">119.00</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>1</cbc:ID><cbc:InvoicedQuantity unitCode=\\"C62\\">1</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\\"RON\\">100.00</cbc:LineExtensionAmount><cac:Item><cbc:Name>Synthetic consulting service</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>19</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\\"RON\\">100.00</cbc:PriceAmount><cbc:BaseQuantity unitCode=\\"C62\\">1</cbc:BaseQuantity></cac:Price></cac:InvoiceLine></Invoice>"
    }
  ]
}' |
apify call kamerozkan/romania-efactura-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=kamerozkan/romania-efactura-validator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/zBP5ddAvCKHhDIMNE/builds/cg7ZFuVKtmIjwDGfx/openapi.json
