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
| Value | Description |
|---|---|
| RO_EFACTURA | Romania eFactura (ANAF UBL format) |
Configure ANAF OAuth token POST
Purpose of use: Run once per company before submitting invoices to ANAF.
Endpoint Information
| Property | Value |
|---|---|
| URL | /token/RO/upload-token |
| Method | POST |
| Content-Type | application/json |
| Base URL | Stage Environment URLhttps://app-stage.docnova.ai/ Production Environment URLhttps://api.docnova.ai/ |
| Authorization | Bearer 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
| Field | Type | Required | Description |
|---|---|---|---|
| companyId | UUID | Yes | Company ID |
| tokenType | String | Yes | ROMANIA_INVOICE (invoices) or ROMANIA_WAYBILL (e-Transport) |
| tokenName | String | Yes | Label |
| clientId | String | Yes | ANAF OAuth client ID |
| clientSecret | String | Yes | ANAF OAuth client secret |
| accessToken | String | Yes | Current ANAF access token |
| refreshToken | String | Yes | ANAF refresh token |
| generateDate | Date | Yes | YYYY-MM-DD |
Update ANAF token POST
Endpoint Information
| Property | Value |
|---|---|
| URL | /token/RO/update-token |
| Method | POST |
| Content-Type | application/json |
| Base URL | Stage Environment URLhttps://app-stage.docnova.ai/ Production Environment URLhttps://api.docnova.ai/ |
| Authorization | Bearer JWT |
Request body: Same as Configure ANAF OAuth token.
Get token list POST
Endpoint Information
| Property | Value |
|---|---|
| URL | /token/RO/get-token |
| Method | POST |
| Content-Type | application/json |
| Base URL | Stage Environment URLhttps://app-stage.docnova.ai/ Production Environment URLhttps://api.docnova.ai/ |
| Authorization | Bearer JWT |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| companyId | UUID | Yes | Company ID |
Delete token DELETE
Endpoint Information
| Property | Value |
|---|---|
| URL | /token/RO/{companyId} |
| Method | DELETE |
| Base URL | Stage Environment URLhttps://app-stage.docnova.ai/ Production Environment URLhttps://api.docnova.ai/ |
| Authorization | Bearer JWT |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| tokenId | UUID | Yes | Token ID |
Validate invoice XML POST
Purpose of use: Validate eFactura XML against the ANAF schema before submission.
Endpoint Information
| Property | Value |
|---|---|
| URL | /invoice/RO/validare |
| Method | POST |
| Content-Type | application/json |
| Base URL | Stage Environment URLhttps://app-stage.docnova.ai/ Production Environment URLhttps://api.docnova.ai/ |
| Authorization | Bearer JWT |
{
"xmlData": "PD94bWwgdm...",
"companyId": "uuid"
}
| Field | Type | Required | Description |
|---|---|---|---|
| xmlData | String | Yes | Base64-encoded eFactura XML |
| companyId | String | No | Company UUID (or use apiKey) |
| apiKey | String | No | Alternative to companyId |
Example response
{
"stare": "ok",
"trace_id": "abc123",
"Messages": []
}
| Field | Description |
|---|---|
| stare | ok = valid, nok = invalid |
| trace_id | ANAF trace ID |
| Messages | Validation 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
| Property | Value |
|---|---|
| URL | /invoice/RO/send-to-anaf |
| Method | POST |
| Content-Type | application/json |
| Base URL | Stage Environment URLhttps://app-stage.docnova.ai/ Production Environment URLhttps://api.docnova.ai/ |
| Authorization | Bearer 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
| Property | Value |
|---|---|
| URL | /invoice/RO/file-status |
| Method | GET |
| Base URL | Stage Environment URLhttps://app-stage.docnova.ai/ Production Environment URLhttps://api.docnova.ai/ |
| Authorization | Bearer JWT |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| apiKey | String | Yes* | API key |
| incarcareId | String | Yes | ANAF upload ID from submission |
Get message list POST
Purpose of use: List ANAF messages for a date range and filter.
Endpoint Information
| Property | Value |
|---|---|
| URL | /invoice/RO/factura-message-list |
| Method | POST |
| Content-Type | application/json |
| Base URL | Stage Environment URLhttps://app-stage.docnova.ai/ Production Environment URLhttps://api.docnova.ai/ |
| Authorization | Bearer JWT |
{
"zile": "60",
"filtru": "P"
}
| Field | Description |
|---|---|
| zile | Days to look back (max 60) |
| filtru | P 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
| Property | Value |
|---|---|
| URL | /invoice/RO/download-descarcare |
| Method | POST |
| Content-Type | application/json |
| Base URL | Stage Environment URLhttps://app-stage.docnova.ai/ Production Environment URLhttps://api.docnova.ai/ |
| Authorization | Bearer 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
| Property | Value |
|---|---|
| URL | /invoice/RO/xml-to-pdf |
| Method | POST |
| Content-Type | application/json |
| Base URL | Stage Environment URLhttps://app-stage.docnova.ai/ Production Environment URLhttps://api.docnova.ai/ |
| Authorization | Bearer JWT |
{
"xmlData": "PD94bWwgdm...",
"businessType": "B2B"
}
Responses
200 — PDF binary
Invoice status values
| Status | Description |
|---|---|
| DRAFT | Not yet submitted |
| SENT | Submitted to ANAF |
| PORTAL_OKAY | Accepted by ANAF |
| PORTAL_ERROR | Rejected by ANAF |
| PORTAL_IN_PROCESS | Processing |
| CANCELED | Canceled |
| CONFIRMED | Confirmed |
| REJECTED | Rejected by buyer |
| SAVED_FROM_ANAF | Incoming from ANAF |