oneapi
Sign in
Anaf v1 / Interop (CII / Factur-X)

CII → UBL

Converts a CII invoice received from abroad into CIUS-RO (UBL 2.1), rebuilding it through the same builder as build — so what comes out is validatable, not merely translated.

POST
https://oneapi.ro/api/anaf/v1/interop/cii-to-ubl

Request body

The request body is the whole document, sent raw (Content-Type: application/xml) — not an object with fields.

CII invoice

efactura-cii.xml application/xml · 5,5 KB — sent as is, in the request body.

A credit note in CII

efactura-stornare-cii.xml application/xml · 4,4 KB — sent as is, in the request body.

A corrected invoice, in CII

efactura-corectata-cii.xml application/xml · 5,5 KB — sent as is, in the request body.

Query parameters

NameTypeDescriptionAccepted values
formatoptional text Shape of the returned XML: xml (default) or base64. e.g. base64

How it behaves

  • The document can also be sent as a file: multipart/form-data with the fisier field (curl -F fisier=@document.xml), instead of the raw body. The file content becomes the request body, so the result is identical; options stay in the query string, and any other form field next to fisier returns 422 camp_necunoscut.
  • Takes a UN/CEFACT CII invoice (root CrossIndustryInvoice) and converts it to a CIUS-RO invoice (UBL 2.1) — using the very same emission engine as e-Factura, so the result respects the CIUS-RO rules (derived VAT categories, computed totals, nomenclatures).
  • It maps the number, dates, parties, lines (with VAT rate and category) and the payment means; the totals are recomputed by the engine from the received lines.
  • The conversion may return warnings — non-blocking notes (e.g. an unrecognised county) — but does not validate CIUS-RO. For a verdict, run the result through e-Factura /validate.
  • Zero retention: the conversion is stateless, in-memory.

What it is for

  • Taking a CII / Factur-X invoice received from a European partner and turning it into a CIUS-RO e-invoice.
  • Starting from a European format to then issue in Romania.

Response structure

FieldTypeDescription
data.standard string The resulting standard: CIUS-RO.
data.schema string The namespace of the UBL root.
data.xml string The generated CIUS-RO UBL XML; text or base64 depending on format.
data.meta object Metadata from the emission engine: totals and the per-category VAT breakdown.
data.meta.customization_id string The CIUS-RO identifier of the specification applied.
data.meta.document_type_code string The document type code (e.g. 380 invoice, 381 credit note).
data.meta.totals.lines_net integer
data.meta.totals.allowance_total integer
data.meta.totals.charge_total integer
data.meta.totals.taxable_base integer
data.meta.totals.vat integer
data.meta.totals.gross integer
data.meta.totals.prepaid integer
data.meta.totals.rounding integer
data.meta.totals.payable integer
data.meta.vat_breakdown[].category string
data.meta.vat_breakdown[].rate integer
data.meta.vat_breakdown[].base integer
data.meta.vat_breakdown[].amount integer
data.warnings array Non-blocking warnings {cod,mesaj,camp}.
meta.generat_la string When the response was built (ISO 8601).

Response examples

body: @efactura-cii.xml

