ANAF authorizations UI


To use the e-Factura or e-Transport services, you must create an organization and then authorize it with ANAF. The ANAF authorizations page in the SBS portal enables you to view any existing ANAF authorizations, or request new authorizations.

Access

You can access the ANAF authorizations page of the portal as follows:

  1. Sign in to the SBS Portal. During the sign-in process, you will be prompted to select the account, app, and tenant where you are entitled to sign in.
  2. Click ro-anaf-oauth-api in the left hand-side menu.

To view or manage ANAF authorizations for a different, account, app, or tenant, switch accounts.

To interact with the ANAF authorizations service, you can use either the Web UI or a GraphQL interface. You can switch at any time between the two interfaces by clicking the switch displayed in the top-right corner of the page:

Switch between Web and GraphQL

View authorizations

Web UI

To view ANAF authorizations for the currently selected account, app, and tenant:

  1. If applicable, select the organization from the drop-down list at the top of the page.
  2. Click the E-Factura or E-Transport tab, as applicable.

ANAF Authorizations

GraphQL

To list available ANAF authorizations for the current account, app, and tenant:

  1. Switch to the GraphQL interface.
  2. Run the authorizations query.

An example is provided below.

query authorizations($organizationId:ID!, $filter:AuthorizationsFilter!) {
  authorizations(organizationId:$organizationId, filter:$filter){
    id
    organizationId
    scope
    createdAt
    updatedAt
  }
}

Make sure to replace the input variables as applicable.

{
  "organizationId": "YOUR_ORGANIZATION_ID",
  "filter": {"scope": "EFACTURA"}
}

Request ANAF authorization

Before requesting an ANAF authorization, note the following:

  • The authorization must be performed by a person from your organization that has access to the ANAF’s Virtual Private Space (in Romanian, SpaČ›iul Privat Virtual, abbreviated as SPV).
  • If you have no access to the ANAF’s SPV, you can still generate an authorization request URL, and send it to a representative in your organization who has such access and could complete the authorization process for you.
  • To complete the authorization successfully, the same prerequisites apply as those for accessing ANAF’s SPV. Namely, your browser must have a digital certificate purchased from an authorized certificate authority (like https://www.certsign.ro or https://digisign.ro/) and be configured for ANAF access. A digital certificate may be either a physical token inserted into the USB’s port of your computer, or a paperless certificate with an accompanying application.

Once the authorization process is complete with ANAF, the authorization record is displayed in the grid, and your application can start making calls to ANAF APIs.

Web UI

To request a new authorization from ANAF:

  1. If applicable, select the organization from the drop-down list at the top of the page.
  2. Click Generate Authorization Request URL. The authorization URL is generated and displayed on the dialog box.
  3. Visit the URL from a browser authorized to access ANAF’s Virtual Private Space. Alternatively, send it to the responsible person from your organization that has access to ANAF’s SPV.
  4. Upon completing the process, you should see a confirmation page stating that the ANAF authorization has completed successfully.

GraphQL

To request a new ANAF authorization GraphQL:

  1. Switch to the GraphQL interface.
  2. Run the generateAuthorizationRequest mutation. The request should return an authorization URL in the response.
  3. Visit the URL from a browser authorized to access ANAF’s Virtual Private Space. Alternatively, send it to the responsible person from your organization that has access to ANAF’s SPV.
  4. Upon completing the process, you should see a confirmation page stating that the ANAF authorization has completed successfully.

An example GraphQL mutation is provided below.

mutation genAuthReq($organizationId:ID!, $input:GenerateAuthorizationRequestInput!) {
  generateAuthorizationRequest(organizationId: $organizationId, input:$input) {
    state
    scope
    url
    shortUrl
    createdAt
  }
}

Make sure to replace the input variables as applicable.

{
  "organizationId": "YOUR_ORGANIZATION_ID",
  "input": {
    "scope": "EFACTURA"
  }
}