Brazilian Government WS Status (NF-e, CT-e, etc.) with a Free REST API

Hello @All,

(versão em 🇧🇷 abaixo)

Here in Brazil (like many other countries) we have Electronic invoicing.

Each state (as we call “Autorizador”) has their oficial SOAP Web Services for sending, canceling, etc. invoices. Example:

So there is a “Status” Web Service, so we can periodically check if the services are Online for him (as if there any issue, we have do “switch” to a different location).

All of the above is performed on the SAP® GRC NF-e product, more info here: here

But this WS services are not really “open”, as you need to have a digital certificate in order to perform any calls, not really interesting if you just want to “status check” each issuer.

So now we’ve got to my main motivation, to create a “way” that anyone can check the status for these WS on their systems, apps, etc. The government do provide status for them, but on a URL format, like the image below from here.

Added to the need that i had to perform a POC on a similar solution, i’ve decided to create a Free REST API(Using NodeJS and hosted @ Heroku) that returns status for the WS regarding: NF-e, CT-e, BP-e and MDF-e.

You can check the API Documentation here: API Documentation (Swagger)

 

All the services are well documented (with the data source as well):

Always returning data in JSON, example:

  {
    "Autorizador": "AM",
    "Autorização": "Online",
    "Retorno_Autorização": "Online",
    "Inutilização": "Online",
    "Consulta_Protocolo": "Online",
    "Status_Serviço": "Online",
    "Tempo_Médio": "-",
    "Consulta_Cadastro": "",
    "Recepção_Evento": "Online"
  },

 

Testing on Postman the NFE service, URL: https://zsefazrest.herokuapp.com/api/NFE

If you notice, it has the same information that the Government websites, but returning Online/Offline/Warning rather than the images(green, yellow and red) showed on them.

So now anyone that needs a API (as the “World speaks Rest APIs”) to check the WS Status for them, on a Mobile, Desktop, Interface, etc., feel free to enjoy this API.

I’ve decided to create a simple DEMO SAPUI5 app that consumes the NFE service, just to show it running live. Check out here: https://zsefazui5.web.app/

Desktop:

Mobile:

Enjoy. 🏁

Regards.


🇧🇷

Olá, tudo bem?

Como podem ver acima, criei uma API REST grátis para consulta dos status do WS de NF-e, CT-e, MDF-e e BP-e, para todos que necessitam desse tipo de consulta e não tem/desejam fazer da forma oficial (com a necessidade de certificado digital).

Toda documentação(Swagger) da API pode ser consultada na URL abaixo:

https://zsefazrest.herokuapp.com/api-docs/

Também fiz uma aplicação em SAPUI5 para demonstrar o consumo dessas informações (no caso somente NF-e) na URL abaixo:

https://zsefazui5.web.app/

Obrigado. 🏁

Original Article:
https://blogs.sap.com/2020/04/15/brazilian-government-ws-status-nf-e-ct-e-etc.-with-a-free-rest-api/

ASK SAP EXPERTS ONLINE
Related blogs

LEAVE A REPLY

Please enter your comment!
Please enter your name here