Through this endpoint, it’s possible to send an txt or json of an NF-e, which will be converted to an xml without the signature information.
URL
Production: POST https://nfe.ns.eti.br/util/generatexml
Input data
The input data of this method follows the NF-e issuance stantard, according to the data format.
Sending data in JSON format
To send data in JSON the request Content-Type must be defined as application/json. The token can be informed either in the body or in the request header.
Field | Description |
---|---|
X-AUTH-TOKEN | User access token |
NFe | NF-e data (according to Sefaz Contributors’ Guidance Manual) |
Sending data in TXT format
To send data in TXT, the Content-Type of the request must be defined as text/plain;charset=urf-8 and the X-AUTH-TOKEN must be sent in the HTTP header.
When sending in TXT format, the request body must contain the TXT content with the NF-e information. This content must be generated from the TXT issuance layout by the local integrator of NS Tecnologia.
It’s also possible to issue using the layout of the public issuer. For that, just sent the TXT content in this layout and inform the header layout with the public value in the request headers.
Request examples
NF-e issuance request in JSON
curl -X POST
\-H "Content-Type: application/json"
\-H "X-AUTH-TOKEN: YOUR_TOKEN"
\-d '{"NFe":{...}}' \
https://nfe.ns.eti.br/util/generatexml
NF-e issuance request in TXT
curl -X POST
\-H "X-AUTH-TOKEN: SEU_TOKEN"
\-H "Content-Type: text/plain"
\-d 'NOTA FISCAL|1| \A|3.10||'
\https://nfe.ns.eti.br/util/generatexml
Returned data
Field | Description | Notes |
---|---|---|
status | Processing status code | |
motivo | Processing status literal description | |
xml | XML generated from the json | Only when status = 200 |
Return examples
Successful return
{
"status": 200,
"motivo": "Xml gerado com sucesso",
"xml": "<NFe xmlns=\"http://www.portalfiscal.inf.br/nfe\">....</NFe>"
}
Return with data error
{
"status": -2,
"motivo": "NFe invalido de acordo com a validacao contra schema",
"erros": ["cvc-pattern-valid: Value '9618000' is not facet-valid with respect to pattern '[0-9]{8}' for type '#AnonType_CEPTEndereco'.","O campo 'CEP' foi preenchido incorretamente com o valor '9618000'. Este campo deve ser preenchido com numeros e conter exatamente 8 caracteres."]
}
Return codes
Code | Description |
---|---|
200 | XML generated successfully |
-2 | Information error according to data type. Check the "motivo" field to identify the incorrect fields |
-3 | Non-existent validation schema for the NF-e version informed in NF/infNFe/versao |
-4 | Data sent out of the expected startard. Check the "motivo" field for more information |
Generate Cancellation XML
Through this endpoint, it’s possible to send a Cancellation json that will be converted to an xml without signature information.
URL
Production: POST https://nfe.ns.eti.br/util/generatecancel
Input data
The input data of this method is the same as Cancellation in the NS NF-e API.
Field | Description | Occurrence | Notes |
---|---|---|---|
X-AUTH-TOKEN | User access token | 1-1 | |
chNFe | NF-e access key | 1-1 | |
tpAmb | NF-e authorization environment type: 1 - Production 2 - Homologation | 1-1 | |
dhEvento | Date and time of the cancellation | 1-1 | Sefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC E.g.: 2016-06-13T15:04:10-02:00 |
nProt | NF-e authorization protocol number | 1-1 | |
xJust | Literal description of the reason for cancelling the NF-e |
Request example
NF-e Cancellation request
curl -X POST
\-H "Content-Type: application/json"
\-d '{"X-AUTH-TOKEN": "YUOR_TOKEN", "chNFe": "43161107364617000135550000000099601000094832", "tpAmb": "2", "dhEvento": "2016-11-28T19:06:14-02:00", "nProt": "143160001510168", "xJust": "NF-e cancelada para teste de desenvolvimento de software de integração"}'
\https://nfe.ns.eti.br/util/generatecancel
Returned data
Field | Description | Notes |
---|---|---|
status | Processing status code | |
motivo | Processing status literal description | |
xml | XML generated from the json | Only when status = 200 |
Return example
Successful return
{
"status": 200,
"motivo": "Xml gerado com sucesso",
"xml": "<evento versao=\"1.00\" xmlns=\"http://www.portalfiscal.inf.br/nfe\" >....</evento>"
}
Return code
Code | Description |
---|---|
200 | XML generated successfully |
-2 | Invalid access key: CHAVE. The key must 44 numeric characters |
Generate Correction Letter XML
Through this endpoint, it’s possible to send a Correction Letter json that will be converted to an xml without signature information.
URL
Production: POST https://nfe.ns.eti.br/util/generatecce
Input data
The input data of this method is the same as Correction Letter in the NS NF-e API.
Field | Description | Occurrence | Notes |
---|---|---|---|
X-AUTH-TOKEN | User access token | 1-1 | |
chNFe | NF-e access key | 1-1 | |
tpAmb | NF-e authorization environment type: 1 - Production 2 - Homologation | 1-1 | |
dhEvento | Date and time of the correction | 1-1 | Sefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC. E.g.: 2016-06-13T15:04:10-02:00 |
nSeqEvento | Event sequential number | 1-1 | Sequential of the event for the same type of event The event author must number sequentially |
xCorrecao | Correction description to be carried out in the NF-e | 1-1 | E.g.: "VALIDADE DA LICENCA DE 01/09/2015 A 01/09/2016.". Sefaz won't accept correction letters in english. Translation: "License validity from DD/MM/YYYY to DD/MM/YYYY.". |
Request example
NF-e CCe request
curl -X POST
\-H "Content-Type: application/json"
\-d '{"X-AUTH-TOKEN": "YOUR_TOKEN", "chNFe": "43161107364617000135550000000099461000094833", "tpAmb": "2", "dhEvento": "2016-11-28T19:06:14-02:00", "nSeqEvento": "1", "xCorrecao": "CC-e realizada para teste de integração"}'
\https://nfe.ns.eti.br/util/generatecce
Returned data
Field | Description | Notes |
---|---|---|
status | Processing status code | |
motivo | Processing status literal description | |
xml | XML generated from the json | Only when status = 200 |
Return example
{
"status": 200,
"motivo": "Xml gerado com sucesso",
"xml": "<evento versao=\"1.00\" xmlns=\"http://www.portalfiscal.inf.br/nfe\" >....</evento>"
}
Return codes
Code | Description |
---|---|
200 | XML generated successfully |
-2 | Invalid access key: CHAVE. The key must 44 numeric characters |
Generate Disablement XML
Through this endpoint, it’s possible to send a Disablement json that will be converted to an xml without signature information.
URL
Production: POST https://nfe.ns.eti.br/util/generateinut
Input data
The input data of this method is the same as Disable Numeration in the NS NF-e API.
Field | Description | Occurrence | Notes |
---|---|---|---|
X-AUTH-TOKEN | User access token | 1-1 | |
chNFe | NF-e access key | 1-1 | |
tpAmb | NF-e authorization environment type: 1 - Production 2 - Homologation | 1-1 | |
dhEvento | Date and time of the correction | 1-1 | Sefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC. E.g.: 2016-06-13T15:04:10-02:00 |
nSeqEvento | Event sequential number | 1-1 | Sequential of the event for the same type of event The event author must number sequentially |
xCorrecao | Correction description to be carried out in the NF-e | 1-1 | E.g.: "VALIDADE DA LICENCA DE 01/09/2015 A 01/09/2016.". Sefaz won't accept correction letters in english. Translation: "License validity from DD/MM/YYYY to DD/MM/YYYY.". |
Request example
NF-e Disablement request
curl -X POST
\-H "Content-Type: application/json"
\-d '{"X-AUTH-TOKEN": "YOUR_TOKEN", "cUF": "43", "tpAmb": "2", "ano": "16", "CNPJ": "07364617000135", "serie": "0", "nNFIni": "9996", "nNFFin": "9996", "xJust": "Inutilizacao realizada para teste de integracao"}'
\https://nfe.ns.eti.br/util/generateinut
Returned data
Field | Description | Notes |
---|---|---|
status | Processing status code | |
motivo | Processing status literal description | |
xml | XML generated from the json | Only when status = 200 |
Return example
Successful return
{
"status": 200,
"motivo": "Xml gerado com sucesso",
"xml": "<inutNFe versao=\"4.00\" xmlns=\"http://www.portalfiscal.inf.br/nfe\" >....</inutNFe>"
}
Return codes
Code | Description |
---|---|
200 | XML generated successfully |