Generating an Authorization Token in Romania’s ANAF Portal Using Postman
Note: The steps and processes described here are accurate as of the time of writing, but it’s essential to stay updated with any changes on the ANAF portal that may affect this procedure.
In this blog post, I will guide you through the process of generating an authorization token from Postman and ANAF’s portal. This authorization token is essential for establishing a connection between SAP Document and Reporting Compliance, cloud edition and ANAF. This will allow you to submit and monitor electronic invoices from eDocument cockpit.
ANAF, which stands for Agenția Națională de Administrare Fiscală (National Agency for Fiscal Administration), enables you to electronically send and receive electronic invoices through their e-Invoicing platform.
- You should be a registered user on the ANAF portal with a qualified digital certificate, holding one of the SPV PJ rights (legal representative, designated representative, or authorized representative). You can register in the SPV by visiting this link: https://www.anaf.ro/InregPersFizicePublic/#tabs-2.
- After completing the registration process on the ANAF portal, you will receive a Client ID and Client Secret, which are required for the subsequent steps.
Now, let’s go over the management URLs used for generating the authorization token:
- Authorization Endpoint: https://logincert.anaf.ro/anaf-oauth2/v1/authorize
- Token Issuance Endpoint: https://logincert.anaf.ro/anaf-oauth2/v1/token
Once you are registered on the ANAF portal, follow these steps to generate an authorization token:
- Open Postman application and create a GET operation for the Authorization Endpoint.
- Under the Authorization tab, complete the required fields as shown below:
Grant Type Authorization Code Callback URL <Use the default URL generated by Postman> Auth URL https://logincert.anaf.ro/anaf-oauth2/v1/authorize Access Token URL https://logincert.anaf.ro/anaf-oauth2/v1/token Client ID <Enter the Client ID received during the registration process> Client Secret <Enter the Client Secret received during the registration process> Client Authentication Send as Basic Auth Header
– Check the ‘Authorize using Browser’ checkbox.
- Click the ‘Get New Access Token’ button.
- Since you’ve checked ‘Authorize using Browser’ in step 2, your browser will automatically open, and you will be prompted to select your certificate for authentication.
Note: Make sure you disable the pop-up blocker in the browser.
- After a successful authentication, provide your ANAF portal username and password as prompted by the browser and click the ‘OK’ button.
- A new token will be generated, and you will see a success message in the browser.
- You will be automatically redirected back to Postman with a popup displaying the newly generated authorization token. Click the ‘Use Token’ button.
- The new token will automatically populate the token field.
To configure the generated token with in the Business Technology Platform(BTP) portal, follow the documentation provided below:
- If your business system is SAP S/4HANA Cloud, refer to Managing Communication Settings | SAP Help Portal.
- If your business system is SAP S/4HANA or SAP ERP, refer to Managing Communication Settings | SAP Help Portal
I hope you find this information useful. You can leave a comment on this blog or follow us for more information about SAP Document and Reporting Compliance here in SAP Community.