-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcartaCorrecao.js
38 lines (32 loc) · 1.12 KB
/
cartaCorrecao.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Informações da Carta de Correção
*
* A Carta de Correção Eletrônica (CC-e) é um evento legal e tem por objetivo
* corrigir algumas informações da NF-e que já foi emitida.
*/
var request = require("request");
var options = { method: 'POST',
url: 'https://webmaniabr.com/api/1/nfe/cartacorrecao/',
headers:
{
'content-type': 'application/json',
'cache-control': 'no-cache',
'x-access-token-secret': 'SEU_CONSUMER_KEY',
'x-access-token': 'SEU_CONSUMER_SECRET',
'x-consumer-secret': 'SEU_ACCESS_TOKEN',
'x-consumer-key': 'SEU_ACCESS_TOKEN_SECRET'
},
body:
{
chave: '00000000000000000000000000000000000000000000',
correcao: 'O CFOP correto é 5.102 referente a revenda tributada no mesmo estado.'
},
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
var status = body.status; // aprovado, reprovado, cancelado, processamento ou contingencia
var xml = body.xml; // Link para o XML
var dacce = body.dacce; // Link para dacce
var log = body.log; // Log de retorno do SEFAZ
});