Skip to main content

eFactura (ANAF)


How to get “API Key” from Portal?

To obtain the API key used with /auth/login, navigate to Settings → ERP Management → API Management in the Portal and use Generate. See also Authentication.

Romania — eFactura (ANAF)

Romania’s e-invoicing is mandatory via ANAF (Agenția Națională de Administrare Fiscală). Invoices are submitted as UBL XML (RO_EFACTURA). ANAF access uses an OAuth token stored in Docnova.

Supported invoiceType

ValueDescription
RO_EFACTURARomania eFactura (ANAF UBL format)

Configure ANAF OAuth token POST

Purpose of use: Run once per company before submitting invoices to ANAF.

Endpoint Information

PropertyValue
URL/token/RO/upload-token
MethodPOST
Content-Typeapplication/json
Base URL
Stage Environment URLhttps://app-stage.docnova.ai/
Production Environment URLhttps://api.docnova.ai/
AuthorizationBearer JWT

Request body (JSON)

{
"companyId": "uuid",
"tokenType": "ROMANIA_INVOICE",
"tokenName": "ANAF Invoice Token",
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"accessToken": "access-token-from-anaf",
"refreshToken": "refresh-token-from-anaf",
"generateDate": "2025-04-01"
}

Request parameters

FieldTypeRequiredDescription
companyIdUUIDYesCompany ID
tokenTypeStringYesROMANIA_INVOICE (invoices) or ROMANIA_WAYBILL (e-Transport)
tokenNameStringYesLabel
clientIdStringYesANAF OAuth client ID
clientSecretStringYesANAF OAuth client secret
accessTokenStringYesCurrent ANAF access token
refreshTokenStringYesANAF refresh token
generateDateDateYesYYYY-MM-DD

Update ANAF token POST

Endpoint Information

PropertyValue
URL/token/RO/update-token
MethodPOST
Content-Typeapplication/json
Base URL
Stage Environment URLhttps://app-stage.docnova.ai/
Production Environment URLhttps://api.docnova.ai/
AuthorizationBearer JWT

Request body: Same as Configure ANAF OAuth token.


Get token list POST

Endpoint Information

PropertyValue
URL/token/RO/get-token
MethodPOST
Content-Typeapplication/json
Base URL
Stage Environment URLhttps://app-stage.docnova.ai/
Production Environment URLhttps://api.docnova.ai/
AuthorizationBearer JWT

Query parameters

FieldTypeRequiredDescription
companyIdUUIDYesCompany ID

Delete token DELETE

Endpoint Information

PropertyValue
URL/token/RO/{companyId}
MethodDELETE
Base URL
Stage Environment URLhttps://app-stage.docnova.ai/
Production Environment URLhttps://api.docnova.ai/
AuthorizationBearer JWT

Query parameters

FieldTypeRequiredDescription
tokenIdUUIDYesToken ID

Validate invoice XML POST

Purpose of use: Validate eFactura XML against the ANAF schema before submission.

Endpoint Information

PropertyValue
URL/invoice/RO/validare
MethodPOST
Content-Typeapplication/json
Base URL
Stage Environment URLhttps://app-stage.docnova.ai/
Production Environment URLhttps://api.docnova.ai/
AuthorizationBearer JWT
{
"xmlData": "PD94bWwgdm...",
"companyId": "uuid"
}
FieldTypeRequiredDescription
xmlDataStringYesBase64-encoded eFactura XML
companyIdStringNoCompany UUID (or use apiKey)
apiKeyStringNoAlternative to companyId

Example response

{
"stare": "ok",
"trace_id": "abc123",
"Messages": []
}
FieldDescription
stareok = valid, nok = invalid
trace_idANAF trace ID
MessagesValidation errors

Responses

200 — Validation result

400 — Invalid XML or request


Send invoice to ANAF POST

Purpose of use: Submit one or more invoices to ANAF after they exist in Docnova.

Endpoint Information

PropertyValue
URL/invoice/RO/send-to-anaf
MethodPOST
Content-Typeapplication/json
Base URL
Stage Environment URLhttps://app-stage.docnova.ai/
Production Environment URLhttps://api.docnova.ai/
AuthorizationBearer JWT
{
"companyId": "uuid",
"invoiceIdList": ["uuid-1", "uuid-2"]
}

Example response

[
{ "invoiceId": "uuid-1", "response": "OK" }
]

Responses

200 — Submission result


Check file status (ANAF) GET

Purpose of use: Poll ANAF upload status using incarcareId.

Endpoint Information

Endpoint Information

PropertyValue
URL/invoice/RO/file-status
MethodGET
Base URL
Stage Environment URLhttps://app-stage.docnova.ai/
Production Environment URLhttps://api.docnova.ai/
AuthorizationBearer JWT

Query parameters

FieldTypeRequiredDescription
apiKeyStringYes*API key
incarcareIdStringYesANAF upload ID from submission

Get message list POST

Purpose of use: List ANAF messages for a date range and filter.

Endpoint Information

PropertyValue
URL/invoice/RO/factura-message-list
MethodPOST
Content-Typeapplication/json
Base URL
Stage Environment URLhttps://app-stage.docnova.ai/
Production Environment URLhttps://api.docnova.ai/
AuthorizationBearer JWT
{
"zile": "60",
"filtru": "P"
}
FieldDescription
zileDays to look back (max 60)
filtruP sent, T all, E errors

Download invoice response (descărcare) POST

Purpose of use: Download ANAF response payload for a given download id.

Endpoint Information

PropertyValue
URL/invoice/RO/download-descarcare
MethodPOST
Content-Typeapplication/json
Base URL
Stage Environment URLhttps://app-stage.docnova.ai/
Production Environment URLhttps://api.docnova.ai/
AuthorizationBearer JWT
{
"id": "anaf-download-id",
"cif": "RO12345678",
"fromPortal": ""
}

Convert XML to PDF POST

Purpose of use: Render eFactura XML as a PDF (B2B / B2C).

Endpoint Information

PropertyValue
URL/invoice/RO/xml-to-pdf
MethodPOST
Content-Typeapplication/json
Base URL
Stage Environment URLhttps://app-stage.docnova.ai/
Production Environment URLhttps://api.docnova.ai/
AuthorizationBearer JWT
{
"xmlData": "PD94bWwgdm...",
"businessType": "B2B"
}

Responses

200 — PDF binary


Invoice status values

StatusDescription
DRAFTNot yet submitted
SENTSubmitted to ANAF
PORTAL_OKAYAccepted by ANAF
PORTAL_ERRORRejected by ANAF
PORTAL_IN_PROCESSProcessing
CANCELEDCanceled
CONFIRMEDConfirmed
REJECTEDRejected by buyer
SAVED_FROM_ANAFIncoming from ANAF