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

UBL → CII

Converts a CIUS-RO invoice (UBL 2.1) into UN/CEFACT CII, the format partners in other countries ask for. The conversion keeps the reference to the preceding invoice, so a credit note can also make the trip back.

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

Request body

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

UBL CIUS-RO invoice

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

A credit note

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

An invoice in euro

efactura-intracomunitara.xml application/xml · 4,2 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 CIUS-RO invoice in UBL 2.1 (root Invoice or CreditNote) and converts it to UN/CEFACT CII (Cross Industry Invoice), on the EN16931 core — the e-invoice format used in France (Factur-X), Germany (ZUGFeRD) and across many EU B2B exchanges.
  • The core fields are mapped: number, dates, parties (seller/buyer with address, company id, VAT id), lines (product, price, quantity, VAT) and the per-category VAT totals. Amounts are taken from the source UBL (authoritative), with no recomputation.
  • Zero retention. The XML received is not written to disk, not logged, and never enters cache keys.

What it is for

  • Sending a Romanian invoice to a European partner that expects CII / Factur-X.
  • Feeding a system that only consumes UN/CEFACT CII, starting from e-Factura.

Response structure

FieldTypeDescription
data.standard string The resulting standard: CII.
data.schema string The namespace of the CII root.
data.guideline string The EN16931 guideline declared in the document context.
data.xml string The generated CII XML; text or base64 depending on format.
meta.generat_la string When the response was built (ISO 8601).

Response examples

body: @efactura.xml

