@stackin-io/stackin-node-sdk 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -1
- package/dist/client.d.ts +20 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +43 -3
- package/dist/client.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
Node/TypeScript SDK for fiscal document issuance — a handful of business fields, nothing about certificates, XML, XSD, signing or SOAP. The API resolves all of that from the issuer's own configuration, identified by `apiKey`.
|
|
20
20
|
|
|
21
|
-
**One class, `Invoice`** — `issue()`/`consult()`/`cancel()`, nothing else to instantiate. Each line item is a `br.Product` — `description`/`amount` are universal, everything else (`ncm`/`cfop`/`cest`/tax groups...) is Brazil-specific and only required for NFE; NFSE ignores it.
|
|
21
|
+
**One class, `Invoice`** — `issue()`/`consult()`/`cancel()`/`reissue()`, nothing else to instantiate. Each line item is a `br.Product` — `description`/`amount` are universal, everything else (`ncm`/`cfop`/`cest`/tax groups...) is Brazil-specific and only required for NFE; NFSE ignores it.
|
|
22
22
|
|
|
23
23
|
## Install
|
|
24
24
|
|
|
@@ -56,6 +56,11 @@ await client.cancel("ACCESS_KEY...", {
|
|
|
56
56
|
reason: "Typo",
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
+
// Retries a submission that never reached the authorizer, or was rejected by
|
|
60
|
+
// it. Takes the invoice's local id — not an access key, since a failed
|
|
61
|
+
// submission never got one. Consumes quota exactly like a fresh issue().
|
|
62
|
+
await client.reissue("9f2c1e3a-4b5d-6e7f-8a9b-0c1d2e3f4a5b");
|
|
63
|
+
|
|
59
64
|
// NFE requires ncm/cfop on every item, plus the buyer's full recipientAddress:
|
|
60
65
|
await client.issue({
|
|
61
66
|
documentType: DocumentType.NFE,
|
|
@@ -85,6 +90,100 @@ await client.issue({
|
|
|
85
90
|
|
|
86
91
|
`items` is an array of `br.Product` — `description`/`amount` apply to any document type; `ncm`/`cfop` (plus everything else on `Product`: `cest`, tax groups, presumed credits...) are Brazil-specific and required per item for NFE, ignored for NFSE (a service isn't a physical good).
|
|
87
92
|
|
|
93
|
+
## Retrying safely
|
|
94
|
+
|
|
95
|
+
Issuing is the one call you must not repeat blindly. If the response is lost — a
|
|
96
|
+
timeout, a dropped connection — the document may well have been authorized, and a
|
|
97
|
+
second attempt issues a **second** fiscal document: another credit, another number
|
|
98
|
+
burned, and undoing it means cancelling, which has a deadline.
|
|
99
|
+
|
|
100
|
+
Pass an idempotency key to make the retry safe:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
const key = randomUUID();
|
|
104
|
+
|
|
105
|
+
const result = await invoice.issue({
|
|
106
|
+
documentType: DocumentType.NFSE,
|
|
107
|
+
clientName: "Maria Silva",
|
|
108
|
+
taxId: "12345678909",
|
|
109
|
+
items: [new br.Product({ description: "Consultoria", amount: 1500.0 })],
|
|
110
|
+
idempotencyKey: key,
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Retry with the **same key and the same body** and you get the first response back,
|
|
115
|
+
replayed — no second document, no credit consumed. Reissue takes the same argument.
|
|
116
|
+
|
|
117
|
+
| Situation | What the API does |
|
|
118
|
+
|---|---|
|
|
119
|
+
| New key | issues normally, records the response |
|
|
120
|
+
| Same key, same body | replays the recorded response |
|
|
121
|
+
| Same key, different body | API error 422 |
|
|
122
|
+
| Same key, first call still running | API error 409 |
|
|
123
|
+
| Previous attempt failed | key is released — the retry issues |
|
|
124
|
+
| Key older than 24 hours | treated as new |
|
|
125
|
+
|
|
126
|
+
Generate the key yourself and keep it for as long as you might retry — one UUID per
|
|
127
|
+
business event, not per HTTP call. The SDK never generates one, because a key minted
|
|
128
|
+
per call would protect nothing, and because two genuinely separate invoices for the
|
|
129
|
+
same customer and amount on the same day are a normal thing to issue.
|
|
130
|
+
|
|
131
|
+
## Correcting a document
|
|
132
|
+
|
|
133
|
+
Some mistakes don't need a cancellation. A wrong product name, wrong
|
|
134
|
+
transport details, a typo in the extra information — a **CC-e** (carta de
|
|
135
|
+
correção) fixes those, and it is free: no new credit, no burned series
|
|
136
|
+
number, no reissue.
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
const result = await invoice.correct(
|
|
140
|
+
"35240912345678000199550010000000011000000017",
|
|
141
|
+
{
|
|
142
|
+
documentType: DocumentType.NFE,
|
|
143
|
+
correction: "Transportadora corrigida para Rapido Ltda",
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The correction text is 15 to 1000 characters, checked locally before the call.
|
|
149
|
+
|
|
150
|
+
What a CC-e **cannot** fix: anything that changes the tax owed (base, rate,
|
|
151
|
+
price, quantity, totals), the buyer or the seller, or the issue date. Those
|
|
152
|
+
still mean cancelling and reissuing. The API sends the legally fixed wording
|
|
153
|
+
that says exactly this, attached to every correction.
|
|
154
|
+
|
|
155
|
+
The original document does not change — the CC-e is an event attached to it, and
|
|
156
|
+
the authorized XML stays as it was. A document accepts at most 20 of them, and
|
|
157
|
+
they are numbered for you.
|
|
158
|
+
|
|
159
|
+
**NF-e only.** NFS-e has no correction letter, and asking for one returns
|
|
160
|
+
a `409`.
|
|
161
|
+
|
|
162
|
+
## Invalidating unused numbers
|
|
163
|
+
|
|
164
|
+
NF-e numbering is sequential and the SEFAZ expects it to have no gaps. A number
|
|
165
|
+
gets reserved the moment issuing starts, so a submission that fails afterwards —
|
|
166
|
+
a rejection, a timeout — leaves a hole in the series. Reporting that range is how
|
|
167
|
+
you close it.
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
const result = await invoice.invalidate({
|
|
171
|
+
series: "1",
|
|
172
|
+
numberStart: 10,
|
|
173
|
+
numberEnd: 12,
|
|
174
|
+
reason: "Numeracao reservada e nao utilizada por falha no ERP",
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
The reason is 15 to 255 characters and the range is inclusive; both are checked
|
|
179
|
+
locally, as is `number_end` not being below `number_start`.
|
|
180
|
+
|
|
181
|
+
A number that already reached the authorizer can't be invalidated. The API checks
|
|
182
|
+
its own records first and answers `409` naming the offending numbers, without a
|
|
183
|
+
round trip — and the authorizer checks again for what we can't see from here.
|
|
184
|
+
|
|
185
|
+
**NF-e only**, and it takes no access key: there is no document to point at.
|
|
186
|
+
|
|
88
187
|
## Errors
|
|
89
188
|
|
|
90
189
|
- `APIError` — the API responded with a non-2xx status (`statusCode`, `detail`) — a 401 here means `apiKey` is missing, wrong, or was rotated.
|
package/dist/client.d.ts
CHANGED
|
@@ -17,6 +17,13 @@ export interface IssueRequest {
|
|
|
17
17
|
recipientAddress?: Address;
|
|
18
18
|
series?: string;
|
|
19
19
|
number?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Makes a retry safe: repeating the same key with the same body
|
|
22
|
+
* replays the first response instead of issuing a second document.
|
|
23
|
+
* Keys live 24 hours. Never generated for you — only the caller
|
|
24
|
+
* knows which two requests are meant to be the same one.
|
|
25
|
+
*/
|
|
26
|
+
idempotencyKey?: string;
|
|
20
27
|
}
|
|
21
28
|
export declare class Invoice {
|
|
22
29
|
readonly baseUrl: string;
|
|
@@ -32,6 +39,19 @@ export declare class Invoice {
|
|
|
32
39
|
documentType: DocumentType;
|
|
33
40
|
reason: string;
|
|
34
41
|
}): Promise<Record<string, unknown>>;
|
|
42
|
+
invalidate(options: {
|
|
43
|
+
series: string;
|
|
44
|
+
numberStart: number;
|
|
45
|
+
numberEnd: number;
|
|
46
|
+
reason: string;
|
|
47
|
+
}): Promise<Record<string, unknown>>;
|
|
48
|
+
correct(accessKey: string, options: {
|
|
49
|
+
documentType: DocumentType;
|
|
50
|
+
correction: string;
|
|
51
|
+
}): Promise<Record<string, unknown>>;
|
|
52
|
+
reissue(invoiceId: string, options?: {
|
|
53
|
+
idempotencyKey?: string;
|
|
54
|
+
}): Promise<Record<string, unknown>>;
|
|
35
55
|
private headers;
|
|
36
56
|
private request;
|
|
37
57
|
}
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AAkBzD,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,gBAAgB,2BAA2B,CAAC;AAkBzD,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,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GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAmB9B,OAAO,CACX,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE;QAAE,YAAY,EAAE,YAAY,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,GAC1D,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAc7B,OAAO,CACX,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAO,GACxC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAMnC,OAAO,CAAC,OAAO;YAaD,OAAO;CAoDtB"}
|
package/dist/client.js
CHANGED
|
@@ -79,7 +79,10 @@ class Invoice {
|
|
|
79
79
|
payload.series = request.series;
|
|
80
80
|
if (request.number)
|
|
81
81
|
payload.number = request.number;
|
|
82
|
-
return this.request("POST", "/invoices", {
|
|
82
|
+
return this.request("POST", "/invoices", {
|
|
83
|
+
body: payload,
|
|
84
|
+
idempotencyKey: request.idempotencyKey,
|
|
85
|
+
});
|
|
83
86
|
}
|
|
84
87
|
async consult(accessKey, options) {
|
|
85
88
|
return this.request("GET", `/invoices/${accessKey}`, {
|
|
@@ -94,13 +97,50 @@ class Invoice {
|
|
|
94
97
|
},
|
|
95
98
|
});
|
|
96
99
|
}
|
|
97
|
-
|
|
100
|
+
async invalidate(options) {
|
|
101
|
+
const length = options.reason?.length ?? 0;
|
|
102
|
+
if (length < 15 || length > 255) {
|
|
103
|
+
throw new errors_1.ValidationError("reason must be 15 to 255 characters");
|
|
104
|
+
}
|
|
105
|
+
if (options.numberEnd < options.numberStart) {
|
|
106
|
+
throw new errors_1.ValidationError("numberEnd can't be below numberStart");
|
|
107
|
+
}
|
|
108
|
+
return this.request("POST", "/invoices/invalidations", {
|
|
109
|
+
body: {
|
|
110
|
+
series: options.series,
|
|
111
|
+
number_start: options.numberStart,
|
|
112
|
+
number_end: options.numberEnd,
|
|
113
|
+
reason: options.reason,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
async correct(accessKey, options) {
|
|
118
|
+
const length = options.correction?.length ?? 0;
|
|
119
|
+
if (length < 15 || length > 1000) {
|
|
120
|
+
throw new errors_1.ValidationError("correction must be 15 to 1000 characters");
|
|
121
|
+
}
|
|
122
|
+
return this.request("POST", `/invoices/${accessKey}/correction`, {
|
|
123
|
+
body: {
|
|
124
|
+
document_type: options.documentType,
|
|
125
|
+
correction: options.correction,
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
async reissue(invoiceId, options = {}) {
|
|
130
|
+
return this.request("POST", `/invoices/${invoiceId}/reissue`, {
|
|
131
|
+
idempotencyKey: options.idempotencyKey,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
headers(idempotencyKey) {
|
|
98
135
|
const headers = {
|
|
99
136
|
"Content-Type": "application/json",
|
|
100
137
|
};
|
|
101
138
|
if (this.apiKey) {
|
|
102
139
|
headers.Authorization = `Bearer ${this.apiKey}`;
|
|
103
140
|
}
|
|
141
|
+
if (idempotencyKey) {
|
|
142
|
+
headers["Idempotency-Key"] = idempotencyKey;
|
|
143
|
+
}
|
|
104
144
|
return headers;
|
|
105
145
|
}
|
|
106
146
|
async request(method, path, opts = {}) {
|
|
@@ -115,7 +155,7 @@ class Invoice {
|
|
|
115
155
|
try {
|
|
116
156
|
response = await this.fetchImpl(url, {
|
|
117
157
|
method,
|
|
118
|
-
headers: this.headers(),
|
|
158
|
+
headers: this.headers(opts.idempotencyKey),
|
|
119
159
|
body: opts.body !== undefined ? JSON.stringify(opts.body) : undefined,
|
|
120
160
|
signal: controller.signal,
|
|
121
161
|
});
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAEA,qCAA4E;AAC5E,mCAA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IAAI,CAAC;IAC1D,CAAC;CACF;AA7LD,0BA6LC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackin-io/stackin-node-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Node/TypeScript SDK for stackin — issue, consult and cancel Brazilian fiscal documents (NF-e, NFS-e) via a single Invoice client. No certificates, XML or SOAP.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stackin",
|