The documentation exists and is very comprehensive (surprisingly well done) and is on the website of Secretary of Finance of São Paulo. The documentation is in Legislação
, item Legislação em vigor
.
If you’re going to read all the CAT-147 it’s a bit tedious. Prefer to download the Pdfs from Guidance Manual and of ER SAT (Requirements Specification). You will find them in Downloads
, item Arquivos vigentes
. Take a general look at the page and you will start to form an idea of the thing.
Understand that in a single manual there are two sides to the technical documentation. One aimed at SAT equipment manufacturers and another aimed at system developers (what they call AC, commercial application). In the ER SAT, there is a table (item 4.2.2) that lists all the groups, elements and attributes that make up the XML of CF-e and this will help you build this XML. The first column of this table is important because it indicates the origin, who is responsible for providing that data. The lines indicated with AC
are the data generated by your application. The others will be filled in later by the SAT.
The flow is simple:
- Your application generates a simple XML, containing only AC liability data, describing the sale;
- This XML is sent to the SAT device via the function
EnviarDadosVenda
;
- SAT equipment completes XML, validates, signs and returns it to your application;
- Your application issues the statement based on the XML data, which is called CF-e-SAT (whose signature makes it a tax document with legal validity).
You said you don’t want to use third-party libraries, but nothing stops you checking out other implementations to help you understand the whole thing.
I would put more links, but I don’t have "reputation" for it :)
Perfect answer Daniel. Thank you very much.
– Ricardo Acras