POSThttps://oneapi.ro/api/anaf/v1/interop/ubl-to-cii
{
    "data": {
        "standard": "CII",
        "schema": "urn:un:unece:uncefact:data:standard:CrossIndustryInvoice: 100",
        "guideline": "urn:cen.eu:en16931: 2017",
        "xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rsm:CrossIndustryInvoice xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice: 100\" xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity: 100\" xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType: 100\" xmlns:qdt=\"urn:un:unece:uncefact:data:standard:QualifiedDataType: 100\">\n  <rsm:ExchangedDocumentContext>\n    <ram:GuidelineSpecifiedDocumentContextParameter>\n      <ram:ID>urn:cen.eu:en16931: 2017</ram:ID>\n    </ram:GuidelineSpecifiedDocumentContextParameter>\n  </rsm:ExchangedDocumentContext>\n  <rsm:ExchangedDocument>\n    <ram:ID>FCT-2026-0142</ram:ID>\n    <ram:TypeCode>380</ram:TypeCode>\n    <ram:IssueDateTime>\n      <udt:DateTimeString format=\"102\">20260910</udt:DateTimeString>\n    </ram:IssueDateTime>\n  </rsm:ExchangedDocument>\n  <rsm:SupplyChainTradeTransaction>\n    <ram:IncludedSupplyChainTradeLineItem>\n      <ram:AssociatedDocumentLineDocument>\n        <ram:LineID>1</ram:LineID>\n      </ram:AssociatedDocumentLineDocument>\n      <ram:SpecifiedTradeProduct>\n        <ram:Name>Servicii de consultanţă</ram:Name>\n      </ram:SpecifiedTradeProduct>\n      <ram:SpecifiedLineTradeAgreement>\n        <ram:NetPriceProductTradePrice>\n          <ram:ChargeAmount>100.00</ram:ChargeAmount>\n        </ram:NetPriceProductTradePrice>\n      </ram:SpecifiedLineTradeAgreement>\n      <ram:SpecifiedLineTradeDelivery>\n        <ram:BilledQuantity unitCode=\"H87\">2</ram:BilledQuantity>\n      </ram:SpecifiedLineTradeDelivery>\n      <ram:SpecifiedLineTradeSettlement>\n        <ram:ApplicableTradeTax>\n          <ram:TypeCode>VAT</ram:TypeCode>\n          <ram:CategoryCode>S</ram:CategoryCode>\n          <ram:RateApplicablePercent>21</ram:RateApplicablePercent>\n        </ram:ApplicableTradeTax>\n        <ram:SpecifiedTradeSettlementLineMonetarySummation>\n          <ram:LineTotalAmount>200.00</ram:LineTotalAmount>\n        </ram:SpecifiedTradeSettlementLineMonetarySummation>\n      </ram:SpecifiedLineTradeSettlement>\n    </ram:IncludedSupplyChainTradeLineItem>\n    <ram:IncludedSupplyChainTradeLineItem>\n      <ram:AssociatedDocumentLineDocument>\n        <ram:LineID>2</ram:LineID>\n      </ram:AssociatedDocumentLineDocument>\n      <ram:SpecifiedTradeProduct>\n        <ram:Name>Licenţă software anuală</ram:Name>\n      </ram:SpecifiedTradeProduct>\n      <ram:SpecifiedLineTradeAgreement>\n        <ram:NetPriceProductTradePrice>\n          <ram:ChargeAmount>500.00</ram:ChargeAmount>\n        </ram:NetPriceProductTradePrice>\n      </ram:SpecifiedLineTradeAgreement>\n      <ram:SpecifiedLineTradeDelivery>\n        <ram:BilledQuantity unitCode=\"H87\">1</ram:BilledQuantity>\n      </ram:SpecifiedLineTradeDelivery>\n      <ram:SpecifiedLineTradeSettlement>\n        <ram:ApplicableTradeTax>\n          <ram:TypeCode>VAT</ram:TypeCode>\n          <ram:CategoryCode>S</ram:CategoryCode>\n          <ram:RateApplicablePercent>21</ram:RateApplicablePercent>\n        </ram:ApplicableTradeTax>\n        <ram:SpecifiedTradeSettlementLineMonetarySummation>\n          <ram:LineTotalAmount>500.00</ram:LineTotalAmount>\n        </ram:SpecifiedTradeSettlementLineMonetarySummation>\n      </ram:SpecifiedLineTradeSettlement>\n    </ram:IncludedSupplyChainTradeLineItem>\n    <ram:ApplicableHeaderTradeAgreement>\n      <ram:SellerTradeParty>\n        <ram:Name>Exemplu Furnizor SRL</ram:Name>\n        <ram:PostalTradeAddress>\n          <ram:LineOne>Str. Memorandumului 28</ram:LineOne>\n          <ram:CityName>Cluj-Napoca</ram:CityName>\n          <ram:CountryID>RO</ram:CountryID>\n          <ram:CountrySubDivisionName>RO-CJ</ram:CountrySubDivisionName>\n        </ram:PostalTradeAddress>\n        <ram:SpecifiedTaxRegistration>\n          <ram:ID schemeID=\"VA\">RO990000005</ram:ID>\n        </ram:SpecifiedTaxRegistration>\n      </ram:SellerTradeParty>\n      <ram:BuyerTradeParty>\n        <ram:Name>Exemplu Client SRL</ram:Name>\n        <ram:PostalTradeAddress>\n          <ram:LineOne>Calea Victoriei 1</ram:LineOne>\n          <ram:CityName>SECTOR1</ram:CityName>\n          <ram:CountryID>RO</ram:CountryID>\n          <ram:CountrySubDivisionName>RO-B</ram:CountrySubDivisionName>\n        </ram:PostalTradeAddress>\n        <ram:SpecifiedTaxRegistration>\n          <ram:ID schemeID=\"VA\">RO990000072</ram:ID>\n        </ram:SpecifiedTaxRegistration>\n      </ram:BuyerTradeParty>\n    </ram:ApplicableHeaderTradeAgreement>\n    <ram:ApplicableHeaderTradeDelivery/>\n    <ram:ApplicableHeaderTradeSettlement>\n      <ram:InvoiceCurrencyCode>RON</ram:InvoiceCurrencyCode>\n      <ram:ApplicableTradeTax>\n        <ram:CalculatedAmount>147.00</ram:CalculatedAmount>\n        <ram:TypeCode>VAT</ram:TypeCode>\n        <ram:BasisAmount>700.00</ram:BasisAmount>\n        <ram:CategoryCode>S</ram:CategoryCode>\n        <ram:RateApplicablePercent>21</ram:RateApplicablePercent>\n      </ram:ApplicableTradeTax>\n      <ram:SpecifiedTradePaymentTerms>\n        <ram:DueDateDateTime>\n          <udt:DateTimeString format=\"102\">20261010</udt:DateTimeString>\n        </ram:DueDateDateTime>\n      </ram:SpecifiedTradePaymentTerms>\n      <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n        <ram:LineTotalAmount>700.00</ram:LineTotalAmount>\n        <ram:TaxBasisTotalAmount>700.00</ram:TaxBasisTotalAmount>\n        <ram:TaxTotalAmount currencyID=\"RON\">147.00</ram:TaxTotalAmount>\n        <ram:GrandTotalAmount>847.00</ram:GrandTotalAmount>\n        <ram:DuePayableAmount>847.00</ram:DuePayableAmount>\n      </ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n    </ram:ApplicableHeaderTradeSettlement>\n  </rsm:SupplyChainTradeTransaction>\n</rsm:CrossIndustryInvoice>\n"
    },
    "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 valid UBL invoice (neither Invoice nor CreditNote), 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 valid UBL invoice (neither Invoice nor CreditNote), or invalid XML.",
        "camp": "format",
        "request_id": "0199c1f0-6e1a-7c3d-9b2f-4a8e5d1c7b04"
    }
}