Stackin API REST: NF-e e NFS-e
Stackin API REST: NF-e e NFS-e Emita e gerencie documentos fiscais com HTTP e JSON. A API REST do Stackin atende às mesmas operações dos SDKs oficiais — sem depender de uma biblioteca cliente. Autenticação e ambientes Envie sua chave no cabeçalho Authorization: Bearer. Cada chave pertence a uma empresa e a um ambiente: homologação ou produção. A chave também tem um contexto: chaves api funcionam…
Stackin API REST enables businesses to emit and manage fiscal documents using HTTP and JSON. The API follows the same operations as the official SDKs, without requiring a client library. Authentication is done through a Bearer token in the Authorization header, with each key belonging to an individual company and an environment: either homologation or production.
Keys are also context-specific, working with api.stackin.io for API keys and sdk.stackin.io for SDK keys. Each company can have up to three keys. Using the wrong host results in a 401 error. The API's contract mirrors that of the official SDKs, allowing direct integration via HTTP for languages without official SDKs or for those who prefer not to add dependencies.
To emit or reemit a note, include an Idempotency-Key header. Repetition of a call with the same key and body returns the original response, preventing duplicate emissions. Listings support offset and limit parameters, with a default limit of 20 records and a maximum of 100. Sorting can be done using sort_by and order_by parameters.
The response includes total, page, per_page, total_pages, next_page, prev_page, has_more, and the records themselves in data. Default pagination applies to notes, inutilizations, clients, items, received notes, webhook deliveries, and fiscal references. Error codes follow standard HTTP conventions; most responses include a detail field.
When SEFAZ or ADN rejects an operation, an error object is included in the response. A 400 error indicates missing or invalid company configuration, such as a certificate or address. A 401 error occurs when the key is absent, invalid, or used in the wrong host. A 402 error signifies attempting to emit or reemit in production without a quota or credit, while a 404 error means the document does not belong to the company.
A 409 error occurs when the operation is incompatible with the document, and a 422 error signifies invalid data or rejection by the authorizer. A 429 error denotes reaching the call limit, with the Retry-After header advising on retry timing. A 501 error occurs when the document type lacks implemented signature, and a 502 error indicates the authorizer is unreachable. A 503 error signifies SEFAZ unavailability or limitation for the company.
Include an Idempotency-Key header to avoid duplicate emissions when emitting or reemitting a note. If the same key and body are used for repeated calls, the API returns the original response, preventing duplicate emissions. Listings accept offset and limit parameters, with a default limit of 20 records and a maximum of 100. Sorting is achievable through sort_by and order_by parameters.
The response includes total, page, per_page, total_pages, next_page, prev_page, has_more, and the records in data. Pagination defaults apply to notes, inutilizations, clients, items, received notes, webhook deliveries, and fiscal references. Error codes follow standard HTTP conventions; most responses include a detail field. When SEFAZ or ADN rejects an operation, an error object is included in the response.
A 400 error indicates missing or invalid company configuration, such as a certificate or address. A 401 error occurs when the key is absent, invalid, or used in the wrong host. A 402 error signifies attempting to emit or reemit in production without a quota or credit, while a 404 error means the document does not belong to the company.
A 409 error occurs when the operation is incompatible with the document, and a 422 error signifies invalid data or rejection by the authorizer. A 429 error denotes reaching the call limit, with the Retry-After header advising on retry timing. A 501 error occurs when the document type lacks implemented signature, and a 502 error indicates the authorizer is unreachable. A 503 error signifies SEFAZ unavailability or limitation for the company.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to