stackin
Back to blog
Get building

Quickstart

From signup to a first authorized document in one request, using an API key against homologation.

This assumes you already have an API key with context api and environment homologation — see Create an account if you don't. Homologation is free, has no volume limit, and exercises the same authorizer validation as production, just marked as a test transmission.

Every request carries the key as a Bearer token — there's no separate company_id or environment field to set, the key already resolves both. The base URL is https://api.stackin.io/api/v1.

To issue an NF-e, POST to /invoices with document_type set to nfe, the buyer's name and tax id, one or more items, and — for nfe specifically — items[].product.br with an ncm and cfop tax classification code (NFS-e skips this entirely, since a service has no such code). See the API reference for the full request/response example in cURL, Python, Go, or PHP.

A successful call returns 201 with an access_key, status, and the government protocol number — that access_key is what every later lookup (consult, cancel) is keyed on, so store it alongside your own record of the document.

The same call works for nfse — just change document_type and drop the product.br block, since it doesn't apply. Once this works in homologation, switching to production is only a matter of authenticating with a different key; nothing about the request shape changes.