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, consumes no credits, and exercises the same authorizer validation as production, just marked as a test transmission.
- An API key with context
apiand environmenthomologation. - A registered company with its e-CNPJ digital certificate uploaded.
- The base URL
https://api.stackin.io/api/v1.
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, the buyer's full address in recipient_address, one or more items, and — for nfe specifically — items[].product.br with an ncm and cfop tax classification code (NFS-e skips this, since a service has no such code). See the API reference for the full request/response example in cURL, Python, Go, PHP, or Node.
curl -X POST https://api.stackin.io/api/v1/invoices \
-H "Authorization: Bearer $STACKIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"document_type": "nfe",
"client_name": "Buyer Company Ltd",
"tax_id": "11222333000181",
"items": [
{
"description": "Rosa Holambra Vermelha",
"unit_price": "112.44",
"product": { "br": { "ncm": "06031100", "cfop": "5102" } }
}
],
"recipient_address": {
"street": "Rua das Flores",
"number": "1200",
"neighborhood": "Centro",
"city": "Joinville",
"state": "SC",
"zip_code": "89201100",
"city_code": "4209102"
}
}'If the company is in the regular tax regime, each item also carries the IBS/CBS group in product.br.ibs_cbs — mandatory from 2026, with cst and classification being your own tax decision. The example above doesn't send that group; see IBS/CBS in the reference.
A successful call returns 201 with a result object carrying the 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. If the authorizer refuses the document, the response is a 422 with the code AUTHORITY_REJECTED, and the rejected document isn't charged.
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.
A key belongs to exactly one environment for its whole lifetime. Moving to production means authenticating with a production key — there is no environment field to flip.