REST API
Plain HTTP, JSON in and out, one Bearer API key — no SDK required.

Every Stackin capability is reachable through a documented, versioned REST API — JSON requests and responses, authenticated with an API key in the Authorization: Bearer header, tied to one company and one environment (homologation or production). Each company holds up to 3 keys, and a key is created with a context: one with the api context is valid on api.stackin.io, one with sdk on sdk.stackin.io, and on the wrong host the answer is 401.
It is the same contract the official Python, Node, Go and PHP SDKs are built on, so everything the SDK does, the raw API does too — useful for languages with no official client yet, or integrations that prefer not to add a dependency. Issuing and reissuing accept the Idempotency-Key header: repeating the call with the same key and the same body returns the first response instead of issuing a second invoice.
Pagination is uniform across the paginated listings (invoice history, invalidations, clients, the item catalog, received invoices, webhook deliveries and fiscal references): offset/limit on the request (default limit=20, max 100), plus sort_by/order_by for ordering; the response comes back with total, page, per_page, total_pages, next_page, prev_page, has_more and the rows in data — a single pagination helper covers the issuance history no matter how much the company's volume grows.
Errors use standard HTTP status codes, almost always with {"detail": "..."}; when the SEFAZ or the ADN refuses the operation, the body also carries an error block, and the status says whose problem it is. 400 is missing or invalid company configuration (certificate, address, fiscal fields); 401 is a missing, invalid or rotated key, or one created for another host; 402 is a production issuance or reissue with no allowance or credit left (cancelling and consulting don't charge again, and homologation never consumes); 404 is an invoice that doesn't belong to the company; 409 is an operation that doesn't apply to that document (a correction letter on an NFS-e, reissuing an already authorized invoice); 422 is validation with the offending field named in the body or, with code: AUTHORITY_REJECTED, data the authorizer refused; 429 is the call limit, with Retry-After in seconds; 501 is a document type whose signing isn't implemented yet; 503 is a SEFAZ that is paused or has throttled the company (codes 108, 109 and 656), and 502 is an authorizer that could not be reached.
The error block carries the authorizer's own code and message, our guidance when the cause is unambiguous, and retryable, which says whether repeating the same request can work later — the information that decides whether the fix is in your data or just trying again. Branch on it and on the status, never on the wording of detail.
There is no "SDK-only" functionality hidden behind the client libraries — the SDKs exist for typing, local validation and ergonomics, not to unlock capability the raw API lacks.
See the full API reference for authentication, pagination, error codes and every endpoint.