POSThttps://oneapi.ro/api/anaf/v1/interop/cii-to-ubl
{
    "data": {
        "standard": "CIUS-RO",
        "schema": "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2",
        "xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<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\">\n  <cbc:CustomizationID>urn:cen.eu:en16931: 2017#compliant#urn:efactura.mfinante.ro:CIUS-RO: 1.0.1</cbc:CustomizationID>\n  <cbc:ID>FCT-2026-0142</cbc:ID>\n  <cbc:IssueDate>2026-09-10</cbc:IssueDate>\n  <cbc:DueDate>2026-10-10</cbc:DueDate>\n  <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>\n  <cbc:DocumentCurrencyCode>RON</cbc:DocumentCurrencyCode>\n  <cac:AccountingSupplierParty>\n    <cac:Party>\n      <cac:PostalAddress>\n        <cbc:StreetName>Str. Memorandumului 28</cbc:StreetName>\n        <cbc:CityName>Cluj-Napoca</cbc:CityName>\n        <cbc:CountrySubentity>RO-CJ</cbc:CountrySubentity>\n        <cac:Country>\n          <cbc:IdentificationCode>RO</cbc:IdentificationCode>\n        </cac:Country>\n      </cac:PostalAddress>\n      <cac:PartyTaxScheme>\n        <cbc:CompanyID>RO990000005</cbc:CompanyID>\n        <cac:TaxScheme>\n          <cbc:ID>VAT</cbc:ID>\n        </cac:TaxScheme>\n      </cac:PartyTaxScheme>\n      <cac:PartyLegalEntity>\n        <cbc:RegistrationName>Exemplu Furnizor SRL</cbc:RegistrationName>\n      </cac:PartyLegalEntity>\n    </cac:Party>\n  </cac:AccountingSupplierParty>\n  <cac:AccountingCustomerParty>\n    <cac:Party>\n      <cac:PostalAddress>\n        <cbc:StreetName>Calea Victoriei 1</cbc:StreetName>\n        <cbc:CityName>SECTOR1</cbc:CityName>\n        <cbc:CountrySubentity>RO-B</cbc:CountrySubentity>\n        <cac:Country>\n          <cbc:IdentificationCode>RO</cbc:IdentificationCode>\n        </cac:Country>\n      </cac:PostalAddress>\n      <cac:PartyTaxScheme>\n        <cbc:CompanyID>RO990000072</cbc:CompanyID>\n        <cac:TaxScheme>\n          <cbc:ID>VAT</cbc:ID>\n        </cac:TaxScheme>\n      </cac:PartyTaxScheme>\n      <cac:PartyLegalEntity>\n        <cbc:RegistrationName>Exemplu Client SRL</cbc:RegistrationName>\n      </cac:PartyLegalEntity>\n    </cac:Party>\n  </cac:AccountingCustomerParty>\n  <cac:TaxTotal>\n    <cbc:TaxAmount currencyID=\"RON\">147.00</cbc:TaxAmount>\n    <cac:TaxSubtotal>\n      <cbc:TaxableAmount currencyID=\"RON\">700.00</cbc:TaxableAmount>\n      <cbc:TaxAmount currencyID=\"RON\">147.00</cbc:TaxAmount>\n      <cac:TaxCategory>\n        <cbc:ID>S</cbc:ID>\n        <cbc:Percent>21</cbc:Percent>\n        <cac:TaxScheme>\n          <cbc:ID>VAT</cbc:ID>\n        </cac:TaxScheme>\n      </cac:TaxCategory>\n    </cac:TaxSubtotal>\n  </cac:TaxTotal>\n  <cac:LegalMonetaryTotal>\n    <cbc:LineExtensionAmount currencyID=\"RON\">700.00</cbc:LineExtensionAmount>\n    <cbc:TaxExclusiveAmount currencyID=\"RON\">700.00</cbc:TaxExclusiveAmount>\n    <cbc:TaxInclusiveAmount currencyID=\"RON\">847.00</cbc:TaxInclusiveAmount>\n    <cbc:PayableAmount currencyID=\"RON\">847.00</cbc:PayableAmount>\n  </cac:LegalMonetaryTotal>\n  <cac:InvoiceLine>\n    <cbc:ID>1</cbc:ID>\n    <cbc:InvoicedQuantity unitCode=\"H87\">2</cbc:InvoicedQuantity>\n    <cbc:LineExtensionAmount currencyID=\"RON\">200.00</cbc:LineExtensionAmount>\n    <cac:Item>\n      <cbc:Name>Servicii de consultanţă</cbc:Name>\n      <cac:ClassifiedTaxCategory>\n        <cbc:ID>S</cbc:ID>\n        <cbc:Percent>21</cbc:Percent>\n        <cac:TaxScheme>\n          <cbc:ID>VAT</cbc:ID>\n        </cac:TaxScheme>\n      </cac:ClassifiedTaxCategory>\n    </cac:Item>\n    <cac:Price>\n      <cbc:PriceAmount currencyID=\"RON\">100.00</cbc:PriceAmount>\n    </cac:Price>\n  </cac:InvoiceLine>\n  <cac:InvoiceLine>\n    <cbc:ID>2</cbc:ID>\n    <cbc:InvoicedQuantity unitCode=\"H87\">1</cbc:InvoicedQuantity>\n    <cbc:LineExtensionAmount currencyID=\"RON\">500.00</cbc:LineExtensionAmount>\n    <cac:Item>\n      <cbc:Name>Licenţă software anuală</cbc:Name>\n      <cac:ClassifiedTaxCategory>\n        <cbc:ID>S</cbc:ID>\n        <cbc:Percent>21</cbc:Percent>\n        <cac:TaxScheme>\n          <cbc:ID>VAT</cbc:ID>\n        </cac:TaxScheme>\n      </cac:ClassifiedTaxCategory>\n    </cac:Item>\n    <cac:Price>\n      <cbc:PriceAmount currencyID=\"RON\">500.00</cbc:PriceAmount>\n    </cac:Price>\n  </cac:InvoiceLine>\n</Invoice>\n",
        "meta": {
            "customization_id": "urn:cen.eu:en16931: 2017#compliant#urn:efactura.mfinante.ro:CIUS-RO: 1.0.1",
            "document_type_code": "380",
            "totals": {
                "lines_net": 700,
                "allowance_total": 0,
                "charge_total": 0,
                "taxable_base": 700,
                "vat": 147,
                "gross": 847,
                "prepaid": 0,
                "rounding": 0,
                "payable": 847
            },
            "vat_breakdown": [
                {
                    "category": "S",
                    "rate": 21,
                    "base": 700,
                    "amount": 147
                }
            ]
        },
        "warnings": []
    },
    "meta": {
        "generat_la": "2026-10-06T23: 59: 44+03: 00"
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatToken missing, invalid, expired or revoked.
403feature_indisponibilThe current plan does not include the feature the route depends on.
422xml_invalidThe body is not a CII invoice (the CrossIndustryInvoice root is missing), has no lines, or invalid XML.
429cota_depasitaThe plan's monthly quota has been exceeded (see Retry-After).

Errors in the Anaf module use the same envelope as the rest of the platform, with two extra fields: {eroare: {cod, mesaj, camp, request_id}}. eroare.cod is stable and is what you branch on; on validation (422) the code is case-specific: xml_invalid, xml_nu_e_factura, unitate_necunoscuta, luna_invalida and so on. camp points at the offending field when one can be identified.

{
    "eroare": {
        "cod": "xml_invalid",
        "mesaj": "The body is not a CII invoice (the CrossIndustryInvoice root is missing), has no lines, or invalid XML.",
        "camp": "format",
        "request_id": "0199c1f0-6e1a-7c3d-9b2f-4a8e5d1c7b04"
    }
}