Tax Declarations Service
The Tax Declarations service enables calling applications to generate the SAF-T XML file (Standard Audit File for Tax) required for mandatory tax reporting to Bulgarian and Romanian tax authorities.
Access info
| Endpoint | https://tax-declarations-api.socrate.io/graphql |
| Required access keys | Tenant-level service access key |
| Pricing | Check the available purchase options. |
| Notes | To call the service, the access key must be provided in the x-api-key header of the HTTP request. If you are using the GraphQL console, you can view the service’s documentation and schema only after entering an access key. Make sure that the scope of the key allows access to the queries and mutations that you require. For example, to grant the key access to all queries and mutations, the key’s scope must be set to tax-declarations-api:query:* tax-declarations-api:mutation:*. |
Usage
Prerequisites
- The organization(s) for which reporting is done must exist in the SBS system. You can add new organizations either from the SBS Portal or programmatically by calling the Organizations Service.
- The organization object in SBS must contain at least the following fields:
name,tin(Tax Identification Number),regNo(registration number issued by the National Trade Registration Office),country,streetAddress,ibanNumber,taxAccountingBasis. - For Bulgarian tax declarations, the organization’s ownership structure must be defined (
ownershipStructureBG) in accordance with the rules laid out for elements S.O.1 through S.O.11 in the SAF-T Schema. You can define these fields when creating or updating the organization, either from the SBS Portal or programmatically by calling thecreateOrganizationorupdateOrganizationmutations of the Organizations Service. - You must prepare several CSV files to be used as input to te Tax Declarations service. The exact set of files depends on the audit file country and the tax residence status of the reporting organization. Typically, an API caller generates or exports the CSV files from an ERP system. For details, see:
SAF-T Schema
Bulgaria
The SAF-T schema files for Bulgaria can be downloaded from https://nra.bg/wps/portal/nra/proekti/sistema-za-schetovodno-otchitane/sistema-za-schetovodno-otchitane.
Romania
The Romanian National Agency of Fiscal Administration (ANAF) has published (and periodically updates) an Excel sheet which contains information about the structure of the SAF-T file, field validation rules and format, as well as valid codes required for specific field types. The file is called “Schema Fișierul Standard de Control (Standard Audit File – SAF-T)” and will be subsequently referred to as the SAF-T Schema in this documentation.
To locate the SAF-T schema on ANAF website (https://anaf.ro), navigate to Despre ANAF > Strategii ANAF > Proiecte de digitalizare > SAF-T and look for the most recently published version of the “schema xls” file.
Generating a declaration
To generate a declaration:
-
Obtain from your ERP system the input CSV files to be used as input to the tax declaration. For the structure of each file, see:
-
Create a representative through a call to the
createRepresentativemutation. -
Initiate a declaration through a call to the
initiateDeclarationmutation. As a result, a new declaration object is created, and the response contains the unique declaration ID. You will need to work with this declaration ID in subsequent steps to further process the declaration and monitor its status. -
Add all the input CSV files to the declaration. See Preparing declaration files.
-
Run the
generateDeclarationmutation. This triggers a computation that takes place from several minutes to several hours, depending on the size of input CSV files. In either case, the outcome, including any possible errors, is reported in the returnedProcessobject. If the computation was successful, the response includes a download URL at which you can download the generated XML file.
Preparing declaration files
After you have initiated the declaration, you can add all the CSV input files to it.
For each input CSV file, the steps are as follows:
- Run the
prepareFilemutation. In the response, you get the file’s upload URL at which you can upload the actual file. - In the programming language of your API, make an HTTP
PUTrequest to upload the file content to the upload URL. This step is similar to how you would create a file and then upload its content in the File Management Service, as described in the Tutorial: Create a file.
Note that you can add multiple files of the same type for the same declaration. For example, you can add several input CSV files of type “Invoices”. If multiple files of the same type exist, SBS will aggregate and compute data found in all respective files.
After adding all the CSV files, you can check if they are indeed attached to the declaration by running the declarations query, for example:
query declarations ($filter:DeclarationsFilter!, $processFilter:ProcessesFilterInput) {
declarations(filter:$filter) {
id
organization { id, name, tin }
representative { id, firstName, lastName, phone, email }
headerComment
from
to
files { id, fileType, name, createdAt }
createdAt
}
}
{
"filter": {
"id": "YOUR_DECLARATION_ID",
"organizationId": "YOUR_ORGANIZATION_ID"
}
}
If your declaration looks good so far, you can proceed to running the generateDeclaration mutation, for example:
mutation generateDeclaration($declarationId:ID!) {
generateDeclaration(declarationId:$declarationId) {
id
status
}
}
{
"declarationId": "YOUR_DECLARATION_ID"
}
Dealing with large input files
As mentioned above, when you add a file to the declaration, there are two steps involved:
- Run
prepareFileand obtain the upload URL. - In the programming language of your API, make an HTTP
PUTrequest to upload the file content to the upload URL.
For the second step, note, however, that the maximum file size that you can send in a single PUT request is 5 GB. Should you need to add larger files to the declaration, you can do so through the multipart upload mutations provided by the File Management Service. In this scenario, the process looks as follows:
- Run
prepareFileand take note of thedata.prepareFile.idreturned in the response body. This ID corresponds to a file id of a file in File Management Service. - Provide the id above as input to the
initiateMultipartUploadmutation and continue with the rest of steps required for multipart upload, as described in Uploading large files.
Processes
Each time when you run generateDeclaration, a new process with status NEW is attached to the declaration. You can view the declaration and the status of all its processes by running the declarations query and requesting the processes field in the response, for example:
query declarations ($filter:DeclarationsFilter!) {
declarations(filter:$filter) {
id
processes{
id,
status,
errorMessages,
totalSegmentsInSequence,
createdAt,
result {
id
name
createdAt
downloadUrl(expiresIn:3600)
}
}
createdAt
}
}
{
"filter": {
"id": "YOUR_DECLARATION_ID",
"organizationId": "YOUR_ORGANIZATION_ID"
}
}
The status of any process is initially NEW. The status NEW will normally change to INPROCESS after approximately 1 minute. Note that, if you run generateDeclaration multiple times for the same declaration, each run will start a new process for the same declaration. In this case, you will need to track the status of each process separately. The processes field of the declarations query provides a filter (by process ID) for that purpose.
The INPROCESS status of a process may take from a few minutes to a few hours, depending on the size of the input CSV files. After the INPROCESS status, the status may change to either ERROR (if errors are encountered) or DONE (upon successful processing).
If the status ERROR is encountered, check the errorMessages response field of the respective process for details.
If the process completes with status DONE, it generates a result XML file whose download URL is available in the result response field of the respective process. Also, the totals counters of the declaration object are now populated with data as computed from the input CSV files.
Additionally, when the process status is DONE for a monthly Romanian D406 declaration, the roD406AnalysisData field of the process is populated with financial KPIs. This data is also accessible directly via the roD406AnalysisData query.
If necessary, you may stop a running process through a call to killProcess. However, this is possible only if the process has not generated any results (that is, if the result field of the process is empty).
You may also delete a process through the deleteProcess mutation. Deleting a running process is possible only if the process has generated no result yet.
Deleting declarations
You can delete declarations through a call to deleteDeclaration. Note, however, that it is not possible to delete a declaration if it has at least one running process that has already generated some result file. To delete such a declaration, you will need to wait for the process to finish first.
Validation
Validation of data provided as input to the Tax Declarations service takes place at two levels:
- A first validation takes place after you submit the
generateTaxDeclarationmutation. This validation is performed by the SBS API. Any errors encountered at this stage are reported in theerrorMessagesattribute of the returnedProcessobject. - A second level of validation is provided by the DUK Integrator tool available for download from the ANAF website (https://anaf.ro). The same tool is used to generate the PDF (including the signed XML SAF-T file) that is to be submitted to ANAF. To download the tool, navigate to Despre ANAF > Strategii ANAF > Proiecte de digitalizare > SAF-T and look for the latest available version of the validator.
In addition to the two validation levels above, ANAF defines a set of consistency tests that are not necessarily covered by the DUK Integrator tool. For Romanian D406 declarations, the results of these tests are returned in the validations field of ROD406AnalysisData, as a list of ROD406Validation objects.
These consistency tests have recommendation status only: because some of them can yield false positives in situations to which they do not apply, a failed test does not prevent a declaration from being generated or submitted, and is surfaced for your awareness.
The tests are as defined in the following ANAF communiqués:
- Set 1: comunicat_saft_teste_v2.pdf
- Set 2: testedeconsistenta2.pdf
How to view the results of ANAF consistency tests
The consistency tests are evaluated together with the RO D406 analysis data when you generate a Romanian D406 declaration, so no separate request is needed to run them. Once the declaration has been computed, you read the results from the validations field of ROD406AnalysisData.
To obtain the consistency-test results for a declaration:
- Generate the declaration as described in Generating a declaration, and take note of the process
idreturned by thegenerateDeclarationmutation. - Wait for the process to reach status DONE. You can poll the process status through the
declarationsquery, as shown under Processes. - Once the process is DONE, call the
roD406AnalysisDataquery with the organization ID, declaration ID, and process ID, requesting thevalidationsfield. Until the analysis data has been computed, the query returnsnull. - Inspect each returned
ROD406Validationobject. Thestatusindicates the outcome of the test (SUCCEEDED, FAILED, or SKIPPED). For a FAILED test, themessagefield carries the failure reason; a SKIPPED test may also carry amessageexplaining why the test did not apply.
Remember that these results are informational only: a FAILED consistency test does not prevent the declaration from being generated or submitted.
Example
query roD406AnalysisData($organizationId:ID!, $declarationId:ID!, $processId:ID!) {
roD406AnalysisData(
organizationId: $organizationId
declarationId: $declarationId
processId: $processId
) {
validations {
code
description
status
message
}
}
}
{
"organizationId": "YOUR_ORGANIZATION_ID",
"declarationId": "YOUR_DECLARATION_ID",
"processId": "YOUR_PROCESS_ID"
}
A declaration returns the full standard list of tests. The description field is the test description as published in the ANAF communiqués (in Romanian), while the message field for a FAILED or SKIPPED test is in English. A sample response, abbreviated to one test of each status, looks as follows:
{
"data": {
"roD406AnalysisData": {
"validations": [
{
"code": "1.1",
"description": "În secțiunea Header, subsecțiunea Header Structure - Company - Company Header Structure - Adress - verificarea completării câmpurilor City și Country",
"status": "SUCCEEDED",
"message": null
},
{
"code": "1.5",
"description": "În secțiunea Master File, subsecțiunea General Ledger Accounts verificarea completării câmpurilor: Account ID, Account description, Account Type, Opening Debit/Credit Balance, Closing Debit/Credit Balance",
"status": "FAILED",
"message": "29 account(s) missing required fields (AccountID, AccountDescription, AccountType, or balance fields)"
},
{
"code": "1.14",
"description": "În secțiunea Master File verificarea soldurilor finale (Closing Debit Balance și Closing Credit Balance) ale lunii să coincidă cu soldurile inițiale (Opening Debit Balance și Opening Credit Balance) ale lunii următoare",
"status": "SKIPPED",
"message": "Single-period declaration (period null/null): cross-period validation requires data from consecutive declarations"
}
]
}
}
}
Queries
declarations
Lists the declarations defined for the given tenant. The results of their computation processes can be found in the corresponding declaration process list.
Arguments
| Argument | Type | Description |
|---|---|---|
| filter | DeclarationsFilter! |
Mandatory. Provides the filter criteria, as a DeclarationsFilter input. |
DeclarationsFilter input
| Attribute | Type | Description |
|---|---|---|
| organizationId | ID |
The ID of the organization from the Organizations Service. |
| id | ID |
The ID of the tax declaration record. |
Result
Declaration type
| Attribute | Type | Description |
|---|---|---|
| id | ID |
The unique identifier of the tax declaration. |
| organization | Organization |
The organization’s details, expressed as an Organization type from the Organizations Service. |
| representative | Representative |
The representative’s details, expressed as a Representative type. |
| headerComment | HeaderComment |
Specifies the reporting period covered by the declaration. Valid values for Romanian SAF-T: L - for monthly returns, T - for quarterly returns, A - for annual returns, C - for returns on request, NL - non-residents monthly, NT - non-residents quarterly. Valid values for Bulgarian SAF-T: M - Monthly, A - for annual returns, D - on demand. |
| declarationType | DeclarationType |
Specifies the type of the declaration. Valid values: D406 (Romanian Standard Audit File for Tax), D406T - (Romanian Standard Audit File for Tax - Test), SAFT - Bulgarian Standard Audit File for Tax, KPI - Romanian D406 KPI analysis only (no SAF-T XML file is generated). |
| taxAccountingBasis | TaxAccountingBasis |
For valid values, see Appendix 6: Tax Accounting Basis. |
| auditFileCountry | AuditFileCountryCode |
Identifies the country (as a 2-letter country code) of this tax declaration. Possible values are RO and BG. |
| from | Date |
The start date of the reporting period. |
| to | Date |
The end date of the reporting period. |
| regionCode | RegionCode |
Identifies the region/county/province within the tax authority. For Romanian county codes, see Appendix 4: List of county codes (Romania). For Bulgarian county codes, see Appendix 5: List of county codes (Bulgaria). |
| files | [File] |
The list of files associated with the current declaration. See the File type. |
| processes(filter) | [Process] |
The list of processes associated with the current declaration. You can optionally filter processes by supplying a ProcessesFilterInput object as input argument. For the structure of a process, see the Process type. |
| createdAt | DateTime |
The date and time when the declaration was created. |
Representative type
| Attribute | Type | Description |
|---|---|---|
| id | ID |
The unique identifier of the representative. |
| firstName | String |
The representative’s first name. |
| lastName | String |
The representative’s last name. |
| phone | String |
The representative’s phone. |
EmailAddress |
The representative’s email address. | |
| otherTitles | String |
The representative’s job title. Used in Bulgarian SAF-T. |
File type
| Attribute | Type | Description |
|---|---|---|
| id | ID |
The unique identifier of the file. You can use this ID to refer to the file also through the File Management Service. |
| declarationId | ID |
The unique identifier of the tax declaration. |
| fileType | CsvFileType |
The type of data reported by the file. Valid values: GeneralLedgerAccounts, BusinessPartners, Assets, PhysicalStock, GeneralLedgerEntries, Invoices, Payments, MovementOfGoods, AssetTransactions. |
| name | String |
The file name. |
| contentLength | Float |
The file size in bytes. |
| uploadUrl(expiresIn) | Uri |
The URL at which the file content can be uploaded. Note that the upload URL expires after the number of seconds supplied in the expiresIn parameter. |
| downloadUrl(expiresIn) | Uri |
The URL at which the file content can be downloaded. Note that the download URL expires after the number of seconds supplied in the expiresIn parameter. |
| createdAt | DateTime |
The date and time when the file was created. |
ProcessesFilter input
| Attribute | Type | Description |
|---|---|---|
| id | ID |
The ID of the process that you would like to filter by. |
Process type
| Attribute | Type | Description |
|---|---|---|
| id | ID |
The unique identifier of the file. |
| status | DeclarationStatus |
The status of the declaration. Valid values: NEW - computation has not started yet, INPROCESS - computation is in progress, DONE - computation has completed without errors, ERROR - computation has completed with errors. |
| errorMessages | [String] |
The list of error messages, if applicable. |
| result | [ResultFile] |
The list of files created by the process, as ResultFile type. |
| totals | Totals |
The totals computed by this process, as Totals type. |
| header | Header |
Provides general information about the underlying file (the same one as in the header of the XML file), as a Header object. |
| totalSegmentsInSequence | Int |
The number of result files (segments) generated by this process. Corresponds to TotalSegmentsInsequence in the header of the generated XML file. |
| createdAt | DateTime |
The date and time when the process was created. |
roD406AnalysisData |
ROD406AnalysisData |
The pre-computed RO D406 KPI analysis for this process. Populated when the process completes with status DONE for a Romanian D406 declaration. See ROD406AnalysisData. |
roKPIAnalysisData |
[ROKPIAnalysisDataElement] |
The pre-computed RO D406 KPI analysis broken down by month, as a list of ROKPIAnalysisDataElement objects. See also the roKPIAnalysisData query. |
analysisDataViewerUrl(expiresIn) |
Uri |
A presigned URL for viewing the analysis data in an external viewer. Expires after the number of seconds supplied in expiresIn. |
ROD406AnalysisData type
| Attribute | Type | Description |
|---|---|---|
from |
Date |
Start date of the reporting period. |
to |
Date |
End date of the reporting period. |
headerComment |
HeaderComment |
Type of return (e.g., L for monthly). |
currency |
CurrencyCode |
ISO 4217 currency code of the reported amounts. |
periodDays |
Int |
Number of calendar days in the reporting period. |
profitability |
ROD406Profitability |
Profitability KPIs. See ROD406Profitability. |
liquidity |
ROD406Liquidity |
Liquidity KPIs. See ROD406Liquidity. |
activity |
ROD406Activity |
Activity KPIs. See ROD406Activity. |
tax |
ROD406TaxAnalysis |
Tax KPIs. See ROD406TaxAnalysis. |
assets |
ROD406AssetAnalysis |
Asset KPIs. See ROD406AssetAnalysis. |
standardBalanceSheet |
ROD406StandardBalanceSheet |
Standard balance sheet. See ROD406StandardBalanceSheet. |
systemBalanceSheet |
ROD406SystemBalanceSheet |
System balance sheet. See ROD406SystemBalanceSheet. |
validations |
ROD406Validation |
The results of ANAF-recommended validations run against the declaration (consistency tests). Currently, these validations do not prevent the declaration from being generated and have recommendation status only. |
ROD406Profitability type
For formulas, see Appendix 9.
| Attribute | Type | Description |
|---|---|---|
CA |
Float |
Turnover / Revenue (Cifra de afaceri). Net credit on revenue accounts (70*) minus debit on discount accounts (709). |
EAT |
Float |
Net profit after tax (Profit net). |
EBT |
Float |
Gross profit before tax (Profit brut): EAT + Σ DebitAmount(69*). |
EBIT |
Float |
Operating profit: EBT − Σ CreditAmount(76*) + Σ DebitAmount(66*). |
EBITDA |
Float |
Operating profit before interest, taxes, depreciation, and amortization: EBIT + Σ DebitAmount(68*). |
MB |
Float |
Gross margin %: (EBIT × 100) / CA. |
RCT |
Float |
Total expense ratio % (Rata cheltuieli totale). |
MPN |
Float |
Net profit margin %: (EAT / CA) × 100. |
VE |
Float |
Operating revenue (Venituri din exploatare): Σ CreditAmount(70*..75*) − Σ DebitAmount(709). |
CT |
Float |
Total costs and expenses (Cheltuieli totale): Σ Debit (6*) - Σ Credit(609). |
ROD406Liquidity type
| Attribute | Type | Description |
|---|---|---|
CR |
Float |
Accounts receivable (Creante clienti): net closing debit balance of customer accounts. |
DAT |
Float |
Accounts payable (Datorii furnizori): net closing credit balance of supplier accounts. |
CL |
Float |
Net working capital (Capital de lucru): CR − DAT. |
ROD406Activity type
| Attribute | Type | Description |
|---|---|---|
NFC |
Int |
Sales invoice count (Nr. facturi clienți). |
NFF |
Int |
Purchase invoice count (Nr. facturi furnizori). |
VMF |
Float |
Average sales invoice value (Valoare medie factură vânzare). |
NPC |
Int |
Number of active business partners. |
RRC |
Float |
Customer receivables turnover (Viteza de rotație a debitelor clienților). |
RAC |
Float |
Current asset turnover (Viteza de rotație a activelor circulante). |
RRF |
Float |
Supplier payables turnover (Viteza de rotație a debitelor furnizorilor). |
ROD406TaxAnalysis type
| Attribute | Type | Description |
|---|---|---|
TVAC |
Float |
Output VAT (TVA colectat): sum of tax amounts on customer invoices. |
TVAD |
Float |
Input VAT (TVA deductibil): sum of tax amounts on supplier invoices. |
TVAN |
Float |
Net VAT position (TVA net): TVAC − TVAD. Positive = VAT liability; negative = refundable position. |
ROD406AssetAnalysis type
| Attribute | Type | Description |
|---|---|---|
VBI |
Float |
Fixed assets book value (Valoare imobilizări): total net book value of fixed assets at period end. |
AMP |
Float |
Depreciation for the period (Amortizare periodica). |
RAI |
Float |
Fixed asset turnover (Viteza de rotație a activelor imobilizate): CA divided by the average net book value of fixed assets. |
ROD406StandardBalanceSheet type
The standard balance sheet maps the organization’s account balances to the standard chart of accounts prescribed by the tax authority for the corresponding tax accounting basis.
| Attribute | Type | Description |
|---|---|---|
classes |
[ROD406StandardBalanceClass] |
List of balance sheet classes. See ROD406StandardBalanceClass. |
openingDebit |
Float |
Total opening debit balance across all classes. |
openingCredit |
Float |
Total opening credit balance across all classes. |
currentDebit |
Float |
Total current-period debit turnover across all classes. |
currentCredit |
Float |
Total current-period credit turnover across all classes. |
closingDebit |
Float |
Total closing debit balance across all classes. |
closingCredit |
Float |
Total closing credit balance across all classes. |
ROD406StandardBalanceClass type
| Attribute | Type | Description |
|---|---|---|
id |
ID |
The class identifier. |
name(locale) |
String |
The class name. Accepts an optional locale argument, , for example “ro-RO”. |
accounts |
[ROD406StandardBalanceAccount] |
List of accounts in this class. See ROD406StandardBalanceAccount. |
openingDebit |
Float |
Total opening debit balance for the class. |
openingCredit |
Float |
Total opening credit balance for the class. |
currentDebit |
Float |
Total current-period debit turnover for the class. |
currentCredit |
Float |
Total current-period credit turnover for the class. |
closingDebit |
Float |
Total closing debit balance for the class. |
closingCredit |
Float |
Total closing credit balance for the class. |
ROD406StandardBalanceAccount type
| Attribute | Type | Description |
|---|---|---|
id |
ID |
The account identifier. |
name(locale) |
String |
The account name. Accepts an optional locale argument, for example “ro-RO”. |
openingDebit |
Float |
Opening debit balance for the account. |
openingCredit |
Float |
Opening credit balance for the account. |
currentDebit |
Float |
Current-period debit turnover for the account. |
currentCredit |
Float |
Current-period credit turnover for the account. |
closingDebit |
Float |
Closing debit balance for the account. |
closingCredit |
Float |
Closing credit balance for the account. |
ROD406SystemBalanceSheet type
The system balance sheet provides the organization’s actual (system-of-record) account balances, as opposed to the standard balance sheet, which maps balances to the standard chart of accounts prescribed by the tax authority. Both balance sheets are populated only for monthly (HeaderComment = L) or quarterly (HeaderComment = T) Romanian D406 declarations.
| Attribute | Type | Description |
|---|---|---|
classes |
[ROD406SystemBalanceClass] |
List of balance sheet classes. See ROD406SystemBalanceClass. |
openingDebit |
Float |
Total opening debit balance across all classes. |
openingCredit |
Float |
Total opening credit balance across all classes. |
currentDebit |
Float |
Total current-period debit turnover across all classes. |
currentCredit |
Float |
Total current-period credit turnover across all classes. |
closingDebit |
Float |
Total closing debit balance across all classes. |
closingCredit |
Float |
Total closing credit balance across all classes. |
ROD406SystemBalanceClass type
| Attribute | Type | Description |
|---|---|---|
id |
ID |
The class identifier. |
name(locale) |
String |
The class name. Accepts an optional locale argument, for example “ro-RO”. |
accounts |
[ROD406SystemBalanceAccount] |
List of accounts in this class. See ROD406SystemBalanceAccount. |
openingDebit |
Float |
Total opening debit balance for the class. |
openingCredit |
Float |
Total opening credit balance for the class. |
currentDebit |
Float |
Total current-period debit turnover for the class. |
currentCredit |
Float |
Total current-period credit turnover for the class. |
closingDebit |
Float |
Total closing debit balance for the class. |
closingCredit |
Float |
Total closing credit balance for the class. |
ROD406SystemBalanceAccount type
| Attribute | Type | Description |
|---|---|---|
id |
ID |
The account identifier. |
standardId |
ID |
The identifier of the corresponding standard account in the ROD406StandardBalanceAccount type. |
name |
String |
The account name. |
openingDebit |
Float |
Opening debit balance for the account. |
openingCredit |
Float |
Opening credit balance for the account. |
currentDebit |
Float |
Current-period debit turnover for the account. |
currentCredit |
Float |
Current-period credit turnover for the account. |
closingDebit |
Float |
Closing debit balance for the account. |
closingCredit |
Float |
Closing credit balance for the account. |
ROKPIAnalysisDataElement type
Provides the RO D406 KPI analysis for a single month of the reporting period. A process returns one element per month covered by the declaration.
| Attribute | Type | Description |
|---|---|---|
month |
Month |
The month to which this set of KPIs applies. |
profitability |
ROD406Profitability |
Profitability KPIs for the month. See ROD406Profitability. |
liquidity |
ROD406Liquidity |
Liquidity KPIs for the month. See ROD406Liquidity. |
activity |
ROD406Activity |
Activity KPIs for the month. See ROD406Activity. |
tax |
ROD406TaxAnalysis |
Tax KPIs for the month. See ROD406TaxAnalysis. |
ROD406Validation type
Represents the outcome of a single ANAF consistency test applied to the analysis data. These tests are the additional checks ANAF requires that are not covered by the DUK Integrator tool described under Validation.
| Attribute | Type | Description |
|---|---|---|
code |
String |
The unique code that identifies the validation, in the form <Set>.<Number>, where <Set> is the ANAF communiqué set and <Number> is the test number within that set. For example, 2.4 is test 4 of Set 2. |
description |
String |
The description of the test, as published in the corresponding ANAF communiqué. |
status |
ROD406ValidationStatus |
The outcome of the validation. Valid values: SUCCEEDED - the validation passed, FAILED - the validation failed, SKIPPED (default) - the validation has not been applied (for example, when no data exists for the period, or when the validation doe not apply to this case). |
message |
String |
The message associated with the validation. Populated with the failure reason for a FAILED validation, and may also carry an explanation for a SKIPPED validation (for example, why the test did not apply). Empty (null) for a SUCCEEDED validation. |
ResultFile type
| Attribute | Type | Description |
|---|---|---|
| id | ID |
The ID of the file. |
| name | String |
The file name. |
| contentLength | Float |
The file size in bytes. |
| createdAt | DateTime |
The date and time when the file was created. |
| downloadUrl(expiresIn) | Uri |
The URL at which the file can be downloaded. Note that the download URL expires after the number of seconds supplied in the expiresIn parameter. |
Totals type
| Attribute | Type | Description |
|---|---|---|
| csvLines | CsvFileLines |
The number of lines in each of the CSV files, as a CsvFileLines type. |
| csvBusinessPartnerAccountTotals | [AccountTotal] |
The totals of business partners general ledger accounts, as a list of AccountTotal objects. |
| csvGeneralLedgerAccountsMonthTotals | [DebitCreditOpenClose] |
The monthly totals of the general ledger accounts, as a list of DebitCreditOpenClose objects. |
| csvGeneralLedgerEntriesMonthTotals | [DebitCredit] |
The monthly totals of the general ledger entries, as a list of DebitCredit objects. |
| csvInvoiceTotals | CsvInvoiceTotals |
The totals applicable to reported invoices, as CsvInvoiceTotals object. |
| csvPaymentTotals | CsvPaymentTotals |
The totals applicable to reported payments, as CsvPaymentTotals object. |
| masterFilesTotals | MasterFilesTotals |
The totals applicable to the MasterFiles section of the SAF-T file, as a MasterFilesTotals object. |
| generalLedgerEntriesTotals | GeneralLedgerEntriesTotals |
The totals applicable to the GeneralLedgerEntries section of the SAF-T file, as a GeneralLedgerEntriesTotals object. |
| sourceDocuments | SourceDocuments |
The totals applicable to the SourceDocuments section of the SAF-T file, as a SourceDocuments object. |
CsvFileLines type
| Attribute | Type | Description |
|---|---|---|
| generalLedgerAccounts | Int |
Reports the number of lines in GeneralLedgerAccounts.csv. |
| businessPartners | Int |
Reports the number of lines in BusinessPartners.csv. |
| assets | Int |
Reports the number of lines in Assets.csv. |
| physicalStock | Int |
Reports the number of lines in PhysicalStock.csv. |
| generalLedgerEntries | Int |
Reports the number of lines in GeneralLedgerEntries.csv. |
| invoices | Int |
Reports the number of lines in Invoices.csv. |
| payments | Int |
Reports the number of lines in Payments.csv. |
| movementOfGoods | Int |
Reports the number of lines in MovementOfGoods.csv. |
| assetTransactions | Int |
Reports the number of lines in AssetTransactions.csv. |
| allFileLines | Int |
Reports the total number of lines in all files. |
AccountTotal type
| Attribute | Type | Description |
|---|---|---|
| accountID | String |
The general ledger account code. |
| debitCredit | DebitCreditOpenClose |
The opening and/or closing credit/debit values, as a DebitCreditOpenClose type. |
DebitCreditOpenClose type
| Attribute | Type | Description |
|---|---|---|
| totalDebitOpen | Float |
The debit balance at the start date of the selection period. |
| totalCreditOpen | Float |
The credit balance at the start date of the selection period. |
| totalDebitClose | Float |
The debit balance at the end date of the selection period. |
| totalCreditClose | Float |
The credit balance at the end date of the selection period. |
DebitCredit type
| Attribute | Type | Description |
|---|---|---|
| totalDebit | Float |
The debit balance for the reported period. |
| totalCredit | Float |
The credit balance for the reported period. |
CsvInvoiceTotals type
| Attribute | Type | Description |
|---|---|---|
| allInvoices | Int |
The total number of invoices. |
| customerInvoices | Int |
The total number of customer invoices. |
| supplierInvoices | Int |
The total number of supplier invoices. |
| customerInvoicesTotal | Float |
The total amount of all customer invoices. |
| supplierInvoicesTotal | Float |
The total amount of all supplier invoices. |
| customerInvoicesCurrencyTotal | [CurrencyAmount] |
The total amount of all customer invoices reported in another currency, as a CurrencyAmount object. |
| supplierInvoicesCurrencyTotal | [CurrencyAmount] |
The total amount of all supplier invoices reported in another currency, as a CurrencyAmount object. |
CsvPaymentTotals type
| Attribute | Type | Description |
|---|---|---|
| allPayments | Int |
The total number of payments. |
| debitPayments | Int |
The total number of debit payments. |
| creditPayments | Int |
The total number of credit payments. |
| debitTotal | Float |
The total amount of all debit payments. |
| creditTotal | Float |
The total amount of all credit payments. |
| debitCurrencyTotal | [CurrencyAmount] |
The total amount of all debit payments reported in another currency, as a CurrencyAmount object. |
| creditCurrencyTotal | [CurrencyAmount] |
The total amount of all credit payments reported in another currency, as a CurrencyAmount object. |
CurrencyAmount type
| Attribute | Type | Description |
|---|---|---|
| currency | String |
The currency code. |
| amount | Float |
The amount in the respective currency. |
MasterFilesTotals type
| Attribute | Type | Description |
|---|---|---|
| generalLedgerAccountsTotals | GeneralLedgerAccountsTotals |
The totals of all reported general ledger accounts, as a GeneralLedgerAccountsTotals object. |
| customersTotals | BusinessPartnersTotals |
The totals pertaining to all reported customers, as a BusinessPartnersTotals object. |
| suppliersTotals | BusinessPartnersTotals |
The totals pertaining to all reported suppliers, as a BusinessPartnersTotals object. |
| customers | Int |
The total number of customers. |
| suppliers | Int |
The total number of suppliers. |
| businessPartners | Int |
The total number of business partners (customers and suppliers). |
GeneralLedgerAccountsTotals type
| Attribute | Type | Description |
|---|---|---|
| debitCredit | DebitCreditOpenClose |
The computed total debits and credits, as a DebitCreditOpenClose object. |
BusinessPartnersTotals type
| Attribute | Type | Description |
|---|---|---|
| accountTotals | [AccountTotal] |
A list of AccountTotal objects. |
GeneralLedgerEntriesTotals type
| Attribute | Type | Description |
|---|---|---|
| numberOfEntries | Int |
The total number (count) of general ledger entries. |
| debitCredit | DebitCredit |
The computed debits and credits, as a DebitCredit object. |
SourceDocuments type
| Attribute | Type | Description |
|---|---|---|
| salesInvoices | InvoicesTotals |
The totals applicable to sales invoices, as an InvoicesTotals object. |
| purchaseInvoices | InvoicesTotals |
The totals applicable to purchase invoices, as an InvoicesTotals object. |
| paymentsTotals | PaymentsTotals |
The totals applicable to payments, as a PaymentsTotals object. |
InvoicesTotals type
| Attribute | Type | Description |
|---|---|---|
| numberOfEntries | Int |
The total number (count) of invoices. |
| debitCredit | DebitCredit |
The computed debits and credits, as a DebitCredit object. |
PaymentsTotals type
| Attribute | Type | Description |
|---|---|---|
| numberDebits | Int |
Total number of debit entries. |
| numberCredits | Int |
Total number of credit entries. |
| valueDebits | Float |
The total amount of debits. |
| valueCredits | Float |
The total amount of credits. |
Header type
| Attribute | Type | Description |
|---|---|---|
| auditFileVersion | String |
Identifies the version of the SAF-T file. |
| auditFileCountry | CountryCode |
The two-letter country code, according to ISO 3166-1 alpha 2 standard. For example, RO for Romania. |
| auditFileRegion | String |
The region within the tax authority, according to ISO 3166-1A2 - RO Dept Codes. For example, RO-AB for Alba county. |
| auditFileDateCreated | Date |
The date when the SAF-T file was created. |
| softwareCompanyName | String |
The name of the software company whose product created the SAF-T file. |
| softwareID | String |
The name of the software that generated the SAF-T file. |
| softwareVersion | String |
The version of the software that created the SAF-T file. |
| company | CompanyHeaderStructure |
The details about the reporting company, as a CompanyHeaderStructure object. |
| defaultCurrencyCode | String |
The three-letter currency code (ISO 4217) of the local default currency. |
| selectionCriteria | SelectionCriteriaStructure |
The criteria set by the user to populate the SAF-T file, as a SelectionCriteriaStructure object. |
| headerComment | String |
Indicates the type of return submitted. This can be: monthly return, quarterly return, annual return or on-demand return. |
| totalSegmentsInSequence | Float |
The total number of segments in the sequence. |
| taxAccountingBasis | String |
For valid values, see Appendix 6: Tax Accounting Basis. |
| taxEntity | String |
The reference to the company/division/branch. |
CompanyHeaderStructure type
| Attribute | Type | Description |
|---|---|---|
| registrationNumber | String |
The company’s registration number. |
| name | String |
The company name. |
| address | [Address] |
The company address details, as a list of Address objects. |
| contact | [ContactHeaderStructure] |
The company’s contact details, as a list of ContactHeaderStructure objects. |
| taxRegistration | TaxIDStructure |
The company’s tax registration details, as a TaxIdStructure object. |
| bankAccount | [BankAccount] |
The company’s bank account details, as a list of BankAccount objects. |
Address type
| Attribute | Type | Description |
|---|---|---|
| streetName | String |
The street name. |
| number | String |
The street number. |
| additionalAddressDetails | String |
Any additional address details. |
| building | String |
The building. |
| city | String |
The city. |
| postalCode | String |
The postal/zip code. |
| region | String |
The region/county. |
| country | CountryCode |
The country. |
| addressType | String |
Type of address. |
ContactHeaderStructure type
| Attribute | Type | Description |
|---|---|---|
| contactPerson | PersonNameStructure |
The details of the contact person, as a PersonNameStructure object. |
| telephone | String |
The contact phone. |
| fax | String |
The fax. |
EmailAddress |
The email of the contact person. | |
| website | Uri |
The website associated with the contact person. |
PersonNameStructure type
| Attribute | Type | Description |
|---|---|---|
| title | String |
The person’s title. |
| firstName | String |
The person’s first name. |
| initials | String |
The person’s initials. |
| lastNamePrefix | String |
The person’s last name prefix. |
| lastName | String |
The last name of the person. |
| birthName | String |
The birth name. |
| salutation | String |
The salutation (for example, “Mrs”). |
| otherTitles | String |
Any other titles applicable to the person. |
TaxIdStructure type
| Attribute | Type | Description |
|---|---|---|
| taxRegistrationNumber | String |
The tax registration number. |
| taxType | String |
The tax type. |
| taxNumber | String |
The tax number. |
| taxAuthority | String |
The tax authority. |
| taxVerificationDate | String |
The tax verification date. |
BankAccount type
| Attribute | Type | Description |
|---|---|---|
| ibanNumber | String |
The International Banking Account Number. |
| bankAccountNumber | String |
The bank account number. |
| bankAccountName | String |
The name associated with this bank account. |
| sortCode | String |
The bank’s sort code. |
SelectionCriteriaStructure type
| Attribute | Type | Description |
|---|---|---|
| taxReportingJurisdiction | String |
The reported tax reporting jurisdiction. |
| companyEntity | String |
The reported company entity. |
| selectionStartDate | Date |
The start date of the reporting period. |
| selectionEndDate | Date |
The end date of the reporting period. |
| periodStart | Float |
The first accounting period covered by SAF-T. |
| periodStartYear | Float |
The accounting period in which periodStart falls. |
| periodEnd | Float |
The last accounting period covered by SAF-T. |
| periodEndYear | Float |
The accounting period in which periodEnd falls. |
| documentType | String |
Type of documents selected. |
| otherCriteria | String |
Any other criteria used in selecting data. |
Example
query declarations ($filter:DeclarationsFilter!, $processFilter:ProcessesFilterInput) {
declarations(filter:$filter) {
id
organization { id, name, tin }
representative { id, firstName, lastName, phone, email }
headerComment
from
to
files { id, fileType, name, createdAt }
processes (filter: $processFilter) {
id,
status,
errorMessages,
createdAt,
result { id name createdAt downloadUrl(expiresIn:3600) },
totals {
csvLines {
generalLedgerAccounts
businessPartners
assets
physicalStock
generalLedgerEntries
invoices
payments
movementOfGoods
assetTransactions
allFileLines
}
csvBusinessPartnerAccountTotals {
accountID
debitCredit {
totalDebitOpen
totalDebitClose
totalCreditOpen
totalCreditClose
}
}
csvGeneralLedgerAccountsMonthTotals {
totalDebitOpen
totalDebitClose
totalCreditOpen
totalCreditClose
}
csvGeneralLedgerEntriesMonthTotals {
totalCredit
totalDebit
}
csvInvoiceTotals {
allInvoices
customerInvoices
supplierInvoices
customerInvoicesTotal
supplierInvoicesTotal
customerInvoicesCurrencyTotal {
currency
amount
}
supplierInvoicesCurrencyTotal {
currency
amount
}
}
csvPaymentTotals {
allPayments
debitPayments
creditPayments
debitTotal
creditTotal
debitCurrencyTotal {
currency
amount
}
}
},
}
createdAt
}
}
{
"filter": {
"id": "YOUR_DECLARATION_ID",
"organizationId": "YOUR_ORGANIZATION_ID"
}
}
declaration
Retrieves a single declaration by its identifier.
Arguments
| Argument | Type | Description |
|---|---|---|
| id | ID! |
Mandatory. The identifier of the tax declaration. |
Result
See the Declaration type.
Example
query declaration($id:ID!) {
declaration(id:$id) {
id
organization { id, name, tin }
representative { id, firstName, lastName, phone, email }
headerComment
declarationType
from
to
files { id, fileType, name, createdAt }
processes { id, status, createdAt }
createdAt
}
}
{
"id": "YOUR_DECLARATION_ID"
}
organizations
Returns a list of active organizations defined for the given tenant.
Result
The result is an array of Organization.
Organization type
| Attribute | Type | Description |
|---|---|---|
| id | ID! |
Specifies the organization’s unique identifier. |
| name | String |
Specifies the organization’s name. |
| tin | String |
Specifies the organization’s tax identification number (TIN) (in Romanian, CIF - cod de identificare fiscală) issued by ANAF (in Romanian, ANAF - Agenția Națională de Administrare Fiscală). |
| regNo | String |
Specifies the organization’s registration number issued by the National Trade Registration Office (in Romanian, ONRC - Oficiul National al Registrului Comerțului). |
| country | CountryCode |
Enum value that identifies the ISO 3166-2 two-letter country code. |
| createdAt | DateTime |
The date and time when the organization record was created in SBS. |
Example
The following query retrieves the currently active organizations defined in the Organizations Service.
query Organizations {
organizations {
id
name
tin
regNo
country
createdAt
}
}
representatives
Returns a list of representatives created for the given tenant.
Arguments
None.
Result
See the Representative type.
Example
The following query retrieves all the representatives.
query representatives {
representatives {
id
firstName
lastName
phone
email
otherTitles
}
}
roD406AnalysisData
Returns comprehensive RO D406 analysis data for the month for which the declaration was computed. Currently, this query retrieves data only for declarations that use monthly (not quarterly) reporting.
The analysis data is computed together with the declaration and no extra steps are required to generate it, apart from generating the RO D406 declaration itself, see Generating a declaration.
Arguments
| Argument | Type | Description |
|---|---|---|
organizationId |
ID! |
Mandatory. The ID of the organization. |
declarationId |
ID! |
Mandatory. The ID of the declaration. |
processId |
ID! |
Mandatory. The ID of the process. |
Result
Returns ROD406AnalysisData, or null if not yet computed.
Example
query roD406AnalysisData($organizationId:ID!, $declarationId:ID!, $processId:ID!) {
roD406AnalysisData(
organizationId: $organizationId
declarationId: $declarationId
processId: $processId
) {
from
to
currency
periodDays
profitability { CA EAT EBT EBIT EBITDA MB MPN RCT VE CT }
liquidity { CR DAT CL }
activity { NFC NFF VMF NPC RRC RAC RRF }
tax { TVAC TVAD TVAN }
assets { VBI AMP RAI }
standardBalanceSheet {
classes {
id name
openingDebit openingCredit currentDebit currentCredit closingDebit closingCredit
accounts {
id name
openingDebit openingCredit currentDebit currentCredit closingDebit closingCredit
}
}
}
systemBalanceSheet {
openingDebit openingCredit currentDebit currentCredit closingDebit closingCredit
classes {
id name
openingDebit openingCredit currentDebit currentCredit closingDebit closingCredit
accounts {
id standardId name
openingDebit openingCredit currentDebit currentCredit closingDebit closingCredit
}
}
}
validations { code description status message }
}
}
{
"organizationId": "YOUR_ORGANIZATION_ID",
"declarationId": "YOUR_DECLARATION_ID",
"processId": "YOUR_PROCESS_ID"
}
roKPIAnalysisData
Returns historical RO D406 KPI analysis data, broken down by month. Applicable only for declarations that use monthly (not quarterly) reporting.
To obtain KPI data:
- Initiate a Romanian declaration with a call to
initiateDeclaration. SetdeclarationTypeto KPI. - Set the
fromandtodates for the period you want to cover (for example, the past 3 years up to current date). - Set the headerComment to L (Monthly).
- Add the GeneralLedgerAccounts and GeneralLedgerEntries CSV files to the declaration (for the latest month) with
prepareFile, as described in Preparing declaration files. - Trigger the computation with
generateDeclarationand note theidof the returnedProcess. - Once the process reaches status DONE, call
roKPIAnalysisDatawith the organization ID, declaration ID, and that process ID. Until then, the query returnsnull.
NOTE: No SAF-T XML file is generated when you set the declarationType to KPI.
Arguments
| Argument | Type | Description |
|---|---|---|
organizationId |
ID! |
Mandatory. The ID of the organization. |
declarationId |
ID! |
Mandatory. The ID of the declaration. |
processId |
ID! |
Mandatory. The ID of the process. |
Result
Returns a list of ROKPIAnalysisDataElement objects, one per month of the reporting period, or null if not yet computed.
Example
query roKPIAnalysisData($organizationId:ID!, $declarationId:ID!, $processId:ID!) {
roKPIAnalysisData(
organizationId: $organizationId
declarationId: $declarationId
processId: $processId
) {
month
profitability { CA EAT EBT EBIT EBITDA MB MPN RCT VE CT }
liquidity { CR DAT CL }
activity { NFC NFF VMF NPC RRC RAC RRF }
tax { TVAC TVAD TVAN }
}
}
{
"organizationId": "YOUR_ORGANIZATION_ID",
"declarationId": "YOUR_DECLARATION_ID",
"processId": "YOUR_PROCESS_ID"
}
version
Returns the API version.
Mutations
createRepresentative
Creates a record identifying the person that submits the tax declaration. Once a representative is created, it can be referenced multiple times by different declarations.
Arguments
| Attribute | Type | Description |
|---|---|---|
| input | CreateRepresentativeInput! |
Mandatory. Provides the input to the mutation, as CreateRepresentativeInput object. |
CreateRepresentativeInput input
| Attribute | Type | Description |
|---|---|---|
| firstName | String! |
Mandatory. The first name of the representative. |
| lastName | String! |
Mandatory. The last name of the representative. |
| phone | String! |
Mandatory. The phone number of the representative. |
EmailAddress |
Optional. The representative’s email address. | |
| otherTitles | String |
Optional for Romanian SAF-T; mandatory for Bulgarian SAF-T. The representative’s job title. |
Result
See the Representative type.
Example
mutation createRepresentative($input:CreateRepresentativeInput!) {
createRepresentative(input:$input) {
id
firstName
lastName
email
phone
otherTitles
}
}
{
"input": {
"firstName": "Miroslav",
"lastName": "Radomirov",
"phone": "999-999-999",
"email": "miroslav@example.org",
"otherTitles": "Chief Finance Officer"
}
}
deleteDeclaration
Deletes a declaration, including all its input files and related processes.
Arguments
| Attribute | Type | Description |
|---|---|---|
| id | ID! |
Mandatory. The identifier of the declaration to be deleted. |
Result
See the Declaration type.
Example
mutation deleteDeclaration($id:ID!) {
deleteDeclaration(id:$id) {
id
}
}
{
"id": "YOUR_DECLARATION_ID"
}
deleteFile
Deletes a previously uploaded CSV file.
Arguments
| Attribute | Type | Description |
|---|---|---|
| input | DeleteFileInput |
Mandatory. Supplies the input to the mutation, as DeleteFileInput object. |
DeleteFileInput input
| Attribute | Type | Description |
|---|---|---|
| declarationId | ID! |
Mandatory. The identifier of the declaration. |
| id | ID! |
Mandatory. The identifier of the CSV file to be deleted. |
Result
See the File type.
Example
mutation deleteFile ($input:DeleteFileInput!) {
deleteFile(input: $input) {
id
declarationId
fileType
name
createdAt
}
}
{
"input": {
"declarationId": "YOUR_DECLARATION_ID",
"id": "YOUR_FILE_ID"
}
}
deleteProcess
Deletes a declaration computation process and the result XML files.
Arguments
| Attribute | Type | Description |
|---|---|---|
| declarationId | ID! |
Mandatory. The identifier of the declaration. |
| processId | ID! |
Mandatory. The identifier of the process to be deleted. |
Result
See the Process type.
Example
mutation deleteProcess($declarationId:ID!, $processId:ID!) {
deleteProcess(declarationId:$declarationId, processId:$processId) {
id
status
errorMessages
result {
id
# downloadUrl
createdAt
}
createdAt
}
}
{
"declarationId": "YOUR_DECLARATION_ID",
"processId": "YOUR_PROCESS_ID"
}
deleteRepresentative
Deletes a previously created representative.
Arguments
| Attribute | Type | Description |
|---|---|---|
| id | ID! |
The identifier of the representative to be deleted. |
Result
See the Representative type.
Example
mutation deleteRepresentative($id:ID!) {
deleteRepresentative(id:$id) {
id
firstName
lastName
phone
email
}
}
{
"id": "REPRESENTATIVE_ID"
}
generateDeclaration
Starts a declaration computation process.
Arguments
| Attribute | Type | Description |
|---|---|---|
| declarationId | ID! |
The ID of the declaration created previously through the initiateDeclaration mutation. |
Result
See the Process type.
Example
mutation generateDeclaration($declarationId:ID!) {
generateDeclaration(declarationId:$declarationId) {
id
status
errorMessages
}
}
{
"declarationId": "YOUR_DECLARATION_ID"
}
initiateDeclaration
Creates a new tax declaration, without triggering any computation processes. After this mutation, run prepareFile for each CSV file that must be supplied as input to the declaration and obtain the file’s upload URL. After uploading the CSV files, run generateDeclaration mutation to trigger the computation process.
Arguments
| Attribute | Type | Description |
|---|---|---|
| input | InitiateDeclarationInput |
Provides the input to the mutation, as InitiateDeclarationInput object. |
InitiateDeclarationInput input
| Attribute | Type | Description |
|---|---|---|
| declarationType | DeclarationType! |
Mandatory. Identifies the type of tax declaration that is to be computed. Valid values: D406 (Romanian Standard Audit File for Tax), D406T - (Romanian Standard Audit File for Tax - Test), SAFT - Bulgarian Standard Audit File for Tax, KPI - Romanian D406 KPI analysis only. When set to KPI, no SAF-T XML file is generated; instead, KPIs are computed for every month in the reporting period and exposed through the roKPIAnalysisData query and the roKPIAnalysisData member of the Process type. |
| from | Date! |
Mandatory. The start date of the reporting period covered by the tax declaration. |
| to | Date! |
Mandatory. The end date of the reporting period covered by the tax declaration. |
| organizationId | ID! |
Mandatory. The identifier of the organization defined through the Organizations service. |
| representativeId | ID! |
Mandatory. The identifier of the representative previously created through the createRepresentative mutation. |
| regionCode | RegionCode |
Mandatory for Romanian but optional for Bulgarian tax declarations. Identifies the region/county/province within the tax authority. For Romanian county codes, see Appendix 4: List of county codes (Romania). For Bulgarian region codes, see Appendix 5: List of region codes (Bulgaria). NOTE: The region code should belong to the country of the reporting organization (or to the auditFileCountry, if this argument was provided as input). |
| headerComment | HeaderComment! |
Mandatory. Specifies the reporting period covered by the declaration. L - for monthly returns (Romania), M - for monthly returns (Bulgaria), T - for quarterly returns (Romania), A - for annual returns (Romania, Bulgaria), C - for returns on request (Romania), D - for returns on demand (Bulgaria), NL - non-residents monthly (Romania), NT - non-residents quarterly (Romania). |
| taxAccountingBasis | TaxAccountingBasis |
Optional. Specifies the tax accounting basis to be used for this declaration. If this argument is not provided, the tax accounting basis of the organization identified by organizationId will be used. If this argument is provided, it takes precedence over the tax accounting basis defined at organization level. For valid values, see Appendix 6: Tax Accounting Basis. NOTE: The combination of input auditFileCountry and taxAccountingBasis must be valid; otherwise, initiating the declaration will fail with an error. For valid auditFileCountry versus taxAccountingBasis combinations, see Appendix 7: Audit File Country vs Tax Accounting Basis. |
| auditFileCountry | AuditFileCountryCode |
Optional, but recommended. Identifies the country (as a 2-letter country code) in which this tax declaration is reported. Valid values: RO, BG. It is recommended to set this parameter explicitly. NOTE: The combination of input auditFileCountry and taxAccountingBasis must be valid; otherwise, initiating the declaration will fail with an error. For valid auditFileCountry versus taxAccountingBasis combinations, see Appendix 7: Audit File Country vs Tax Accounting Basis. If auditFileCountry is not supplied, the value will be inferred from the country of the reporting organization, according to the rules in Appendix 8: Rules for inferring Audit File Country. |
| softwareCompanyName | String |
Optional. If provided, this value populates the <nsSAFT:SoftwareCompanyName> field in the header of the generated XML declaration. Otherwise, the default value is BIT Software SA. |
| softwareID | String |
Optional. If provided, this value populates the <nsSAFT:SoftwareID> field in the header of the generated XML declaration. Otherwise, the default value is Socrate Business Services. |
| softwareVersion | String |
Optional. If provided, this value populates the <nsSAFT:SoftwareVersion> field in the header of the generated XML declaration. Otherwise, the default value is the current version of the Tax Declarations Service. |
Result
See the Declaration type.
Example
The following mutation initiates a tax declaration, where:
- The declaration type is SAFT
- The declaration is for a monthly period (M)
- The declaration’s reporting period is 2025-01-01 through 2025-01-31.
- The audit file country is BG (Bulgaria)
- The region code is BG01 (Благоевград)
- The company’s tax accounting basis is A.
mutation initDecl($input: InitiateDeclarationInput) {
initiateDeclaration(input:$input) {
id
organization { id, tin, name }
representative { id, firstName, lastName }
declarationType
headerComment
taxAccountingBasis
from
to
files { id, fileType }
processes { id, status }
createdAt
}
}
{
"input": {
"declarationType": "SAFT",
"from": "2025-01-01",
"to": "2025-01-31",
"organizationId": "YOUR_ORGANIZATION_ID",
"representativeId": "YOUR_REPRESENTATIVE_ID",
"regionCode": "BG01",
"headerComment": "M",
"taxAccountingBasis": "A",
"auditFileCountry": "BG"
}
}
killProcess
Stops a declaration computation process if it is running.
Arguments
| Attribute | Type | Description |
|---|---|---|
| declarationId | ID! |
Mandatory. The identifier of the declaration. |
| processId | ID! |
Mandatory. The identifier of the process to be stopped. |
Result
See the Process type.
Example
The following mutation stops a running process.
mutation killProcess($declarationId:ID!, $processId:ID!) {
killProcess(declarationId:$declarationId, processId:$processId) {
id
status
errorMessages
result {
id
downloadUrl
createdAt
}
createdAt
}
}
{
"declarationId": "YOUR_DECLARATION_ID",
"processId": "YOUR_PROCESS_ID"
}
prepareFile
Generates a URL at which you can upload a CSV file to be used as input to the tax declaration. Run this mutation for each CSV file that is to be supplied as input for a declaration.
Arguments
| Attribute | Type | Description |
|---|---|---|
| input | PrepareFileInput |
Mandatory. Supplies the input to the mutation. |
PrepareFileInput input
| Attribute | Type | Description |
|---|---|---|
| declarationId | ID! |
Mandatory. The identifier of the declaration. |
| fileType | CsvFileType! |
Mandatory. This is an enumeration that identifies the type of the CSV file. Valid values: GeneralLedgerAccounts, BusinessPartners, Assets, PhysicalStock, GeneralLedgerEntries, Invoices, Payments, MovementOfGoods, AssetTransactions. |
| name | String |
Optional. Supplies the name of the CSV file. |
Result
See the File type.
Example
The following mutation generates the upload URL for a file of type “BusinessPartners”. The upload URL is set to expire after 300 seconds.
mutation prepareFile($input:PrepareFileInput!) {
prepareFile(input:$input) {
id
declarationId
fileType
name
uploadUrl(expiresIn:300)
createdAt
}
}
{
"input": {
"declarationId": "YOUR_DECLARATION_ID",
"fileType": "BusinessPartners"
}
}
updateDeclaration
Update certain declaration parameters.
Arguments
| Attribute | Type | Description |
|---|---|---|
| id | ID! |
Mandatory. The identifier of the declaration to be updated. |
| input | UpdateDeclarationInput |
Provides the input to the mutation, as UpdateDeclarationInput object. |
UpdateDeclarationInput input
| Attribute | Type | Description |
|---|---|---|
| from | Date! |
Mandatory. The start date of the reporting period covered by the tax declaration. |
| to | Date! |
Mandatory. The end date of the reporting period covered by the tax declaration. |
| representativeId | ID! |
Mandatory. The identifier of the representative previously created through the createRepresentative mutation. |
| regionCode | RegionCode! |
Mandatory. Identifies the region/county/province within the tax authority. For Romanian county codes, see Appendix 4: List of county codes (Romania). For Bulgarian county codes, see Appendix 5: List of county codes (Bulgaria). NOTE: The region code should belong to the country of the reporting organization (or to the auditFileCountry, if this argument was provided as input). |
| headerComment | HeaderComment! |
Mandatory. Specifies the reporting period covered by the declaration. L - for monthly returns, T - for quarterly returns, A - for annual returns, C - for returns on request, NL - non-residents monthly, NT - non-residents quarterly. |
| taxAccountingBasis | TaxAccountingBasis |
Optional. Specifies the tax accounting basis to be used for this declaration. If this argument is not provided, the tax accounting basis of the organization identified by organizationId will be used. If this argument is provided, it takes precedence over the tax accounting basis defined at organization level. For valid values, see Appendix 6: Tax Accounting Basis. |
| auditFileCountry | AuditFileCountryCode |
Optional, but recommended. Identifies the country (as a 2-letter country code) in which this tax declaration is reported. Valid values: RO, BG. It is recommended to set this parameter explicitly. Note that the combination of input auditFileCountry and taxAccountingBasis must be valid; otherwise, initiating the declaration will fail with an error. For valid auditFileCountry versus taxAccountingBasis combinations, see Appendix 7: Audit File Country vs Tax Accounting Basis. If auditFileCountry is not supplied, the value will be inferred from the country of the reporting organization, according to the rules in Appendix 8: Rules for inferring Audit File Country. |
Result
See the Declaration type.
Example
The following mutation updates the tax accounting basis of an existing declaration to A.
mutation updateDecl($id:ID!,$input:UpdateDeclarationInput) {
updateDeclaration(id:$id,input:$input) {
id
organization { id name tin }
representative { id firstName lastName phone email }
headerComment
declarationType
taxAccountingBasis
auditFileCountry
from
to
regionCode
files { id fileType }
processes { id status }
createdAt
}
}
{
"id": "YOUR_DECLARATION_ID",
"input": {
"taxAccountingBasis": "A"
}
}
updateRepresentative
Updates a previously created representative.
Arguments
| Attribute | Type | Description |
|---|---|---|
| id | ID! |
The identifier of the representative to be updated. |
| input | UpdateRepresentativeInput! |
Provides the input to the mutation, as UpdateRepresentativeInput object. |
UpdateRepresentativeInput input
| Attribute | Type | Description |
|---|---|---|
| firstName | String |
Optional. The first name of the representative. |
| lastName | String |
Optional. The last name of the representative. |
| phone | String |
Optional. The phone number of the representative. |
EmailAddress |
Optional. The representative’s email address. | |
| otherTitles | String |
Optional. The representative’s job title. Required for Bulgarian SAF-T. |
Result
See the Representative type.
Example
The following mutation updates a representative’s details.
mutation updateRepresentative($id:ID!, $input:UpdateRepresentativeInput!) {
updateRepresentative(id:$id, input: $input) {
id
firstName
lastName
email
phone
otherTitles
}
}
{
"id": "REPRESENTATIVE_ID",
"input": {
"firstName": "John",
"lastName": "Doe",
"phone": "999-999-999",
"email": "john.doe@example.org",
"otherTitles": "Accounting Manager"
}
}
Webhooks
The Tax Declarations Service supports webhooks. This means you can optionally configure SBS to send an HTTP POST request to an external server or application whenever any of the following events occur:
- COMPUTATION_SUCCESS - fires whenever a tax declaration was generated successfully.
- COMPUTATION_ERROR - fires whenever a tax declaration was generated with errors.
The POST request of the COMPUTATION_SUCCESS event has the following payload:
{
"service": "tax-declarations-api",
"event": "COMPUTATION_SUCCESS",
"tenantId": "<your-tenant-id>",
"payload": {
"declarationId": "<your-declaration-id>",
"processId": "<your-process-id>"
},
"customKey1": "Custom value 1",
"customKey2": "Custom value 2"
}
The POST request of the COMPUTATION_ERROR event has the following payload:
{
"service": "tax-declarations-api",
"event": "COMPUTATION_ERROR",
"tenantId": "<your-tenant-id>",
"payload": {
"declarationId": "<your-declaration-id>",
"processId": "<your-process-id>"
},
"customKey1": "Custom value 1",
"customKey2": "Custom value 2"
}
Note that the customKey1 and customValue1 will be present in the request body only if you configured them when creating the webhook. You may configure as many key-value pairs as required.
For information about configuring webhooks, see Webhooks.
Appendices
Appendix 1: Input CSV files (Romania Tax Residents)
When preparing the CSV files to be used as input to the Tax Declarations service, keep in mind the following:
- Each CSV file is comma-separated;
- The first row in the CSV file should provide the column names (that is, the CSV file must include the header);
- The fields described in the tables below are validated by ANAF according to the type described in the “Format” column. For details about each type, refer to the SAF-T Schema. More specifically, for simple types, you can find the validation rules in the “Simple Types” sheet. For the list of valid codes of various fields, consult the “Centralizator nomenclatoare” sheet.
GeneralLedgerAccounts.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| AccountDescription | SAFlongtextType | Yes | Name of the individual general ledger account. |
| StandardAccountID | SAFmiddle1textType | No | The general ledger code based on the standard defined by the Romanian authorities. This value is validated against codes present in the following nomenclatures (sheets) of the SAF-T Schema: PlanConturiBalSocCom, PlanConturiIFRS, PlanConturiIFRS_Norma39, PlanConturiBanci, PlanConturiNebancare, PlanConturiSocAsigurari, PlanConturi_Norma36. |
| AccountType | SAFshorttextType | Yes | Identifies the account type, in Romanian language. Valid values: Activ - Active, Pasiv - Passive, Bifunctional - Bifunctional. |
| OpeningDebitBalance | SAFmonetaryType | Yes | Debit balance at the start date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use OpeningDebitBalance and do not report OpeningCreditBalance - meaning the element will not be present in the XML file. |
| OpeningCreditBalance | SAFmonetaryType | Yes | Credit balance at the start date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use OpeningCreditBalance and do not report OpeningDebitBalance - meaning the element will not be present in the XML file. |
| ClosingDebitBalance | SAFmonetaryType | Yes | Debit balance at the end date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use ClosingDebitBalance and do not report ClosingCreditBalance - meaning the element will not be present in the XML file. |
| ClosingCreditBalance | SAFmonetaryType | Yes | Credit balance at the end date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use ClosingCreditBalance and do not report ClosingDebitBalance - meaning the element will not be present in the XML file. |
BusinessPartners.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| PartnerType | Char | Yes | This includes partner companies and physical persons (customers or suppliers) for which there is balance or turnover during the reporting period. Valid values: C - Customer, S - Supplier. |
| Id | Yes | The unique identifier of the company in the ERP system. | |
| Name | Yes | The name of the company. | |
| IsIndividual | Yes | If the customer or supplier is a physical person, this value must be 1. | |
| TaxRegistrationNumber | SAFmiddle1textType | Yes | The unique company’s Tax Registration Number as assigned by ANAF. For physical persons having Romanian citizenship, this is the Romanian personal numeric code (in Romanian, CNP). For foreign citizens residing in Romania, this is the fiscal identification number assigned by ANAF (in Romanian, NIF - Număr de identificare fiscală). For non-residents, this is the fiscal identification number of the person in their home country. Furthermore, to indicate that a business partner is an embassy, populate this value with the fiscal identification number (in Romanian, NIF - număr de identificare fiscală) of the embassy, prefixed by the 2-digit foreign country code. For example, US9000111111111. |
| StreetName | SAFmiddle2textType | No | The company’s address line 1. Typically, this is the street name and postal code. May also include the house number. |
| AdditionalAddressDetail | SAFmiddle2textType | No | The company’s address line 2. |
| City | SAFmiddle1textType | Yes | The city name. |
| PostalCode | SAFshorttextType | No | The postal code. |
| Region | SAFmiddle1textType | Yes | Identifies the district/county code. For example, IF - Ilfov. |
| Country | ISOCountryCode | Yes | ISO 3166-2 country code. For example, RO - Romania. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| OpeningDebitBalance | SAFmonetaryType | Yes | Debit balance at the start date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use OpeningDebitBalance and do not report OpeningCreditBalance - meaning the element will not be present in the XML file. |
| OpeningCreditBalance | SAFmonetaryType | Yes | Credit balance at the start date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use OpeningCreditBalance and do not report OpeningDebitBalance - meaning the element will not be present in the XML file. |
| ClosingDebitBalance | SAFmonetaryType | Yes | Debit balance at the end date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use ClosingDebitBalance and do not report ClosingCreditBalance - meaning the element will not be present in the XML file. |
| ClosingCreditBalance | SAFmonetaryType | Yes | Credit balance at the end date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use ClosingCreditBalance and do not report ClosingDebitBalance - meaning the element will not be present in the XML file. |
GeneralLedgerEntries.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| JournalID | SAFshorttextType | Yes | Source GL journal identifier, or invoices and payments in single ledger systems. |
| JournalDescription | SAFlongtextType | Yes | Description of the journal. |
| TransactionID | SAFmiddle2textType | Yes | Cross-reference to the GL posting. It can contain many different levels to identify the transaction. It may include cost centres such as company, division, region, group and branch/department. |
| Period | nonNegativeInteger | Yes | The accounting period (that is, the month of the year). For example, 1 for January. |
| PeriodYear | nonNegativeInteger | Yes | The year of the accounting period. Must be equal to or greater than 2020 and less than or equal to the current year. |
| TransactionDate | Date | Yes | Document’s date. |
| SourceID | SAFmiddle1textType | No | Details of the person or application that entered the transaction. |
| Description | SAFlongtextType | Yes | Description of journal transaction. |
| SystemEntryDate | Date | Yes | Date captured by the system. This field is validated according to ISO 8601 (YYYY-MM-DD). |
| GLPostingDate | Date | Yes | Date of posting to GL. This field is validated according to ISO 8601 (YYYY-MM-DD). |
| CustomerID | SAFmiddle1textType | No | Identifies the customer company/organization. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. This field is mutually exclusive with CustomerID. If the value is empty in both fields, the customer is assumed to be the reporting organization (this is useful for reporting self-billing invoices to own organization). |
| SupplierID | SAFmiddle1textType | No | Identifies the supplier company/organization. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. This field is mutually exclusive with SupplierID. If the value is empty in both fields, the supplier is assumed to be the reporting organization (this is useful for reporting self-billing invoices to own organization). |
| SystemID | SAFshorttextType | Yes | Unique number created by the system for the document. |
| RecordID | SAFshorttextType | Yes | Identifier to trace entry to journal line or posting reference. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| DebitAmount | SAFmonetaryType | Yes | Debit amount information for transaction. The debit amount may be positive or negative, to reflect the storno in black ink. Negative amounts are prefixed with the minus („-”) sign. If the transaction line is debit, use DebitAmount and don’t report CreditAmount - meaning the item is not reported (will not be present in the XML file). |
| DebitCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| DebitCurrencyAmount | SAFmonetaryType | No | Amount in foreign currency. Decimal number with two decimals separated by decimal point sign („ . ”). This amount may be positive or negative. Negative amounts are prefixed with the minus („-”) sign". |
| DebitExchangeRate | SAFexchangerateType | Yes | The exchange rate used for debit amount. DebitCurrencyAmount x DebitExchangeRate = DebitAmount. |
| CreditAmount | SAFmonetaryType | Yes | Credit amount information for transaction. The credit amount may be positive or negative, to reflect the storno în black ink. Negative amounts are prefixed with the minus („-”) sign. If the transaction line is credit, use CreditAmount and don’t report DebitAmount - meaning the item is not reported (will not be present in the XML file). |
| CreditCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| CreditCurrencyAmount | SAFmonetaryType | No | Amount in foreign currency. Decimal number with two decimals separated by decimal point sign („ . ”). This amount may be positive or negative. Negative amounts are prefixed with the minus („-”) sign". |
| CreditExchangeRate | SAFexchangerateType | No | The exchange rate used for credit amount. CreditCurrencyAmount x CreditExchangeRate = CreditAmount. |
| TaxType | SAFcodeType | Yes | For the list of valid values, consult the “Tax-IMP - Impozite” sheet of the SAF-T Schema. If the transaction is not relevant to be reported for tax, use TaxType = 000 and TaxCode = 000000. |
| TaxCode | SAFcodeType | Yes | The codes used to fill in the TaxCode are in the specific nomenclature according to the sheet “Legenda coduri taxa” of the SAF-T Schema: (i) Livrari, (ii) Achizitii ded 100%, (iii) Achizitii ded 50%_baserate, (iv) Achizitii ded 50%_not_know, (v) Achizitii ded 50%, (vi) Achizitii neded, (vii) Achizitii base rate, (viii) Achizitii not known, (ix) WHT - nomenclator, (x) TVA_NoteContabile, (xi) Achizitii neded 50%. If the tax type is other than VAT or WHT, use 000000. |
| TaxPercentage | Decimal | No | The tax percentage. |
| TaxBase | Decimal | No | The base on which the tax is calculated. This can be an amount. |
| TaxAmount | SAFmonetaryType | Yes | Tax amount information. |
| TaxCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| TaxCurrencyAmount | SAFmonetaryType | No | Tax amount in foreign currency. |
| TaxExchangeRate | SAFexchangerateType | No | The exchange rate used for tax. |
Invoices.csv
If the reporting organization needs to report self-billing invoices (autofactura) to itself, use either of the following ses, set InvoiceType to 389.
Option 1 — Set the customer to the company’s own Tax Registration Number (TIN):
- Set
CustomerIDto the reporting company’s own TIN, and leaveSupplierIDempty. A leadingROprefix is optional and ignored when matching, so bothRO12345678and12345678are accepted. - This form is recognized only when
InvoiceTypeis 389. ACustomerIDequal to the company TIN on any other invoice type is still rejected, because the TIN does not correspond to a business partner of type C.
Option 2 — Leave the customer and supplier empty:
- Set both
CustomerIDandSupplierIDto an empty value. When both values are empty, the system considers the reporting organization to be the customer (or supplier, depending on the case). - Set
SelfBillingIndicatorto 389. - For all movements having the same
TransactionIDin the GeneralLedgerEntries.csv file, ensure that bothCustomerIDandSupplierIDalso have an empty value.
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| InvoiceNo | SAFmiddle2textType | Yes | The invoice number. |
| CustomerID | No | The ID of the customer on the invoice. To be filled only for sales invoices. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. This field is mutually exclusive with SupplierID. If the value is empty in both fields, the customer is assumed to be the reporting organization (this is useful for reporting self-billing invoices to own organization). Alternatively, for a self-billing invoice (InvoiceType 389), set this value to the reporting company’s own Tax Registration Number; see the note above this table. |
|
| SupplierID | No | The ID of the supplier on the invoice. To be filled only for purchase invoices. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. This field is mutually exclusive with CustomerID. If the value is empty in both fields, the supplier is assumed to be the reporting organization (this is useful for reporting self-billing invoices to own organization). |
|
| AccountID | Yes | The general ledger code used by the reporting company in their ERP. | |
| InvoiceDate | Date | Yes | Date of the invoice. Validated according to ISO 8601 (YYYY-MM-DD). |
| InvoiceType | SAFcodeType | Yes | Specifies the type of the invoice. Valid values: 380 - Commercial invoice, 381 - Credit note, 384 - Corrected invoice, 389 - Self-billed invoice, 575 - Insurer’s invoice, 751 - Invoice information for accounting purposes. These values originate from the sheet Nom_Tipuri_facturi of the SAF-T Schema. |
| SelfBillingIndicator | SAFcodeType | Yes | Indicator showing if the invoice is a self-billed invoice. Valid values: 389 - Self-billed invoice, 0 - Not a self-billed invoice. |
| SystemID | SAFmiddle1textType | Yes | Unique number created by the system for the document. |
| TransactionID | SAFmiddle2textType | No | Cross-reference to GL posting. It can contain many different levels to identify the transaction. It may include cost centres such as company, division, region, group and branch/department. |
| MasterTaxBase | Decimal | No | The base on which tax is calculated, for the whole invoice. |
| MasterTaxAmount | SAFmonetaryType | Yes | The tax amount information, for the whole invoice. |
| MasterTaxCurrencyCode | ISOCurrencyCode | No | The currency in which tax is calculated, for the whole invoice. This is a three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| MasterTaxCurrencyAmount | SAFmonetaryType | No | The tax amount in foreign currency, if applicable. |
| MasterTaxExchangeRate | SAFexchangerateType | No | The exchange rate used, if applicable. |
| MasterNetTotal | SAFmonetaryType | Yes | The net total amount of the invoice. |
| MasterGrossTotal | SAFmonetaryType | Yes | The gross total amount of the invoice. |
| LineNumber | SAFshorttextType | No | The invoice line number. |
| LineAccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| GoodsServicesID | SAFcodeType | No | Indicator showing if goods or services are being reported. Valid values: 01 - Goods, 02 - Services. |
| ProductCode | SAFmiddle2textType | No | The product code. |
| Description | SAFlongtextType | Yes | The description of goods or services that are being reported. To be filled according to the description in taxpayer’s ERP system. |
| ProductCommodityCode | SAFmiddle1textType | Yes | The CN (NC - Nomenclatură Combinată) code must be reported in accordance wih Romanian legislation, especially in cases such as: (i) import/export transactions, (ii) purchase/delivery of food products subject to reduced VAT rate based on CN code, (iii) movements within EU that are subject to INTRASTAT reporting, (iv) purchases/deliveries subject to local reverse charge VAT according to CN code, (v) transactions in excisable products for which excise duty is determined by CN code. The CN code contains eight digits. For valid values, see the NC8_2022_TARIC3 nomenclature in the SAF-T Schema. For insurance companies, also use the codes from the Nom_asig nomenclature. If the CN code is not applicable or required according to the Romanian law, fill in this field with value 0 (zero). |
| ValuationMethod | SAFcodeType | No | The valuation method employed. Valid values: FIFO (First-In, First-Out), LIFO (Last-In, First-Out), Cost mediu (Weighted average cost). |
| UOMBase | SAFcodeType | Yes | The unit of measure to manage stock for this product. For valid values, see the Unitati_masura sheet of the SAF-T Schema. |
| Quantity | SAFquantityType | Yes | The quantity of goods or services supplied. |
| UnitPrice | SAFmonetaryType | Yes | Unit price for the unit/group of units per UOM in the header’s default currency. Decimal number with two decimals separated by decimal point sign („ . ”). For approximations, use the rounding rules according to Order no. 978 from 8 July 2005 of the Romanian Ministry of Finance. |
| LineDescription | SAFlongtextType | Yes | Description of the invoice line. The maximum allowed length is 256 characters. If any CSV row exceeds 256 characters, the value will be truncated to 256 characters only in the SAF-T XML file. |
| InvoiceLineAmount | SAFmonetaryType | Yes | The amount of the invoice line. |
| InvoiceLineCurrencyCode | ISOCurrencyCode | No | The currency code of the invoice line, if applicable. |
| InvoiceLineCurrencyAmount | SAFmonetaryType | No | The invoice line amount in foreign currency, if applicable. |
| InvoiceLineExchangeRate | SAFexchangerateType | No | The exchange rate used, if applicable. |
| DebitCreditIndicator | SAFcodeType | Yes | Indicates whether the amounts on line level are debit or credit amounts. This entry must correspond to the entry reflected in General Ledger. Signing of line amounts is relative to this indicator. For example, a return can lead to a negative amount. Valid values: C - Credit, D - Debit. |
| TaxType | SAFcodeType | Yes | For the list of valid values, consult the “Tax-IMP - Impozite” sheet of the SAF-T Schema. If the transaction is not relevant to be reported for tax, use TaxType = 000 and TaxCode = 000000. |
| TaxCode | SAFcodeType | Yes | The codes used to fill in the TaxCode are in the specific nomenclature according to the sheet “Legenda coduri taxa” of the SAF-T Schema: (i) Livrari, (ii) Achizitii ded 100%, (iii) Achizitii ded 50%_baserate, (iv) Achizitii ded 50%_not_know, (v) Achizitii ded 50%, (vi) Achizitii neded, (vii) Achizitii base rate, (viii) Achizitii not known, (ix) WHT - nomenclator, (x) TVA_NoteContabile, (xi) Achizitii neded 50%. If the tax type is other than VAT or WHT, use 000000. |
| TaxPercentage | Decimal | No | The tax percentage. |
| TaxBase | Decimal | No | The base on which the tax is calculated. This can be an amount. |
| TaxAmount | SAFmonetaryType | Yes | Tax amount information. |
| TaxCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| TaxCurrencyAmount | SAFmonetaryType | No | Tax amount in foreign currency. |
| TaxExchangeRate | SAFexchangerateType | No | The exchange rate used for tax. |
Payments.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| PaymentRefNo | SAFmiddle1textType 35 | Yes | The unique reference number of the payment. |
| Period | nonNegativeInteger | No | The accounting period (that is, the month of the year). For example, 1 for January. |
| PeriodYear | nonNegativeInteger | No | The year of the accounting period. Must be equal to or greater than 2020 and less than or equal to the current year. |
| TransactionID | SAFmiddle2textType | No | Cross-reference to GL posting. It can contain many different levels to identify the transaction. It may include cost centres such as company, division, region, group and branch/department. |
| TransactionDate | Date | Yes | Document date. |
| PaymentMethod | Yes | Identifies the payment method (cheque, bank, giro, cash etc). For validation, refer to the nomenclature Nom_Mecanisme_plati of the SAF-T Schema. | |
| Description | SAFlongtextType | Yes | Description of the payment. |
| SystemID | SAFmiddle1textType | Yes | Unique number created by the system for the document. |
| LineNumber | SAFshorttextType | No | Number of the payment line. |
| SourceDocumentID | SAFmiddle1textType | No | The source document to which the line relates. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| CustomerID | SAFmiddle1textType | Yes | Identifies the customer company/organization. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| SupplierID | SAFmiddle1textType | Yes | Identifies the supplier company/organization. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| DebitCreditIndicator | SAFcodeType | Yes | Indicates whether the amounts on line level are debit or credit amounts. This entry must correspond to the entry reflected in General Ledger. Signing of line amounts is relative to this indicator. For example, a return can lead to a negative amount. Valid values: C - Credit, D - Debit. |
| PaymentLineAmount | SAFmonetaryType | Yes | The amount of the payment line. |
| PaymentLineCurrencyCode | ISOCurrencyCode | No | The currency code of the payment line, if applicable. |
| PaymentLineCurrencyAmount | SAFmonetaryType | No | The payment line amount in foreign currency, if applicable. |
| PaymentLineExchangeRate | SAFexchangerateType | No | The exchange rate used, if applicable. |
| TaxType | SAFcodeType | Yes | For the list of valid values, consult the “Tax-IMP - Impozite” sheet of the SAF-T Schema. If the transaction is not relevant to be reported for tax, use TaxType = 000 and TaxCode = 000000. |
| TaxCode | SAFcodeType | Yes | The codes used to fill in the TaxCode are in the specific nomenclature according to the sheet “Legenda coduri taxa” of the SAF-T Schema: (i) Livrari, (ii) Achizitii ded 100%, (iii) Achizitii ded 50%_baserate, (iv) Achizitii ded 50%_not_know, (v) Achizitii ded 50%, (vi) Achizitii neded, (vii) Achizitii base rate, (viii) Achizitii not known, (ix) WHT - nomenclator, (x) TVA_NoteContabile, (xi) Achizitii neded 50%. If the tax type is other than VAT or WHT, use 000000. |
| TaxPercentage | Decimal | No | The tax percentage. |
| TaxBase | Decimal | No | The base on which the tax is calculated. This can be an amount. |
| TaxAmount | SAFmonetaryType | Yes | Tax amount information. |
| TaxCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| TaxCurrencyAmount | SAFmonetaryType | No | Tax amount in foreign currency. |
| TaxExchangeRate | SAFexchangerateType | No | The exchange rate used for tax. |
PhysicalStock.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| WarehouseID | SAFmiddle1textType | Yes | Warehouse where goods are held. May also be used to identify production under way, or stock in transit. |
| ProductCode | SAFmiddle2textType | Yes | The product code. |
| ProductType | SAFshorttextType | Yes | The product type. Used to determine whether the product or stock account is raw material, work-in-progress, finished good, merchandise for resale, etc. |
| StockAccountCommodityCode | SAFmiddle1textType | Yes | The commodity code associated with the stock account. For valid values, see the NC8_2022_TARIC3 nomenclature in the SAF-T Schema. |
| OwnerID | SAFmiddle1textType | Yes | Identifies the owner of the stock. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| GoodsServicesID | SAFcodeType | No | Indicator showing if goods or services are being reported. Valid values: 01 - Goods, 02 - Services. |
| Description | SAFlongtextType | Yes | Description of goods or services. |
| ProductCommodityCode | Yes | The commodity code associated with the product. For valid values, see the NC8_2022_TARIC3 nomenclature in the SAF-T Schema. | |
| ValuationMethod | SAFcodeType | No | The valuation method employed. Valid values: FIFO (First-In, First-Out), LIFO (Last-In, First-Out), Cost mediu (Weighted average cost). |
| UOMBase | SAFcodeType | Yes | The unit of measure used to manage product stocks. For valid values, see the Unitati_masura nomenclature in the SAF-T Schema. |
| OpeningStockQuantity | SAFquantityType | Yes | The quantity of stock at the start date of the reporting period. |
| OpeningStockValue | SAFmonetaryType | Yes | The stock value at the start date of the reporting period, in the header’s currency. |
| ClosingStockQuantity | SAFquantityType | Yes | The quantity of stock at the end date of the reporting period. |
| ClosingStockValue | SAFmonetaryType | Yes | The stock value at the end date of the reporting period, in the header’s currency. |
| UnitPrice | SAFmonetaryType | Yes | Base unit price in the header’s default currency. |
MovementOfGoods.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| MovementReference | SAFmiddle1textType | Yes | Unique reference to the movement. |
| MovementDate | Date | Yes | Document date. Validated according to ISO 8601 standard (YYYY-MM-DD). |
| MovementType | SAFcodeType | Yes | The type of the process for the underlying lines. For example: production, sales, purchase, etc. Validated according to the Nomenclator stocuri nomenclature of the SAF-T Schema. |
| DocumentType | SAFshorttextType | Yes | The source document type for the respective movement. |
| DocumentNumber | SAFmiddle1textType | Yes | The source document number for the respective movement. |
| DocumentLine | SAFshorttextType | No | The line number in the source document for the respective movement. |
| LineNumber | SAFshorttextType | Yes | The number of the movement line. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| CustomerID | SAFmiddle1textType | Yes | Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| SupplierID | SAFmiddle1textType | Yes | Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| ProductCode | SAFmiddle2textType | Yes | The product code. |
| GoodsServicesID | SAFcodeType | No | Indicator showing if goods or services are being reported. Valid values: 01 - Goods, 02 - Services. |
| Description | SAFlongtextType | Yes | Description of goods or services. |
| ProductCommodityCode | SAFmiddle1textType | Yes | The commodity code associated with the product. For valid values, see the NC8_2022_TARIC3 nomenclature in the SAF-T Schema. |
| ValuationMethod | SAFcodeType | No | The valuation method employed. Valid values: FIFO (First-In, First-Out), LIFO (Last-In, First-Out), Cost mediu (Weighted average cost). |
| UOMBase | SAFcodeType | Yes | The unit of measure used. For valid values, see the Unitati_masura nomenclature in the SAF-T Schema. |
| Quantity | SAFquantityType | Yes | The quantity of goods. |
| BookValue | SAFmonetaryType | No | Value of the transaction line as registered in the general ledger in the header’s default currency. |
| MovementSubType | SAFcodeType | Yes | Identifies the type of the movement on line/article level. For valid values, see the Nomenclator stocuri nomenclature of the SAF-T Schema. |
Assets.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| AssetID | SAFmiddle1textType | Yes | The unique identifier of the asset. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| Description | SAFlongtextType | Yes | The asset description. |
| DateOfAcquisition | Date | Yes | Date of the acquisition of the asset (usually the date of delivery). Validated according to ISO 8601 standard (YYYY-MM-DD). |
| StartUpDate | Date | Yes | Commissioning date of the asset. Validated according to ISO 8601 standard (YYYY-MM-DD). |
| SupplierID | SAFmiddle1textType | Yes | Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| AssetValuationType | SAFshorttextType | Yes | Describes the purpose for the reporting. For example: commercial, tax in country 1, tax in country 2, etc. |
| ValuationClass | SAFshorttextType | Yes | Describes the classification of the asset for tax reporting purposes. |
| AcquisitionAndProductionCostsBegin | SAFmonetaryType | Yes | Total costs of the acquisition and/or production of the asset at the start date of the reporting period, in the header’s default currency. |
| AcquisitionAndProductionCostsEnd | SAFmonetaryType | Yes | Total costs of the acquisition and/or production of the asset at the end date of the reporting period, in the header’s default currency. |
| InvestmentSupport | SAFmonetaryType | Yes | Total amount of investment support for this asset in the header’s default currency (that is, the amount of increase in value of the assets due to reconstruction, overhaul, etc). |
| AssetLifeYear | Decimal | Yes | Period of useful life in years. This field is mutually exclusive with AssetLifeMonth. |
| AssetLifeMonth | Decimal | Yes | Period of useful life in months. This field is mutually exclusive with AssetLifeYear. |
| AssetAddition | SAFmonetaryType | Yes | The accounting (book) value of the acquisition and/or production of the asset in the reporting period, in the header’s default currency. |
| Transfers | SAFmonetaryType | Yes | The accounting (book) value of the transfers of the asset during the reporting period, in the header’s default currency. |
| AssetDisposal | SAFmonetaryType | Yes | The accounting (book) value of the disposals of the asset during the reporting period in the header’s default currency. |
| BookValueBegin | SAFmonetaryType | Yes | The accounting (book) value at the beginning of the reporting period, in the header’s default currency. |
| DepreciationMethod | SAFmiddle1textType | Yes | Method of normal depreciation of the asset during the reporting period. |
| DepreciationPercentage | Decimal | Yes | The rate of the normal depreciation of the asset per year or month (this depends on whether AssetLifeYear or AssetLifeMonth is reported). |
| DepreciationForPeriod | SAFmonetaryType | Yes | The total amount of normal depreciation during the reporting period, in the header’s default currency. |
| AppreciationForPeriod | SAFmonetaryType | Yes | The total amount of appreciation of the asset during the reporting period, in the header’s default currency. |
| AccumulatedDepreciation | SAFmonetaryType | Yes | Total amount of depreciation for this asset. |
| BookValueEnd | SAFmonetaryType | Yes | The accounting (book) value at the end of the reporting period, in the header’s default currency. |
| ExtraordinaryDepreciationMethod | SAFmiddle1textType | Yes | Method of extraordinary depreciation of the asset during the reporting period. |
| ExtraordinaryDepreciationAmountForPeriod | SAFmonetaryType | Yes | The amount of extraordinary depreciation of the asset during the reporting period, in the header’s default currency. |
AssetTransactions.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| AssetTransactionID | SAFmiddle2textType | Yes | The unique identifier of the transaction. |
| AssetTransactionType | SAFcodeType | Yes | The transaction type. Validated according to the nomenclature Nomenclator imobilizari of the SAF-T Schema. |
| AssetTransactionDate | Date | Yes | The logged date of the transaction. Validated according to ISO 8601 standard (YYYY-MM-DD). |
| TransactionID | SAFmiddle2textType | Yes | Cross reference to the GL posting in the journal. It can contain many different levels to identify the transaction. It may include cost centres such as company, division, region, group and branch/department. |
| AcquisitionAndProductionCostOnTransaction | SAFmonetaryType | Yes | Costs of acquisition and/or production of the related asset transaction, in the header’s default currency on the date of transaction. |
| BookValueOnTransaction | SAFmonetaryType | Yes | The accounting (book) value of the related asset transaction, in the header’s default currency on the date of transaction. |
| AssetTransactionAmount | SAFmonetaryType | Yes | The net amount of the related asset transaction, in the header’s default currency (for instance, the net sale revenue). |
| AssetID | SAFmiddle1textType | Yes | The unique identifier of the asset. |
Appendix 2: Input CSV files (Romania Non-Residents)
To submit a non-residents tax declaration for Romanian tax authorities, the input parameters must be set as follows:
auditFileCountryshould be ROtaxAccountingBasisshould be I.headerCommentshould be NL or NT.
For such declarations, the following input CSV file types are required:
- GeneralLedgerAccounts
- BusinessPartners
- Invoices
The files may be empty (i.e., contain only the header) if no business activity took place within the reported period.
When preparing the CSV files to be used as input to the Tax Declarations service, keep in mind the following:
- Each CSV file is comma-separated;
- The first row in the CSV file should provide the column names (that is, the CSV file must include the header);
- The fields described in the tables below are validated by ANAF according to the type described in the “Format” column. For details about each type, refer to the SAF-T Schema. More specifically, for simple types, you can find the validation rules in the “Simple Types” sheet. For the list of valid codes of various fields, consult the “Centralizator nomenclatoare” sheet.
GeneralLedgerAccounts.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| AccountDescription | SAFlongtextType | Yes | Name of the individual general ledger account. |
| StandardAccountID | SAFmiddle1textType | No | The general ledger code based on the standard defined by the Romanian authorities. This value is validated against codes present in the following nomenclatures (sheets) of the SAF-T Schema: PlanConturiBalSocCom, PlanConturiIFRS, PlanConturiIFRS_Norma39, PlanConturiBanci, PlanConturiNebancare, PlanConturiSocAsigurari, PlanConturi_Norma36. |
| AccountType | SAFshorttextType | Yes | Identifies the account type, in Romanian language. Valid values: Activ - Active, Pasiv - Passive, Bifunctional - Bifunctional. |
| OpeningDebitBalance | SAFmonetaryType | Yes | Debit balance at the start date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use OpeningDebitBalance and do not report OpeningCreditBalance - meaning the element will not be present in the XML file. |
| OpeningCreditBalance | SAFmonetaryType | Yes | Credit balance at the start date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use OpeningCreditBalance and do not report OpeningDebitBalance - meaning the element will not be present in the XML file. |
| ClosingDebitBalance | SAFmonetaryType | Yes | Debit balance at the end date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use ClosingDebitBalance and do not report ClosingCreditBalance - meaning the element will not be present in the XML file. |
| ClosingCreditBalance | SAFmonetaryType | Yes | Credit balance at the end date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use ClosingCreditBalance and do not report ClosingDebitBalance - meaning the element will not be present in the XML file. |
BusinessPartners.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| PartnerType | Char | Yes | This includes partner companies and physical persons (customers or suppliers) for which there is balance or turnover during the reporting period. Valid values: C - Customer, S - Supplier. |
| Id | Yes | The unique identifier of the company in the ERP system. | |
| Name | Yes | The name of the company. | |
| IsIndividual | Yes | If the customer or supplier is a physical person, this value must be 1. | |
| TaxRegistrationNumber | SAFmiddle1textType | Yes | The unique company’s Tax Registration Number as assigned by ANAF. |
| StreetName | SAFmiddle2textType | No | The company’s address line 1. Typically, this is the street name and postal code. May also include the house number. |
| AdditionalAddressDetail | SAFmiddle2textType | No | The company’s address line 2. |
| City | SAFmiddle1textType | Yes | The city name. |
| PostalCode | SAFshorttextType | No | The postal code. |
| Region | SAFmiddle1textType | Yes | Identifies the district/county code. For example, IF - Ilfov. |
| Country | ISOCountryCode | Yes | ISO 3166-2 country code. For example, RO - Romania. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| OpeningDebitBalance | SAFmonetaryType | Yes | Debit balance at the start date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use OpeningDebitBalance and do not report OpeningCreditBalance - meaning the element will not be present in the XML file. |
| OpeningCreditBalance | SAFmonetaryType | Yes | Credit balance at the start date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use OpeningCreditBalance and do not report OpeningDebitBalance - meaning the element will not be present in the XML file. |
| ClosingDebitBalance | SAFmonetaryType | Yes | Debit balance at the end date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use ClosingDebitBalance and do not report ClosingCreditBalance - meaning the element will not be present in the XML file. |
| ClosingCreditBalance | SAFmonetaryType | Yes | Credit balance at the end date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use ClosingCreditBalance and do not report ClosingDebitBalance - meaning the element will not be present in the XML file. |
Invoices.csv
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| InvoiceNo | SAFmiddle2textType | Yes | The invoice number. |
| CustomerID | Yes | The ID of the customer on the invoice. To be filled only for sales invoices. This field is mutually exclusive with SupplierID. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
|
| SupplierID | Yes | The ID of the supplier on the invoice. To be filled only for purchase invoices. This field is mutually exclusive with CustomerID. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
|
| AccountID | Yes | The general ledger code used by the reporting company in their ERP. | |
| InvoiceDate | Date | Yes | Date of the invoice. Validated according to ISO 8601 (YYYY-MM-DD). |
| InvoiceType | SAFcodeType | Yes | Specifies the type of the invoice. Valid values: 380 - Commercial invoice, 381 - Credit note, 384 - Corrected invoice, 389 - Self-billed invoice, 575 - Insurer’s invoice, 751 - Invoice information for accounting purposes. These values originate from the sheet Nom_Tipuri_facturi of the SAF-T Schema. |
| SelfBillingIndicator | SAFcodeType | Yes | Indicator showing if the invoice is a self-billed invoice. Valid values: 389 - Self-billed invoice, 0 - Not a self-billed invoice. |
| SystemID | SAFmiddle1textType | Yes | Unique number created by the system for the document. |
| TransactionID | SAFmiddle2textType | No | Cross-reference to GL posting. It can contain many different levels to identify the transaction. It may include cost centres such as company, division, region, group and branch/department. |
| MasterTaxBase | Decimal | No | The base on which tax is calculated, for the whole invoice. |
| MasterTaxAmount | SAFmonetaryType | Yes | The tax amount information, for the whole invoice. |
| MasterTaxCurrencyCode | ISOCurrencyCode | No | The currency in which tax is calculated, for the whole invoice. This is a three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| MasterTaxCurrencyAmount | SAFmonetaryType | No | The tax amount in foreign currency, if applicable. |
| MasterTaxExchangeRate | SAFexchangerateType | No | The exchange rate used, if applicable. |
| MasterNetTotal | SAFmonetaryType | Yes | The net total amount of the invoice. |
| MasterGrossTotal | SAFmonetaryType | Yes | The gross total amount of the invoice. |
| LineNumber | SAFshorttextType | No | The invoice line number. |
| LineAccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| GoodsServicesID | SAFcodeType | No | Indicator showing if goods or services are being reported. Valid values: 01 - Goods, 02 - Services. |
| ProductCode | SAFmiddle2textType | No | The product code. |
| Description | SAFlongtextType | Yes | The description of goods or services that are being reported. To be filled according to the description in taxpayer’s ERP system. |
| ProductCommodityCode | SAFmiddle1textType | Yes | The CN (NC - Nomenclatură Combinată) code must be reported in accordance wih Romanian legislation, especially in cases such as: (i) import/export transactions, (ii) purchase/delivery of food products subject to reduced VAT rate based on CN code, (iii) movements within EU that are subject to INTRASTAT reporting, (iv) purchases/deliveries subject to local reverse charge VAT according to CN code, (v) transactions in excisable products for which excise duty is determined by CN code. The CN code contains eight digits. For valid values, see the NC8_2022_TARIC3 nomenclature in the SAF-T Schema. For insurance companies, also use the codes from the Nom_asig nomenclature. If the CN code is not applicable or required according to the Romanian law, fill in this field with value 0 (zero). |
| ValuationMethod | SAFcodeType | No | The valuation method employed. Valid values: FIFO (First-In, First-Out), LIFO (Last-In, First-Out), Cost mediu (Weighted average cost). |
| UOMBase | SAFcodeType | Yes | The unit of measure to manage stock for this product. For valid values, see the Unitati_masura sheet of the SAF-T Schema. |
| Quantity | SAFquantityType | Yes | The quantity of goods or services supplied. |
| UnitPrice | SAFmonetaryType | Yes | Unit price for the unit/group of units per UOM in the header’s default currency. Decimal number with two decimals separated by decimal point sign („ . ”). For approximations, use the rounding rules according to Order no. 978 from 8 July 2005 of the Romanian Ministry of Finance. |
| LineDescription | SAFlongtextType | Yes | Description of the invoice line. |
| InvoiceLineAmount | SAFmonetaryType | Yes | The amount of the invoice line. |
| InvoiceLineCurrencyCode | ISOCurrencyCode | No | The currency code of the invoice line, if applicable. |
| InvoiceLineCurrencyAmount | SAFmonetaryType | No | The invoice line amount in foreign currency, if applicable. |
| InvoiceLineExchangeRate | SAFexchangerateType | No | The exchange rate used, if applicable. |
| DebitCreditIndicator | SAFcodeType | Yes | Indicates whether the amounts on line level are debit or credit amounts. This entry must correspond to the entry reflected in General Ledger. Signing of line amounts is relative to this indicator. For example, a return can lead to a negative amount. Valid values: C - Credit, D - Debit. |
| TaxType | SAFcodeType | Yes | For the list of valid values, consult the “Tax-IMP - Impozite” sheet of the SAF-T Schema. If the transaction is not relevant to be reported for tax, use TaxType = 000 and TaxCode = 000000. |
| TaxCode | SAFcodeType | Yes | The codes used to fill in the TaxCode are in the specific nomenclature according to the sheet “Legenda coduri taxa” of the SAF-T Schema: (i) Livrari, (ii) Achizitii ded 100%, (iii) Achizitii ded 50%_baserate, (iv) Achizitii ded 50%_not_know, (v) Achizitii ded 50%, (vi) Achizitii neded, (vii) Achizitii base rate, (viii) Achizitii not known, (ix) WHT - nomenclator, (x) TVA_NoteContabile, (xi) Achizitii neded 50%. If the tax type is other than VAT or WHT, use 000000. |
| TaxPercentage | Decimal | No | The tax percentage. |
| TaxBase | Decimal | No | The base on which the tax is calculated. This can be an amount. |
| TaxAmount | SAFmonetaryType | Yes | Tax amount information. |
| TaxCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| TaxCurrencyAmount | SAFmonetaryType | No | Tax amount in foreign currency. |
| TaxExchangeRate | SAFexchangerateType | No | The exchange rate used for tax. |
Appendix 3: Input CSV files (Bulgaria Tax Residents)
When preparing the CSV files to be used as input to the Tax Declarations service, keep in mind the following:
- Each CSV file is comma-separated;
- The first row in the CSV file should provide the column names (that is, the CSV file must include the header);
GeneralLedgerAccounts.csv (BG)
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| AccountDescription | SAFlongtextType | Yes | Name of the individual general ledger account. |
| StandardAccountID | SAFmiddle1textType | No | The general ledger code based on the standard defined by the Bulgarian National Revenue Agency. This value is validated against codes present in the SAF-T Schema. |
| AccountType | SAFshorttextType | Yes | Identifies the account type. Valid values: Active, Passive, Bifunctional. |
| OpeningDebitBalance | SAFmonetaryType | Yes | Debit balance at the start date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use OpeningDebitBalance and do not report OpeningCreditBalance - meaning the element will not be present in the XML file. |
| OpeningCreditBalance | SAFmonetaryType | Yes | Credit balance at the start date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use OpeningCreditBalance and do not report OpeningDebitBalance - meaning the element will not be present in the XML file. |
| ClosingDebitBalance | SAFmonetaryType | Yes | Debit balance at the end date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use ClosingDebitBalance and do not report ClosingCreditBalance - meaning the element will not be present in the XML file. |
| ClosingCreditBalance | SAFmonetaryType | Yes | Credit balance at the end date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use ClosingCreditBalance and do not report ClosingDebitBalance - meaning the element will not be present in the XML file. |
BusinessPartners.csv (BG)
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| PartnerType | Char | Yes | This includes partner companies and physical persons (customers or suppliers) for which there is balance or turnover during the reporting period. Valid values: C - Customer, S - Supplier. |
| Id | Yes | The unique identifier of the company in the ERP system. | |
| Name | Yes | The name of the company. | |
| IsIndividual | Yes | If the customer or supplier is a physical person, this value must be 1. | |
| TaxRegistrationNumber | SAFmiddle1textType | Yes | The unique company’s Tax Registration Number as assigned by Bulgarian National Revenue Agency (НАП). |
| StreetName | SAFmiddle2textType | No | The company’s address line 1. Typically, this is the street name and postal code. May also include the house number. |
| AdditionalAddressDetail | SAFmiddle2textType | No | The company’s address line 2. |
| City | SAFmiddle1textType | Yes | The city name. |
| PostalCode | SAFshorttextType | No | The postal code. |
| Region | SAFmiddle1textType | No | Identifies the region code. For example, BG-04 - Велико Търново. See Appendix 5: List of region codes (Bulgaria). |
| Country | ISOCountryCode | Yes | ISO 3166-2 country code. For example, BG - Bulgaria. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| OpeningDebitBalance | SAFmonetaryType | Yes | Debit balance at the start date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use OpeningDebitBalance and do not report OpeningCreditBalance - meaning the element will not be present in the XML file. |
| OpeningCreditBalance | SAFmonetaryType | Yes | Credit balance at the start date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use OpeningCreditBalance and do not report OpeningDebitBalance - meaning the element will not be present in the XML file. |
| ClosingDebitBalance | SAFmonetaryType | Yes | Debit balance at the end date of the selection period in the header’s default currency. The total of the debit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a debit, use ClosingDebitBalance and do not report ClosingCreditBalance - meaning the element will not be present in the XML file. |
| ClosingCreditBalance | SAFmonetaryType | Yes | Credit balance at the end date of the selection period in the header’s default currency. The total of the credit amounts may be positive or negative. Negative amounts are prefixed with the minus („-”) sign. If the account is created with a credit, use ClosingCreditBalance and do not report ClosingDebitBalance - meaning the element will not be present in the XML file. |
| RelatedParty | SAFcodeType | No | Determines whether the company is a related party. Valid values: Y, N. |
| RelatedPartyStartDate | Date | No | Date (YYYY-MM-DD) starting from which the company is a related party. |
| RelatedPartyEndDate | Date | No | Date (YYYY-MM-DD) up to which the company is a related party. |
| SelfBillingIndicator | SAFcodeType | No | An indicator showing whether there is a self-billing agreement between the customer and the supplier. Valid values: Y, N. |
GeneralLedgerEntries.csv (BG)
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| JournalID | SAFshorttextType | Yes | Source GL journal identifier, or invoices and payments in single ledger systems. |
| JournalDescription | SAFlongtextType | Yes | Description of the journal. |
| TransactionID | SAFmiddle2textType | Yes | Cross-reference to the GL posting. It can contain many different levels to identify the transaction. It may include cost centres such as company, division, region, group and branch/department. |
| Period | nonNegativeInteger | Yes | The accounting period (that is, the month of the year). For example, 1 for January. |
| PeriodYear | nonNegativeInteger | Yes | The year of the accounting period. Must be equal to or greater than 2020 and less than or equal to the current year. |
| TransactionDate | Date | Yes | Document’s date. |
| SourceID | SAFmiddle1textType | No | Details of the person or application that entered the transaction. |
| Description | SAFlongtextType | Yes | Description of journal transaction. |
| SystemEntryDate | Date | Yes | Date captured by the system. This field is validated according to ISO 8601 (YYYY-MM-DD). |
| GLPostingDate | Date | Yes | Date of posting to GL. This field is validated according to ISO 8601 (YYYY-MM-DD). |
| CustomerID | SAFmiddle1textType | No | Identifies the customer company/organization. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| SupplierID | SAFmiddle1textType | No | Identifies the supplier company/organization. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| SystemID | SAFshorttextType | Yes | Unique number created by the system for the document. |
| RecordID | SAFshorttextType | Yes | Identifier to trace entry to journal line or posting reference. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| DebitAmount | SAFmonetaryType | Yes | Debit amount information for transaction. The debit amount may be positive or negative, to reflect the storno in black ink. Negative amounts are prefixed with the minus („-”) sign. If the transaction line is debit, use DebitAmount and don’t report CreditAmount - meaning the item is not reported (will not be present in the XML file). |
| DebitCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| DebitCurrencyAmount | SAFmonetaryType | No | Amount in foreign currency. Decimal number with two decimals separated by decimal point sign („ . ”). This amount may be positive or negative. Negative amounts are prefixed with the minus („-”) sign". |
| DebitExchangeRate | SAFexchangerateType | Yes | The exchange rate used for debit amount. DebitCurrencyAmount x DebitExchangeRate = DebitAmount. |
| CreditAmount | SAFmonetaryType | Yes | Credit amount information for transaction. The credit amount may be positive or negative, to reflect the storno în black ink. Negative amounts are prefixed with the minus („-”) sign. If the transaction line is credit, use CreditAmount and don’t report DebitAmount - meaning the item is not reported (will not be present in the XML file). |
| CreditCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| CreditCurrencyAmount | SAFmonetaryType | No | Amount in foreign currency. Decimal number with two decimals separated by decimal point sign („ . ”). This amount may be positive or negative. Negative amounts are prefixed with the minus („-”) sign". |
| CreditExchangeRate | SAFexchangerateType | No | The exchange rate used for credit amount. CreditCurrencyAmount x CreditExchangeRate = CreditAmount. |
| TaxType | SAFcodeType | Yes | For the list of valid values, consult the SAF-T Schema. |
| TaxCode | SAFcodeType | Yes | For the list of valid values, consult the SAF-T Schema. |
| TaxPercentage | Decimal | No | The tax percentage. |
| TaxBase | Decimal | No | The base on which the tax is calculated. This can be an amount. |
| TaxAmount | SAFmonetaryType | Yes | Tax amount information. |
| TaxCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| TaxCurrencyAmount | SAFmonetaryType | No | Tax amount in foreign currency. |
| TaxExchangeRate | SAFexchangerateType | No | The exchange rate used for tax. |
Invoices.csv (BG)
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| InvoiceNo | SAFmiddle2textType | Yes | The invoice number. |
| CustomerID | Yes | The ID of the customer on the invoice. To be filled only for sales invoices. This field is mutually exclusive with SupplierID. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
|
| SupplierID | Yes | The ID of the supplier on the invoice. To be filled only for purchase invoices. This field is mutually exclusive with CustomerID. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
|
| AccountID | Yes | The general ledger code used by the reporting company in their ERP. | |
| InvoiceDate | Date | Yes | Date of the invoice. Validated according to ISO 8601 (YYYY-MM-DD). |
| InvoiceType | SAFcodeType | Yes | Specifies the type of the invoice. For the list of valid values, consult the Nom_Invoice_Types sheet of the SAF-T Schema. |
| SelfBillingIndicator | SAFcodeType | No | Indicator showing if the invoice is a self-billed invoice. Valid values: Y - Self-billed invoice, N - Not a self-billed invoice. |
| SystemID | SAFmiddle1textType | Yes | Unique number created by the system for the document. |
| TransactionID | SAFmiddle2textType | Yes | Cross-reference to GL posting (from the GeneralLedgerEntries.csv file). |
| MasterTaxBase | Decimal | No | The base on which tax is calculated, for the whole invoice. |
| MasterTaxAmount | SAFmonetaryType | Yes | The tax amount information, for the whole invoice. |
| MasterTaxCurrencyCode | ISOCurrencyCode | No | The currency in which tax is calculated, for the whole invoice. This is a three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| MasterTaxCurrencyAmount | SAFmonetaryType | No | The tax amount in foreign currency, if applicable. |
| MasterTaxExchangeRate | SAFexchangerateType | No | The exchange rate used, if applicable. |
| MasterNetTotal | SAFmonetaryType | Yes | The net total amount of the invoice. |
| MasterGrossTotal | SAFmonetaryType | Yes | The gross total amount of the invoice. |
| LineNumber | SAFshorttextType | No | The invoice line number. |
| LineAccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| GoodsServicesID | SAFcodeType | No | Indicator showing if goods or services are being reported. Valid values: 01 - Goods, 02 - Services. |
| ProductCode | SAFmiddle2textType | No | The product code. |
| Description | SAFlongtextType | Yes | The description of goods or services that are being reported. To be filled according to the description in taxpayer’s ERP system. |
| ProductCommodityCode | SAFmiddle1textType | Yes | For valid values, see the NC8_TARIC nomenclature in the SAF-T Schema. |
| ValuationMethod | SAFcodeType | No | The valuation method employed. Valid values: FIFO (First-In, First-Out), LIFO (Last-In, First-Out), Average cost, Standard cost. |
| UOMBase | SAFcodeType | Yes | The unit of measure to manage stock for this product. For valid values, see the Unit of Measure sheet of the SAF-T Schema. |
| Quantity | SAFquantityType | Yes | The quantity of goods or services supplied. |
| UnitPrice | SAFmonetaryType | Yes | Unit price for the unit/group of units per UOM in the header’s default currency. Decimal number with two decimals separated by decimal point sign („ . ”). |
| LineDescription | SAFlongtextType | Yes | Description of the invoice line. |
| InvoiceLineAmount | SAFmonetaryType | Yes | The amount of the invoice line. |
| InvoiceLineCurrencyCode | ISOCurrencyCode | No | The currency code of the invoice line, if applicable. |
| InvoiceLineCurrencyAmount | SAFmonetaryType | No | The invoice line amount in foreign currency, if applicable. |
| InvoiceLineExchangeRate | SAFexchangerateType | No | The exchange rate used, if applicable. |
| DebitCreditIndicator | SAFcodeType | Yes | Indicates whether the amounts on line level are debit or credit amounts. This entry must correspond to the entry reflected in General Ledger. Signing of line amounts is relative to this indicator. For example, a return can lead to a negative amount. Valid values: C - Credit, D - Debit. |
| TaxType | SAFcodeType | Yes | For the list of valid values, consult the SAF-T Schema. |
| TaxCode | SAFcodeType | Yes | For the list of valid values, consult the SAF-T Schema. |
| TaxPercentage | Decimal | No | The tax percentage. |
| TaxBase | Decimal | No | The base on which the tax is calculated. This can be an amount. |
| TaxAmount | SAFmonetaryType | Yes | Tax amount information. |
| TaxCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| TaxCurrencyAmount | SAFmonetaryType | No | Tax amount in foreign currency. |
| TaxExchangeRate | SAFexchangerateType | No | The exchange rate used for tax. |
Payments.csv (BG)
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| PaymentRefNo | SAFmiddle1textType 35 | Yes | The unique reference number of the payment. |
| Period | nonNegativeInteger | No | The accounting period (that is, the month of the year). For example, 1 for January. |
| PeriodYear | nonNegativeInteger | No | The year of the accounting period. Must be equal to or greater than 2020 and less than or equal to the current year. |
| TransactionID | SAFmiddle2textType | Yes | Cross-reference to GL posting. It can contain many different levels to identify the transaction. It may include cost centres such as company, division, region, group and branch/department. |
| TransactionDate | Date | Yes | Document date. |
| PaymentMethod | Yes | Identifies the payment method (cheque, bank, giro, cash etc). Valid values: 01 - for cash (за пари в брой), 02 - for offset (за прихващане), 03 - for non-cash payment (за безкасово). | |
| Description | SAFlongtextType | Yes | Description of the payment. |
| SystemID | SAFmiddle1textType | Yes | Unique number created by the system for the document. |
| LineNumber | SAFshorttextType | No | Number of the payment line. |
| SourceDocumentID | SAFmiddle1textType | No | The source document to which the line relates. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| CustomerID | SAFmiddle1textType | Yes | Identifies the customer company/organization. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| SupplierID | SAFmiddle1textType | Yes | Identifies the supplier company/organization. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| DebitCreditIndicator | SAFcodeType | Yes | Indicates whether the amounts on line level are debit or credit amounts. This entry must correspond to the entry reflected in General Ledger. Signing of line amounts is relative to this indicator. For example, a return can lead to a negative amount. Valid values: C - Credit, D - Debit. |
| PaymentLineAmount | SAFmonetaryType | Yes | The amount of the payment line. |
| PaymentLineCurrencyCode | ISOCurrencyCode | No | The currency code of the payment line, if applicable. |
| PaymentLineCurrencyAmount | SAFmonetaryType | No | The payment line amount in foreign currency, if applicable. |
| PaymentLineExchangeRate | SAFexchangerateType | No | The exchange rate used, if applicable. |
| TaxType | SAFcodeType | Yes | For the list of valid values, consult the SAF-T Schema. |
| TaxCode | SAFcodeType | Yes | For the list of valid values, consult the SAF-T Schema. |
| TaxPercentage | Decimal | No | The tax percentage. |
| TaxBase | Decimal | No | The base on which the tax is calculated. This can be an amount. |
| TaxAmount | SAFmonetaryType | Yes | Tax amount information. |
| TaxCurrencyCode | ISOCurrencyCode | No | Three-letter currency code according to ISO 4217 standard. Example: EUR for Euros, USD for American Dollars. |
| TaxCurrencyAmount | SAFmonetaryType | No | Tax amount in foreign currency. |
| TaxExchangeRate | SAFexchangerateType | No | The exchange rate used for tax. |
PhysicalStock.csv (BG)
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| WarehouseID | SAFmiddle1textType | Yes | Warehouse where goods are held. May also be used to identify production under way, or stock in transit. |
| ProductCode | SAFmiddle2textType | Yes | The product code. |
| ProductType | SAFshorttextType | Yes | The product type. Used to determine whether the product or stock account is raw material, work-in-progress, finished good, merchandise for resale, etc. |
| StockAccountCommodityCode | SAFmiddle1textType | Yes | The commodity code associated with the stock account. For valid values, see the NC8_TARIC nomenclature in the SAF-T Schema. |
| OwnerID | SAFmiddle1textType | Yes | Identifies the owner of the stock. Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| GoodsServicesID | SAFcodeType | No | Indicator showing if goods or services are being reported. Valid values: 01 - Goods, 02 - Services. |
| Description | SAFlongtextType | Yes | Description of goods or services. |
| ProductCommodityCode | Yes | The commodity code associated with the product. For valid values, see the NC8_TARIC nomenclature in the SAF-T Schema. | |
| ValuationMethod | SAFcodeType | No | The valuation method employed. Valid values: FIFO (First-In, First-Out), LIFO (Last-In, First-Out), Average cost, Standard cost. |
| UOMBase | SAFcodeType | Yes | The unit of measure used to manage product stocks. For valid values, see the SAF-T Schema. |
| OpeningStockQuantity | SAFquantityType | Yes | The quantity of stock at the start date of the reporting period. |
| OpeningStockValue | SAFmonetaryType | Yes | The stock value at the start date of the reporting period, in the header’s currency. |
| ClosingStockQuantity | SAFquantityType | Yes | The quantity of stock at the end date of the reporting period. |
| ClosingStockValue | SAFmonetaryType | Yes | The stock value at the end date of the reporting period, in the header’s currency. |
| UnitPrice | SAFmonetaryType | Yes | Base unit price in the header’s default currency. |
MovementOfGoods.csv (BG)
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| MovementReference | SAFmiddle1textType | Yes | Unique reference to the movement. |
| MovementDate | Date | Yes | Document date. Validated according to ISO 8601 standard (YYYY-MM-DD). |
| MovementType | SAFcodeType | Yes | The type of the process for the underlying lines. For example: 10 - purchase, 30 - sales, etc. Validated according to the Stock movement nomenclature of the SAF-T Schema. |
| DocumentType | SAFshorttextType | Yes | The source document type for the respective movement. |
| DocumentNumber | SAFmiddle1textType | Yes | The source document number for the respective movement. |
| DocumentLine | SAFshorttextType | No | The line number in the source document for the respective movement. |
| LineNumber | SAFshorttextType | Yes | The number of the movement line. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| CustomerID | SAFmiddle1textType | Yes | Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| SupplierID | SAFmiddle1textType | Yes | Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| ProductCode | SAFmiddle2textType | Yes | The product code. |
| GoodsServicesID | SAFcodeType | No | Indicator showing if goods or services are being reported. Valid values: 01 - Goods, 02 - Services. |
| Description | SAFlongtextType | Yes | Description of goods or services. |
| ProductCommodityCode | SAFmiddle1textType | Yes | The commodity code associated with the product. For valid values, see the NC8_TARIC nomenclature in the SAF-T Schema. |
| ValuationMethod | SAFcodeType | No | The valuation method employed. Valid values: FIFO (First-In, First-Out), LIFO (Last-In, First-Out), Average cost, Standard cost. |
| UOMBase | SAFcodeType | Yes | The unit of measure used. For valid values, see the SAF-T Schema. |
| Quantity | SAFquantityType | Yes | The quantity of goods. |
| BookValue | SAFmonetaryType | Yes | Value of the transaction line as registered in the general ledger in the header’s default currency. |
| MovementSubType | SAFcodeType | Yes | Identifies the type of the movement on line/article level. To be populated according to your ERP. |
Assets.csv (BG)
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| AssetID | SAFmiddle1textType | Yes | The unique identifier of the asset. |
| AccountID | SAFmiddle2textType | Yes | The general ledger code used by the reporting company in their ERP. |
| Description | SAFlongtextType | Yes | The asset description. |
| DateOfAcquisition | Date | Yes | Date of the acquisition of the asset (usually the date of delivery). Validated according to ISO 8601 standard (YYYY-MM-DD). |
| StartUpDate | Date | Yes | Commissioning date of the asset. Validated according to ISO 8601 standard (YYYY-MM-DD). |
| SupplierID | SAFmiddle1textType | Yes | Set this value to the Id of the relevant business partner reported in BusinessPartners.csv. |
| AssetValuationType | SAFshorttextType | No | Not required. |
| ValuationClass | SAFshorttextType | Yes | Describes the classification of the asset for tax reporting purposes. |
| AcquisitionAndProductionCostsBegin | SAFmonetaryType | Yes | Total costs of the acquisition and/or production of the asset at the start date of the reporting period, in the header’s default currency. |
| AcquisitionAndProductionCostsEnd | SAFmonetaryType | Yes | Total costs of the acquisition and/or production of the asset at the end date of the reporting period, in the header’s default currency. |
| InvestmentSupport | SAFmonetaryType | Yes | Total amount of investment support for this asset in the header’s default currency (that is, the amount of increase in value of the assets due to reconstruction, overhaul, etc). |
| AssetLifeYear | Decimal | Yes | Period of useful life in years. This field is mutually exclusive with AssetLifeMonth. |
| AssetLifeMonth | Decimal | Yes | Period of useful life in months. This field is mutually exclusive with AssetLifeYear. |
| AssetAddition | SAFmonetaryType | Yes | The accounting (book) value of the acquisition and/or production of the asset in the reporting period, in the header’s default currency. |
| Transfers | SAFmonetaryType | Yes | The accounting (book) value of the transfers of the asset during the reporting period, in the header’s default currency. |
| AssetDisposal | SAFmonetaryType | Yes | The accounting (book) value of the disposals of the asset during the reporting period in the header’s default currency. |
| BookValueBegin | SAFmonetaryType | Yes | The accounting (book) value at the beginning of the reporting period, in the header’s default currency. |
| DepreciationMethod | SAFmiddle1textType | Yes | Method of normal depreciation of the asset during the reporting period. |
| DepreciationPercentage | Decimal | Yes | The rate of the normal depreciation of the asset per year or month (this depends on whether AssetLifeYear or AssetLifeMonth is reported). |
| DepreciationForPeriod | SAFmonetaryType | Yes | The total amount of normal depreciation during the reporting period, in the header’s default currency. |
| AppreciationForPeriod | SAFmonetaryType | Yes | The total amount of appreciation of the asset during the reporting period, in the header’s default currency. |
| AccumulatedDepreciation | SAFmonetaryType | Yes | Total amount of depreciation for this asset. |
| BookValueEnd | SAFmonetaryType | Yes | The accounting (book) value at the end of the reporting period, in the header’s default currency. |
| ExtraordinaryDepreciationMethod | SAFmiddle1textType | Yes | Method of extraordinary depreciation of the asset during the reporting period. |
| ExtraordinaryDepreciationAmountForPeriod | SAFmonetaryType | Yes | The amount of extraordinary depreciation of the asset during the reporting period, in the header’s default currency. |
AssetTransactions.csv (BG)
| Column | Format | Mandatory? | Description |
|---|---|---|---|
| AssetTransactionID | SAFmiddle2textType | Yes | The unique identifier of the transaction. |
| AssetTransactionType | SAFcodeType | Yes | The transaction type. Validated according to the SAF-T Schema. |
| AssetTransactionDate | Date | Yes | The logged date of the transaction. Validated according to ISO 8601 standard (YYYY-MM-DD). |
| TransactionID | SAFmiddle2textType | Yes | Cross reference to the GL posting in the journal. It can contain many different levels to identify the transaction. It may include cost centres such as company, division, region, group and branch/department. |
| AcquisitionAndProductionCostOnTransaction | SAFmonetaryType | Yes | Costs of acquisition and/or production of the related asset transaction, in the header’s default currency on the date of transaction. |
| BookValueOnTransaction | SAFmonetaryType | Yes | The accounting (book) value of the related asset transaction, in the header’s default currency on the date of transaction. |
| AssetTransactionAmount | SAFmonetaryType | Yes | The net amount of the related asset transaction, in the header’s default currency (for instance, the net sale revenue). |
| AssetID | SAFmiddle1textType | Yes | The unique identifier of the asset. |
Appendix 4: List of county codes (Romania)
| County Code | County Name |
|---|---|
| AB | Alba |
| AR | Arad |
| AG | Argeș |
| BC | Bacău |
| BH | Bihor |
| BN | Bistrița-Năsăud |
| BR | Brăila |
| BT | Botoșani |
| BV | Brașov |
| BZ | Buzău |
| CJ | Cluj |
| CL | Călărași |
| CS | Caraș-Severin |
| CT | Constanța |
| CV | Covasna |
| DB | Dâmbovița |
| DJ | Dolj |
| GL | Galați |
| GR | Giurgiu |
| GJ | Gorj |
| HR | Harghita |
| HD | Hunedoara |
| IL | Ialomița |
| IS | Iași |
| IF | Ilfov |
| MM | Maramureș |
| MH | Mehedinți |
| MS | Mureș |
| NT | Neamț |
| OT | Olt |
| PH | Prahova |
| SM | Satu Mare |
| SJ | Sălaj |
| SB | Sibiu |
| SV | Suceava |
| TR | Teleorman |
| TM | Timiș |
| TL | Tulcea |
| VS | Vâlcea |
| VL | Vaslui |
| VN | Vrancea |
| B | Bucharest |
Appendix 5: List of region codes (Bulgaria)
The Bulgarian region codes may appear in the following contexts, using the following formats:
- XML Region Code - The region code in the generated XML output file.
- GraphQL Region Code - The enum value to be provided as input to the
initiateDeclarationmutation in SBS.
| XML Region Code | GraphQL Region Code | Region Name |
|---|---|---|
| BG-01 | BG01 | Благоевград |
| BG-02 | BG02 | Бургас |
| BG-08 | BG08 | Добрич |
| BG-07 | BG07 | Габрово |
| BG-26 | BG26 | Хасково |
| BG-09 | BG09 | Кърджали |
| BG-10 | BG10 | Кюстендил |
| BG-11 | BG11 | Ловеч |
| BG-12 | BG12 | Монтана |
| BG-13 | BG13 | Пазарджик |
| BG-14 | BG14 | Перник |
| BG-15 | BG15 | Плевен |
| BG-16 | BG16 | Пловдив |
| BG-17 | BG17 | Разград |
| BG-18 | BG18 | Русе |
| BG-27 | BG27 | Шумен |
| BG-19 | BG19 | Силистра |
| BG-20 | BG20 | Сливен |
| BG-21 | BG21 | Смолян |
| BG-23 | BG23 | Софийска област |
| BG-22 | BG22 | София |
| BG-24 | BG24 | Стара Загора |
| BG-25 | BG25 | Търговище |
| BG-03 | BG03 | Варна |
| BG-04 | BG04 | Велико Търново |
| BG-05 | BG05 | Видин |
| BG-06 | BG06 | Враца |
| BG-28 | BG28 | Ямбол |
Appendix 6: Tax Accounting Basis
| Code | Description | Valid for |
|---|---|---|
| A | Accounting for general commercial companies which apply double-entry bookkeeping and the general business chart of accounts. | RO, BG |
| BANK | Credit institutions and non-bank financial institutions that apply apply double-entry bookkeeping and chart of accounts for banks and financial-monetary institutions. | BG |
| I | Invoice Accounting (Non-Residents). | RO |
| IFN | Non-banking financial institutions in Romania that use the account plan according to the BNR Regulation no. 17/2015. | RO |
| IFRS | General commercial companies that apply double-entry taxability at the same time as the provisions of OMFP 2844/2016 (IFRS chart of accounts). | RO |
| INSURANCE | Insurance companies applying applies double entry taxation and chart of accounts for insurance companies. | RO, BG |
| NORMA14 | Private pension companies which use the account plan according to the regulation no. 14/2015 of the Authority for Financial Supervision (ASF). | RO |
| NORMA36 | Insurance and/or reinsurance brokerage companies which use the account plan according to the regulation no. 36/2015 of the Authority for Financial Supervision (ASF). | RO |
| NORMA39 | Leasing and financial companies which use the IFRS account plan according the Reg no. 39/2015 of the Authority for Financial Supervision (ASF). | RO |
| ONG | Companies without patrimonial purpose (non-government organizations) according to the OMFP no. 3103/2017. | RO |
| ONGE | Non-profit legal entities (NGOs) according to OMFP no. 3103/2017 - legal entities with a VAT code for economic activity. | RO |
| P | Public entities (public utilities, public transport, public health services, etc). | BG |
Appendix 7: Audit File Countries vs Tax Accounting Basis
| Audit File Country | Valid values for taxAccountingBasis |
Valid values for headerComment |
|---|---|---|
| RO | A, BANK, INSURANCE, I, IFN, IFRS, NORMA39, , NORMA36, NORMA14, ONG, ONGE | L, T, A, C, NL, NT |
| BG | A, BANK, INSURANCE, P | M, A, D |
| Any except RO and BG | none (the declaration will fail with an error) | - |
Appendix 8: Rules for inferring Audit File Country
| If the organization country is: | And the tax accounting basis is: | Then the inferred country is: |
|---|---|---|
| RO | A, I, IFRS, BANK, INSURANCE, NORMA39, IFN, NORMA36, NORMA14, ONG, ONGE | RO |
| BG | A, BANK, INSURANCE, P | BG |
| BG | I | RO |
| Any except RO and BG | I | RO |
Appendix 9: RO D406 KPI Definitions
The following table lists all KPI indicators computed for Romanian D406 declarations, grouped by category. Account code patterns use Romanian chart-of-accounts prefixes (e.g., 70* means all accounts starting with 70).
| KPI Code | Full Name (Romanian) | Full Name (English) | Formula / Definition |
|---|---|---|---|
CA |
Cifra de afaceri | Turnover / Revenue | Σ CreditAmount(70*) − Σ DebitAmount(709) |
VE |
Venituri din exploatare | Operating Revenue | Σ CreditAmount(70*..75*) − Σ DebitAmount(709) |
EAT |
Profit net | Net profit after tax | Σ CreditAmount(7*) − Σ DebitAmount(709) − Σ DebitAmount(6*) + Σ CreditAmount(609) |
EBT |
Profit brut | Gross profit before tax | EAT + Σ DebitAmount(69*) |
EBIT |
Profit din exploatare | Operating profit | EBT − Σ CreditAmount(76*) + Σ DebitAmount(66*) |
EBITDA |
Profit înainte de dobânzi, taxe, depreciere și amortizare | Earnings before interest, taxes, depreciation, and amortization | EBIT + Σ DebitAmount(68*) |
MB |
Marja brută % | Gross margin % | (EBIT / CA) × 100 |
RCT |
Rata cheltuieli totale % | Total expense ratio % | (Σ DebitAmount(6*) − Σ CreditAmount(609)) / (Σ CreditAmount(7*) − Σ DebitAmount(709)) × 100 |
MPN |
Marja profit net % | Net profit margin % | (EAT / CA) × 100 |
CT |
Cheltuieli totale | Total Costs and Expenses | Σ Debit (6*) - Σ Credit(609) |
CR |
Creanțe clienți | Accounts receivable | Net closing debit balance of customer receivable accounts (41*). |
DAT |
Datorii furnizori | Accounts payable | Net closing credit balance of supplier payable accounts (40*). |
CL |
Capital de lucru | Net Working Capital | CR − DAT |
NFC |
Nr. facturi clienți | Sales Invoice Count | The count of sales invoices. |
NFF |
Nr. facturi furnizori | Purchase Invoice Count | The count of purchase invoices. |
NPC |
Număr parteneri activi | Number of active business partners | The count of active business partners. |
RAC |
Viteza de rotație a activelor circulante | Current Asset Turnover | CA / [(Σ OpeningDebitBalance(3*) − Σ OpeningDebitBalance(39*) + Σ OpeningDebitBalance(41*) + Σ OpeningDebitBalance(46*) − Σ OpeningDebitBalance(49*) + Σ OpeningDebitBalance(5*) − Σ OpeningDebitBalance(59*) + Σ ClosingDebitBalance(3*) − Σ ClosingDebitBalance(39*) + Σ ClosingDebitBalance(41*) + Σ ClosingDebitBalance(46*) − Σ ClosingDebitBalance(49*) + Σ ClosingDebitBalance(5*) − Σ ClosingDebitBalance(59*)) / 2] |
RRC |
Viteza de rotație a debitelor clienților | Customer Receivables Turnover | CA / [(Σ OpeningDebitBalance(41*) − Σ OpeningCreditBalance(49*) + Σ ClosingDebitBalance(41*) − Σ ClosingCreditBalance(49*)) / 2] |
RRF |
Viteza de rotație a debitelor furnizorilor | Supplier Payables Turnover | CA / [(Σ OpeningDebitBalance(40*) + Σ ClosingDebitBalance(40*)) / 2] |
VMF |
Valoare medie factură vânzare | Avg. Sales Invoice Value | Σ(Sales NetTotal) / NFC |
TVAC |
TVA colectat | Output VAT | Σ CreditAmount(4427*) |
TVAD |
TVA deductibil | Input VAT | Σ DebitAmount(4426*) |
TVAN |
TVA net | Net VAT position | TVAC − TVAD. Positive = VAT liability; negative = refundable position. |