Configure ANAF environment
When using the RO E-Factura Service or RO E-Transport Service, you may configure your app to send API requests either to ANAF’s production environment or test environment.
By default, a newly created app uses ANAF’s production environment. This means that any e-Factura invoices or e-Transport declarations that you upload to ANAF will be submitted to ANAF’s production API.
You may change the ANAF environment to test (or back to production) either from the graphical user interface of the SBS Console or from GraphQL. In either case, your user account (or the account access key, if you are doing this through the Account API) must have the permission to run the updateApp
mutation of the Account API.
Caution
Switching your app to the ANAF test environment is typically necessary only for test applications (or new applications that have to be tested before being switched to production). If your application is live, it is not recommended to change its ANAF environment to test, because this will affect all application users with immediate effect. For example, if Use Test Environment is enabled for E-Factura, all invoices uploaded through the uploadInvoice
mutation wil be sent to the ANAF test environment. Do not change this option for a production app unless you fully understand the consequences.
Web UI
To set your app’s ANAF environment for e-Factura or e-Transport:
-
Sign in to the SBS Console.
-
Click the WebUI tab.
-
In the left-hand side navigation menu, click Applications.
-
Click the application for which you would like to configure the ANAF environment.
-
Under E-Factura (or E-Transport, as applicable), click Use Test Environment to switch to the test environment.
-
In the confirmation dialog box that pops up, type TEST and click Agree to confirm.
GraphQL
To set your app’s ANAF environment for e-Factura or e-Transport:
- Sign in to the SBS Console.
- Click the GraphQL tab.
- Run the
updateApp
mutation and supply the value true or false value to theroAnafEfacturaUseTentEnvironment
parameter, as required. For example, the mutation listed below configures the ANAF environment for both E-Factura and E-Transport to test:
mutation updateApp($id:ID!,$input:UpdateAppInput!) {
updateApp(id:$id, input:$input) {
id
name
roAnafEfacturaUseTestEnvironment
roAnafEtransportUseTestEnvironment
}
}
{
"id": "YOUR_APPLICATION_ID",
"input": {
"roAnafEfacturaUseTestEnvironment": true,
"roAnafEtransportUseTestEnvironment": true
}
}
Viewing the ANAF environment at invoice level
The Invoice
type of the RO E-Factura Service has a field called uploadedToTestEnvironment
. This field indicates whether the invoice was uploaded to the ANAF test or production environment. The value is true if the invoice was uploaded to the ANAF test environment, false otherwise.