Stackin MCP
Official MCP server by Stackin for managing Brazilian fiscal documents. It allows AI agents to issue, query, cancel, correct, and explain rejection codes for NF-e (goods) and NFS-e (services) via natural language conversation, supporting OAuth 2.1 and API key authentication.
Endpoint and access
No sign-in to connect and list tools. Individual tools may still need a vendor account, credentials, or permissions; check the documented prerequisites.
https://mcp.stackin.io/mcpWhat its tools do
42 tools, grouped by the hints the server advertises. Hints are self-declared, not verified behavior.
Read-only (26)
consult_invoiceget_invoice_pdflist_invoicesget_invoice_submissionsinvoice_statslist_invalidationsvalidate_invoice_payloadlist_received_invoicesget_received_invoice_xmllookup_fiscal_codesearch_fiscal_codeslist_fiscal_kindslookup_taxpayersearch_citiescalculate_ibs_cbslist_authorized_companiesget_usageget_company_readinesslist_clientsget_clientlist_itemsget_itemexplain_rejectionclassify_itemlist_webhookslist_webhook_deliveries
Checks and signals
Each line is separate evidence, not a trust score.
- Passed Endpoint answered the live check ·
- Passed Endpoint and vendor documentation share a domain
- Uptime 100% over 90 days
- Availability 2 of 2 checks passed in 30 days
What you can do with it
- Emitir NF-e ou NFS-e
- Consultar documentos fiscais
- Cancelar notas fiscais
- Explicar rejeições do fisco
Source and maintenance
- Last repository push
- Maintenance checked
Protocol and capabilities
- Server
- stackin 0.15.0
- MCP protocol negotiated in check
- 2025-11-25
- Tools
- 42 advertised
- Resources
- 1 advertised
- Resource templates
- 0 advertised
- Prompts
- 10 advertised
{
"tools": {
"listChanged": false
},
"prompts": {
"listChanged": false
},
"resources": {
"subscribe": false,
"listChanged": false
},
"experimental": {}
}Server-provided instructions
Untrusted server output shown for inspection. It is not Koskamo guidance and is excluded from knowledge search.
Tools
42 advertised
issue_invoice
Issue a Brazilian fiscal document: NFS-e or NF-e. This produces a legal fiscal document. Confirm the data with the user before calling when you inferred any field. Send unit_price with quantity when the user quotes a price per unit, amount when they quote the line; both must agree. nfse is a service invoice: the address is optional and service_code (LC 116/2003 item.subitem) falls back to the company's fiscal profile. nfe is for goods, and the SEFAZ rejects a partial one: ncm and cfop on every item and the full recipient_address. Call validate_invoice_payload first when any of that was inferred. A complementary, adjustment or return NF-e sets purpose and names the original in referenced_keys; a return the company receives back sets direction in. An export has recipient_address state EX with country_code, the export group, and foreign_id for a passport. Look the recipient up with list_clients and pass its id as client_id. A new recipient is saved as a client after issuance. Pass idempotency_key, one per business event, when a retry is possible: the same key and payload replays the first answer. Without one, a retry after a lost response issues again, burning another credit and number that only a cancellation within its deadline undoes. Nothing generates the key for you. Before a company's first document, get_company_readiness says whether it can issue at all.
{
"type": "object",
"required": [
"document_type",
"items"
],
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"ncm": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^(00|\\d{8})$",
"description": "The full 8 digits, or 00 for a service line. Any other short code the SEFAZ rejects with 777."
},
"tax": {
"type": "object",
"description": "The item's taxes, already computed: icms, icms_uf_dest, ipi, pis, pis_st, cofins, cofins_st and v_tot_trib, each ICMS variant chosen by its cst or csosn. Leave it out unless the user gave the computed values. Full shape in the stackin://schemas/invoice-item resource."
},
"cest": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^\\d{7}$"
},
"cfop": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^[123567]\\d{3}$"
},
"fuel": {
"type": "object",
"description": "The NF-e fuel group (comb), needed for a fuel CFOP: anp_code (9 digits), anp_description and consumer_state, plus optional GLP percentages. Full shape in the stackin://schemas/invoice-item resource."
},
"unit": {
"type": "string",
"default": "UN"
},
"amount": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"barcode": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^(SEM GTIN|\\d{8}|\\d{12,14})$",
"description": "cEAN: a GTIN-8/12/13/14, or SEM GTIN."
},
"ex_tipi": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^\\d{2,3}$"
},
"freight": {
"type": [
"number",
"null"
],
"default": null
},
"ibs_cbs": {
"type": "object",
"description": "IBS/CBS: cst (3 digits), classification (cClassTrib, 6). nfe: rate_state, rate_city, rate_federal; base, reduction_ibs, reduction_cbs when they apply. nfse: operation_indicator (cIndOp, 6 digits) only. Full shape in the stackin://schemas/invoice-item resource."
},
"item_id": {
"type": [
"string",
"null"
],
"default": null,
"description": "A catalog item from list_items: fills what the line leaves out."
},
"discount": {
"type": [
"number",
"null"
],
"default": null
},
"quantity": {
"type": "number",
"default": 1,
"exclusiveMinimum": 0
},
"insurance": {
"type": [
"number",
"null"
],
"default": null
},
"nve_codes": {
"type": [
"array",
"null"
],
"items": {
"type": "string",
"pattern": "^[A-Z]{2}\\d{4}$"
},
"default": null
},
"ind_escala": {
"type": [
"string",
"null"
],
"default": null
},
"net_weight": {
"type": [
"number",
"null"
],
"description": "kg per unit, NF-e only."
},
"unit_price": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"description": {
"type": [
"string",
"null"
],
"default": null,
"minLength": 1,
"description": "Required unless item_id names a catalog item."
},
"extra_groups": {
"type": [
"object",
"null"
],
"default": null,
"additionalProperties": true
},
"gross_weight": {
"type": [
"number",
"null"
],
"description": "kg per unit, NF-e only."
},
"observations": {
"type": [
"string",
"null"
],
"default": null,
"maxLength": 2000,
"description": "nfse only."
},
"service_code": {
"type": [
"string",
"null"
],
"default": null,
"description": "LC 116/2003 item.subitem, nfse only."
},
"tax_retained": {
"type": "boolean",
"default": false,
"description": "ISSQN retained by the tomador, nfse only."
},
"recopi_number": {
"type": [
"string",
"null"
],
"default": null,
"description": "nRECOPI: 20 digits, the last two modulo-11 check digits."
},
"other_expenses": {
"type": [
"number",
"null"
],
"default": null
},
"purchase_order": {
"type": [
"string",
"null"
],
"default": null
},
"presumed_credits": {
"type": [
"array",
"null"
],
"items": {
"type": "object",
"required": [
"code",
"percentage",
"amount"
],
"properties": {
"code": {
"type": "string",
"pattern": "^[\\x21-\\xff]{8}$|^[\\x21-\\xff]{10}$"
},
"amount": {
"type": "number"
},
"percentage": {
"type": "number"
}
},
"description": "A presumed tax credit applied to this item."
},
"default": null
},
"service_discount": {
"type": [
"number",
"null"
],
"default": null,
"description": "Unconditional discount, nfse only."
},
"tax_benefit_code": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^(SEM CBENEF|[\\x21-\\xff]{8}|[\\x21-\\xff]{10})$"
},
"manufacturer_cnpj": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^[0-9A-Z]{12}\\d{2}$"
},
"used_movable_asset": {
"type": "boolean",
"default": false
},
"purchase_order_item": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^\\d{1,6}$"
},
"import_content_control_number": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}$"
}
}
},
"description": "One entry per line. Each needs a description and a price: unit_price with quantity, or amount for the whole line, or an item_id from list_items for these and the fiscal codes; what the line sends wins. nfe also needs ncm (8 digits) and cfop (4 digits) on every item; nfse may carry service_code. Groups in full: the stackin://schemas/invoice-item resource."
},
"change": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "nfe, optional. Change given back (vTroco), BRL."
},
"export": {
"type": [
"object",
"null"
],
"default": null,
"required": [
"exit_state",
"place"
],
"properties": {
"place": {
"type": "string",
"maxLength": 60,
"minLength": 1
},
"exit_state": {
"type": "string",
"maxLength": 2,
"minLength": 2
},
"dispatch_place": {
"type": [
"string",
"null"
],
"default": null,
"maxLength": 60,
"minLength": 1
}
},
"description": "Where the goods leave Brazil (exporta): exit_state (UF), place (e.g. Porto de Santos), optional dispatch_place (customs). Required for an nfe to a buyer abroad (state EX), refused otherwise."
},
"number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Document number, e.g. 1532. Omitted means the company's next; set it only to fill a known gap."
},
"series": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Document series (série), e.g. 1. Omitted means the company's default series."
},
"tax_id": {
"type": "string",
"default": "",
"maxLength": 18,
"description": "Recipient's CPF or CNPJ. Required unless client_id is sent."
},
"purpose": {
"anyOf": [
{
"enum": [
"normal",
"complementary",
"adjustment",
"return"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Why the NF-e is issued (finNFe): normal, complementary, adjustment or return of goods. nfe only; omitted means normal."
},
"discount": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "Discount on the whole document, BRL, e.g. 15.50, spread over the lines pro rata. Omitted means none; a per-line one goes on the item."
},
"payments": {
"type": [
"array",
"null"
],
"items": {
"type": "object"
},
"default": null,
"description": "nfe, optional, up to 100: {method (tPag, e.g. 01 cash, 03 credit card, 17 Pix, 99 other with description), amount, description, card {integration, tax_id, brand, authorization}}. Ask the user, never infer."
},
"presence": {
"anyOf": [
{
"enum": [
"0",
"1",
"2",
"3",
"5",
"9"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "nfe, optional. Buyer presence (indPres): 1 in person, 2 internet, 3 phone, 5 off-site, 9 other, 0 n/a. Ask the user."
},
"client_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A saved client's id, from list_clients: it fills what this call leaves out. Without it, client_name and tax_id are required."
},
"direction": {
"anyOf": [
{
"enum": [
"out",
"in"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "out for an outgoing NF-e (CFOP 5/6/7); in for goods coming in, such as a sale returned (CFOP 1/2/3). nfe only; omitted means out."
},
"issued_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Emission date-time (dhEmi), ISO 8601 with offset, e.g. 2026-11-15T09:30:00-03:00; one without an offset is refused. Omitted means now. nfe: up to 30 days back, 5 minutes ahead; nfse: never future. Set it only when the user asks."
},
"transport": {
"type": [
"object",
"null"
],
"default": null,
"description": "nfe, optional. freight_mode (modFrete): 0 sender, 1 recipient, 2 third party, 3 sender's own, 4 recipient's own, 9 none; ask the user, never infer. volumes: [{quantity, species, brand, numbering, net_weight, gross_weight in kg}]."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"foreign_id": {
"anyOf": [
{
"type": "string",
"maxLength": 20,
"minLength": 5
},
{
"type": "null"
}
],
"default": null,
"description": "Passport or other document of a buyer abroad (state EX). nfe only; may be omitted."
},
"client_name": {
"type": "string",
"default": "",
"maxLength": 120,
"description": "Recipient's name. Required unless client_id is sent."
},
"contingency": {
"type": "boolean",
"default": false,
"description": "nfe only: use the contingency authorizer (SVC-AN or SVC-RS) because the state's is down. Only when the user says so, never as a retry for a rejection."
},
"client_email": {
"anyOf": [
{
"type": "string",
"maxLength": 254
},
{
"type": "null"
}
],
"default": null,
"description": "Optional. Recipient e-mail, written into the document when valid. Omitted: client_id's."
},
"client_phone": {
"anyOf": [
{
"type": "string",
"maxLength": 20
},
{
"type": "null"
}
],
"default": null,
"description": "Optional. Recipient phone, written into the document when valid. Omitted: client_id's."
},
"intermediary": {
"type": [
"object",
"null"
],
"default": null,
"description": "nfe, optional. Marketplace the sale went through: tax_id (CNPJ) and identifier (the seller's id there)."
},
"document_type": {
"enum": [
"nfse",
"nfe"
],
"type": "string",
"description": "nfse for a service invoice, nfe for goods."
},
"update_client": {
"type": "boolean",
"default": false,
"description": "Save the recipient data sent here onto client_id's client."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"idempotency_key": {
"anyOf": [
{
"type": "string",
"pattern": "^[!-~](?:[ -~]*[!-~])?$",
"maxLength": 255,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "One per business event, e.g. order-1042. Printable ASCII up to 255, no leading or trailing space."
},
"referenced_keys": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null,
"description": "Access keys of the NF-e being returned, complemented or adjusted. Required for complementary (exactly one) and most returns. nfe only."
},
"recipient_address": {
"type": [
"object",
"null"
],
"default": null,
"properties": {
"city": {
"type": [
"string",
"null"
],
"default": null
},
"state": {
"type": [
"string",
"null"
],
"default": null
},
"number": {
"type": [
"string",
"null"
],
"default": null
},
"street": {
"type": [
"string",
"null"
],
"default": null
},
"zip_code": {
"type": [
"string",
"null"
],
"default": null
},
"city_code": {
"type": [
"string",
"null"
],
"default": null
},
"country_code": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^[0-9]{1,4}$",
"description": "BACEN code, 1 to 4 digits. Required, not 1058, when state is EX."
},
"country_name": {
"type": [
"string",
"null"
],
"default": null
},
"neighborhood": {
"type": [
"string",
"null"
],
"default": null
},
"state_registration": {
"type": [
"string",
"null"
],
"default": null,
"description": "IE, NF-e only: the number for an ICMS contributor, ISENTO if exempt, left out for a non-contributor."
}
},
"description": "Required for nfe, with street, number, neighborhood, city, state (UF), zip_code (8 digits) and city_code (7-digit IBGE, e.g. 3550308); optional for nfse. Abroad: state EX and country_code. With client_id, omit it to use the saved one."
},
"external_reference": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"default": null,
"description": "The caller's own id for this document, such as an order number. Stored as sent and returned on every read."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "issued, rejected or cancelled."
},
"protocol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorization protocol, when granted."
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorizer's key. Absent while the document is not authorized."
}
},
"description": "One document, as the fiscal API describes it.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": true
}consult_invoice
Look up an invoice's current status. Read-only. After an OUTCOME_UNKNOWN issuance, consult its document_id: the dps_id of an nfse, the access_key of an nfe. A 404 on a dps_id means nothing was issued.
{
"type": "object",
"required": [
"document_type"
],
"properties": {
"dps_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "nfse instead of access_key: its DPS id."
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The access key (chave de acesso) the authorizer assigned, as issue_invoice and list_invoices return it. An NF-e key has 44 characters; the issuer's CNPJ inside it may carry letters since July 2026, so copy it exactly."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"document_type": {
"enum": [
"nfse",
"nfe"
],
"type": "string",
"description": "nfse for a service invoice, nfe for goods."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "issued, rejected or cancelled."
},
"protocol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorization protocol, when granted."
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorizer's key. Absent while the document is not authorized."
}
},
"description": "One document, as the fiscal API describes it.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}cancel_invoice
Cancel an authorized invoice. Legal cancellation, with fiscal and accounting effect, inside a window the NFS-e authorizer enforces for the municipality. Ask the human to confirm before calling; never call it speculatively. The reason reaches the tax authority verbatim and must be at least 15 characters. Pass idempotency_key to make a retry safe: repeating the same key with the same access key and reason replays the first answer instead of cancelling a second time. Reuse the key only when retrying that exact call; a genuinely new cancellation needs a new key, or none. Nothing generates one for you — two calls without a key are two cancellations.
{
"type": "object",
"required": [
"access_key",
"document_type",
"reason"
],
"properties": {
"reason": {
"type": "string",
"maxLength": 256,
"minLength": 15,
"description": "Why the document is cancelled, 15 to 256 characters. It reaches the tax authority verbatim, e.g. Erro no valor do servico prestado."
},
"access_key": {
"type": "string",
"description": "The access key (chave de acesso) the authorizer assigned, as issue_invoice and list_invoices return it. An NF-e key has 44 characters; the issuer's CNPJ inside it may carry letters since July 2026, so copy it exactly."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"document_type": {
"enum": [
"nfse",
"nfe"
],
"type": "string",
"description": "nfse for a service invoice, nfe for goods."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"idempotency_key": {
"anyOf": [
{
"type": "string",
"pattern": "^[!-~](?:[ -~]*[!-~])?$",
"maxLength": 255,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "One per business event, e.g. order-1042. Printable ASCII up to 255, no leading or trailing space."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "issued, rejected or cancelled."
},
"protocol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorization protocol, when granted."
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorizer's key. Absent while the document is not authorized."
}
},
"description": "One document, as the fiscal API describes it.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": true
}get_invoice_pdf
Return the printable rendering of a document, as a PDF. Works for both types — a DANFE for nfe, a DANFSe for nfse. The PDF comes back base64-encoded in content_base64, with its size in size_bytes; the XML, not this, is the legally valid document. A PDF above 2 MB is not inlined: the answer says to download it from the API instead. A 502 from here means the authorizer is unavailable, not that the invoice is wrong.
{
"type": "object",
"required": [
"access_key",
"document_type"
],
"properties": {
"access_key": {
"type": "string",
"description": "The access key (chave de acesso) the authorizer assigned, as issue_invoice and list_invoices return it. An NF-e key has 44 characters; the issuer's CNPJ inside it may carry letters since July 2026, so copy it exactly."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"document_type": {
"enum": [
"nfse",
"nfe"
],
"type": "string",
"description": "nfse for a service invoice, nfe for goods."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"required": [
"access_key",
"content_base64"
],
"properties": {
"access_key": {
"type": "string"
},
"size_bytes": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Size of the decoded PDF, in bytes."
},
"content_type": {
"type": "string",
"default": "application/pdf"
},
"content_base64": {
"type": "string",
"description": "The PDF bytes, base64-encoded. Decode before saving."
}
},
"description": "A printed document, base64-encoded because a tool answer is JSON."
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}reissue_invoice
Retry a rejected invoice after the data that caused the rejection was fixed. Takes the local invoice_id, not the access key: a rejected document never got one. Consumes a credit like a new issuance, so it takes an idempotency_key for the same reason issue_invoice does. An authorized invoice is corrected or cancelled, never reissued.
{
"type": "object",
"required": [
"invoice_id"
],
"properties": {
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"invoice_id": {
"type": "string",
"description": "The local invoice id (a UUID), as list_invoices and issue_invoice return it. Not the access key."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"idempotency_key": {
"anyOf": [
{
"type": "string",
"pattern": "^[!-~](?:[ -~]*[!-~])?$",
"maxLength": 255,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "One per business event, e.g. order-1042. Printable ASCII up to 255, no leading or trailing space."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "issued, rejected or cancelled."
},
"protocol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorization protocol, when granted."
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorizer's key. Absent while the document is not authorized."
}
},
"description": "One document, as the fiscal API describes it.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": true
}correct_invoice
File an electronic correction letter (CC-e) against an NF-e. NF-e only: there is no correction letter for an NFS-e, where a wrong document is cancelled and issued again. It corrects wording and non-fiscal fields only. It cannot change values, taxes, the recipient or the products — those still require cancelling and issuing again, and telling the user a CC-e will fix an amount is wrong in a way they only discover at an audit. Each letter supersedes the previous one and the SEFAZ keeps at most 20 per document. The text reaches the tax authority verbatim.
{
"type": "object",
"required": [
"access_key",
"correction"
],
"properties": {
"access_key": {
"type": "string",
"description": "The access key (chave de acesso) the authorizer assigned, as issue_invoice and list_invoices return it. An NF-e key has 44 characters; the issuer's CNPJ inside it may carry letters since July 2026, so copy it exactly."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"correction": {
"type": "string",
"maxLength": 1000,
"minLength": 15,
"description": "The corrected wording, 15 to 1000 characters, sent verbatim, e.g. Onde se le Rua A, leia-se Rua B. Replaces any earlier letter, so repeat what still applies."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "issued, rejected or cancelled."
},
"protocol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorization protocol, when granted."
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorizer's key. Absent while the document is not authorized."
}
},
"description": "One document, as the fiscal API describes it.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": true
}invalidate_numbering
Declare an NF-e numbering range reserved but never used. NF-e numbering has to be continuous, so a gap left by a failed issuance is explained to the SEFAZ with this — not with a new document. Irreversible: a number declared unused can never be used. Only for numbers that were never authorized. An authorized document is cancelled, never invalidated. Confirm the range with the user and read it back before calling: the range is inclusive, and one digit wrong burns numbers the company still needs. The SDK refuses a backwards range and a reason outside 15-255 characters before anything is transmitted.
{
"type": "object",
"required": [
"series",
"number_start",
"number_end",
"reason"
],
"properties": {
"reason": {
"type": "string",
"maxLength": 255,
"minLength": 15,
"description": "Why the numbers went unused, 15 to 255 characters, sent verbatim, e.g. Falha no sistema durante a emissao."
},
"series": {
"type": "string",
"description": "The NF-e series of the range, e.g. 1."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"number_end": {
"type": "integer",
"minimum": 1,
"description": "Last unused number, inclusive; equal to number_start for a single number."
},
"number_start": {
"type": "integer",
"minimum": 1,
"description": "First unused number, inclusive."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Local id. Use it for reissue and for submissions, and when a document was rejected and has no key."
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "issued, rejected or cancelled."
},
"protocol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorization protocol, when granted."
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorizer's key. Absent while the document is not authorized."
}
},
"description": "One document, as the fiscal API describes it.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": true
}list_invoices
List the invoices this company issued, newest first. One document type at a time: pass nfse for services or nfe for goods. A company that issues both has to be asked twice. Use it for "my last invoices", "what was rejected today", and to find a document whose access key the user does not have at hand. Read-only. An authorized document is stored as issued, which is the value the rows carry; authorized is accepted as a synonym and asks for the same thing. Every row carries both identifiers the other tools need: id, which reissue_invoice takes, and access_key, which consult_invoice, cancel_invoice and get_invoice_pdf take. A rejected row has an id and no access key — the authorizer never assigned one.
{
"type": "object",
"properties": {
"limit": {
"type": "integer",
"default": 20,
"maximum": 100,
"minimum": 1,
"description": "Rows per page, 1 to 100."
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Rows to skip, for the next page: offset + limit."
},
"status": {
"anyOf": [
{
"enum": [
"issued",
"authorized",
"rejected",
"cancelled"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Only rows in this state. authorized is a synonym for issued. All states when omitted."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"document_type": {
"enum": [
"nfse",
"nfe"
],
"type": "string",
"default": "nfse",
"description": "nfse for a service invoice, nfe for goods."
},
"include_items": {
"type": "boolean",
"default": false,
"description": "Keep each row's item lines and fiscal_operation. Off by default: they are most of the size, and a page of 100 NF-e with them is about 130 KB. consult_invoice brings one document's lines back."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"external_reference": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Only documents with this external_reference."
}
}
}{
"type": "object",
"$defs": {
"InvoiceListItem": {
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"created_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"client_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"document_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One row of the issuance history.",
"additionalProperties": true
}
},
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/InvoiceListItem"
},
"description": "The rows on this page."
},
"page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"total": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "How many exist, not how many are here."
},
"per_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"next_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"prev_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"total_pages": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "A page of documents this company issued, newest first.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}get_invoice_submissions
Show every attempt made for one invoice and what came back. This is the tool that answers "why was it rejected". consult_invoice gives the status; this gives the tax authority's own code, its message, and the request and response exactly as they went over the wire. Read-only. It takes the invoice_id, like reissue_invoice — a rejected document has no access key to look it up by. Get the id from list_invoices. The rows are attempts, not documents: a reissued invoice has more than one, oldest first, and only the last describes the current state. Quote the authority's message rather than paraphrasing it; the code is what the user will search for.
{
"type": "object",
"required": [
"invoice_id"
],
"properties": {
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"invoice_id": {
"type": "string",
"description": "The local invoice id (a UUID), as list_invoices and issue_invoice return it. Not the access key."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"$defs": {
"SubmissionAttempt": {
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"detail": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authorizer's message. The reason a document was rejected, in its own words."
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"created_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"environment": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "homologation or production."
},
"http_status": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"raw_request": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"raw_response": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One transmission attempt, and what the authorizer answered.\n\nThis is where a rejection's reason lives: `detail` carries the tax\nauthority's own words, and `raw_response` its full answer.",
"additionalProperties": true
}
},
"properties": {
"attempts": {
"type": "array",
"items": {
"$ref": "#/$defs/SubmissionAttempt"
}
},
"invoice_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Every attempt made for one document, oldest first.\n\nOnly the last attempt describes the current state; the earlier ones\nare why it got there.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}invoice_stats
Count this company's documents, and compare recent days. The answer to "how many invoices this month", "how much did I bill" and "is rejection going up": totals by document type and by status over everything, then issued and rejected counts and the amount for the last `days` beside the `days` before them, and one row per day. In the connection's environment only. Read-only.
{
"type": "object",
"properties": {
"days": {
"type": "integer",
"default": 30,
"maximum": 365,
"minimum": 1,
"description": "The window compared with the one before it, in days. 30 by default."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"$defs": {
"PeriodSummary": {
"type": "object",
"properties": {
"amount_sum": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"issued_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"rejected_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Issued and rejected counts over one window.",
"additionalProperties": true
}
},
"properties": {
"total": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"by_status": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
{
"type": "null"
}
],
"default": null
},
"period_days": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"daily_series": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "One row per day: date, count, amount."
},
"current_period": {
"anyOf": [
{
"$ref": "#/$defs/PeriodSummary"
},
{
"type": "null"
}
],
"default": null
},
"previous_period": {
"anyOf": [
{
"$ref": "#/$defs/PeriodSummary"
},
{
"type": "null"
}
],
"default": null
},
"by_document_type": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Counts of the company's documents, and the last days against the\nones before.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}list_invalidations
List the NF-e numbering ranges this company already declared unused, newest first. Read it before invalidate_numbering: a range reported twice is refused, and one that overlaps a past report means the gap was already explained. Each row has the series, the inclusive range, the reason, the SEFAZ status and its protocol. Read-only.
{
"type": "object",
"properties": {
"limit": {
"type": "integer",
"default": 20,
"maximum": 100,
"minimum": 1,
"description": "Rows per page, 1 to 100."
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Rows to skip, for the next page: offset + limit."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"$defs": {
"InvalidationItem": {
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"reason": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"series": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"protocol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"created_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"number_end": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"number_start": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One numbering range already declared unused.",
"additionalProperties": true
}
},
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/InvalidationItem"
}
},
"page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"total": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"per_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"next_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"prev_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "A page of invalidated ranges, newest first.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}validate_invoice_payload
Dry-run issue_invoice: the API runs issuance's pre-authority checks (company blockers; NCM, CEST, IBS/CBS and presumed-credit tables; layout and cross-field rules). Nothing is sent, numbered, stored or charged. Malformed fields come back first, without the API. It does not replace issuing: the authorizer can still reject what passes (recipient registration, a number already used).
{
"type": "object",
"required": [
"document_type",
"items"
],
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
},
"description": "As issue_invoice takes them."
},
"change": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"export": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"number": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"series": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"tax_id": {
"type": "string",
"default": "",
"description": "As in issue_invoice."
},
"purpose": {
"anyOf": [
{
"enum": [
"normal",
"complementary",
"adjustment",
"return"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"discount": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"payments": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"presence": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"client_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"direction": {
"anyOf": [
{
"enum": [
"out",
"in"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"issued_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"transport": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"foreign_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"client_name": {
"type": "string",
"default": "",
"description": "As in issue_invoice."
},
"contingency": {
"type": "boolean",
"default": false,
"description": "As in issue_invoice."
},
"intermediary": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"document_type": {
"enum": [
"nfse",
"nfe"
],
"type": "string",
"description": "nfse for a service invoice, nfe for goods."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"referenced_keys": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
},
"recipient_address": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "As in issue_invoice."
}
}
}{
"type": "object",
"$defs": {
"ValidationFinding": {
"type": "object",
"required": [
"message"
],
"properties": {
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"field": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The request path to fix."
},
"fix_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string"
},
"expected": {
"default": null
},
"received": {
"default": null
},
"sefaz_rejection": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One rule the payload broke, or one warning about it."
}
},
"required": [
"document_type",
"valid",
"checked"
],
"properties": {
"valid": {
"type": "boolean",
"description": "No rule broken. The authorizer can still reject it."
},
"errors": {
"type": "array",
"items": {
"$ref": "#/$defs/ValidationFinding"
}
},
"checked": {
"enum": [
"local",
"api"
],
"type": "string",
"description": "local: field checks failed, the API rules did not run. api: the API ran issuance's pre-authority rules."
},
"warnings": {
"type": "array",
"items": {
"$ref": "#/$defs/ValidationFinding"
}
},
"document_type": {
"type": "string"
}
},
"description": "The result of checking a payload without issuing anything."
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}list_received_invoices
List NF-e documents other companies issued against this one. The mirror of list_invoices: that one shows what this company issued, this one what it received. Read-only. It reads what the API already collected and never calls the tax authority; collection runs every six hours and sync_received_invoices asks now. Each row carries the issuer, the amount, has_full_document and, once one was filed, the manifestation; final_answer_due means only an awareness was filed. Before a manifestation the authority sends a summary only; the full document arrives after one. Past the plan's monthly allowance each new one costs credit (get_usage).
{
"type": "object",
"properties": {
"limit": {
"type": "integer",
"default": 20,
"maximum": 100,
"minimum": 1,
"description": "Rows per page, 1 to 100."
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Rows to skip, for the next page: offset + limit."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"$defs": {
"ReceivedItem": {
"type": "object",
"properties": {
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issuer_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Who issued it against this company."
},
"issuer_tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"manifestation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The position already filed, when there is one. Before a manifestation the authority sends a summary only."
},
"final_answer_due": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "A conclusive answer is still owed."
},
"has_full_document": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One document another company issued against this one.",
"additionalProperties": true
}
},
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/ReceivedItem"
}
},
"page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"total": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"per_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"next_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"prev_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "A page of documents issued against this company, newest first.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}sync_received_invoices
Ask the tax authority now for NF-e issued against this company. Collection already runs every six hours. After a read that finds nothing more the authority imposes a one-hour wait; inside it this is refused with the time to retry. Never retry in a loop.
{
"type": "object",
"properties": {
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"pages": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"stored": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"next_sync_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "What one read of the tax authority's distribution brought back.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}manifest_received_invoice
Declare this company's position on a document issued against it. Legally binding and irreversible once the tax authority accepts it — ask the human to confirm before calling, and read back which document and which of the four positions is being filed. Denying a document (210220) or declaring the operation did not happen (210240) is an accusation against whoever issued it. Never pick either because the user sounds unsure — ask. 210200 confirms the operation happened, 210210 acknowledges the document exists, 210220 denies knowing it, and 210240 states the operation was not carried out. Only 210240 takes a reason, and it requires one; the others are refused if a reason is sent.
{
"type": "object",
"required": [
"access_key",
"manifestation"
],
"properties": {
"reason": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Required with 210240 and refused with any other code, e.g. Mercadoria nao foi entregue."
},
"access_key": {
"type": "string",
"description": "The 44-character access key of the received NF-e, as list_received_invoices returns it."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"manifestation": {
"enum": [
"210200",
"210210",
"210220",
"210240"
],
"type": "string",
"description": "210200 confirms the operation, 210210 acknowledges the document, 210220 denies knowing it, 210240 states the operation was not carried out."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"protocol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The receipt, when the authority gave one."
},
"access_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"manifestation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The code that was filed."
}
},
"description": "What the tax authority answered to a filed manifestation.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": true
}get_received_invoice_xml
Return the full XML (procNFe) of an NF-e issued against this company. Read-only and never charged. Only when list_received_invoices shows has_full_document; for a summary the answer says to manifest first. An XML above 500 KB is not inlined: the answer says to download it from the API instead.
{
"type": "object",
"required": [
"access_key"
],
"properties": {
"access_key": {
"type": "string",
"description": "The 44-character access key of the received NF-e, as list_received_invoices returns it."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"required": [
"access_key",
"xml",
"size_bytes"
],
"properties": {
"xml": {
"type": "string",
"description": "The procNFe, as stored."
},
"access_key": {
"type": "string"
},
"size_bytes": {
"type": "integer"
}
},
"description": "The full XML of a received NF-e."
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}lookup_fiscal_code
Resolve one code of one classification, when you know both. Use this to confirm a code before putting it on a document — an NCM that does not exist is rejected by the tax authority after issuing, which costs a cancellation. A code that is not there answers 404. That means the code is wrong, not that the lookup failed; do not retry it. `metadata` differs per kind and is passed through as published: utrib on an NCM, ncm_code on a CEST, tax_type on a CST, and nothing at all on an ISS service.
{
"type": "object",
"required": [
"kind",
"code"
],
"properties": {
"code": {
"type": "string",
"description": "The code itself, as published: 84716052 for an NCM, 5102 for a CFOP. Digits only, no dots."
},
"kind": {
"type": "string",
"description": "cfop, ncm, cest, cst, csosn, ..."
},
"country": {
"type": "string",
"default": "BR",
"maxLength": 2,
"minLength": 2,
"description": "ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess."
}
}
}{
"type": "object",
"properties": {
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"kind": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "cfop, ncm, cest, cst, csosn, ..."
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"metadata": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "Whatever the classification carries beyond a code and a description, and it differs per kind: utrib on an NCM, ncm_code on a CEST, tax_type on a CST, null on an ISS service."
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One code of one classification.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}search_fiscal_codes
Find a code from a description, or page through a table. This is the tool for "what NCM is a keyboard" — the one the user actually asks. Prefer it over guessing a code from memory: the tables change, and a plausible wrong code is worse than a lookup. Leaving `kind` unset searches every classification of that country at once, which is the most expensive call here. Set it whenever the question already names one. Rows come back ordered by kind then code; there is no sort argument, and asking for one changes nothing.
{
"type": "object",
"properties": {
"kind": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Narrows to one classification. All if unset."
},
"term": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Matches the code or the description."
},
"limit": {
"type": "integer",
"default": 20,
"maximum": 100,
"minimum": 1,
"description": "Rows per page. 20 by default."
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Rows to skip. Use it to page, not to narrow — a term is cheaper than paging to find one row."
},
"country": {
"type": "string",
"default": "BR",
"maxLength": 2,
"minLength": 2,
"description": "ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess."
}
}
}{
"type": "object",
"$defs": {
"FiscalReferenceItem": {
"type": "object",
"properties": {
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"kind": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "cfop, ncm, cest, cst, csosn, ..."
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"metadata": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "Whatever the classification carries beyond a code and a description, and it differs per kind: utrib on an NCM, ncm_code on a CEST, tax_type on a CST, null on an ISS service."
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One code of one classification.",
"additionalProperties": true
}
},
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/FiscalReferenceItem"
}
},
"page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"total": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"per_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"next_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"prev_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "A page of one classification, ordered by kind then code.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}list_fiscal_kinds
Which classifications this country has data for, right now. Ask this before assuming a classification exists. The answer grows as the source data does, so a name absent here is absent today rather than absent forever.
{
"type": "object",
"properties": {
"country": {
"type": "string",
"default": "BR",
"maxLength": 2,
"minLength": 2,
"description": "ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess."
}
}
}{
"type": "object",
"properties": {
"kinds": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Which classifications this country has data for, right now.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}lookup_taxpayer
Look up one taxpayer by exact tax id, to confirm who it is. Use it to check a recipient's name before issuing against them. It takes the id exactly — punctuation is fine, but there is no search by name, by prefix or by state, and there will not be: the registry holds the names and addresses of real people. A 404 does not mean the company does not exist. The registry reloads monthly from the RFB's dump, so a recently registered CNPJ is simply not in it yet. Say that to the user rather than reporting the tax id as invalid, and never turn a 404 here into a validation rule.
{
"type": "object",
"required": [
"tax_id"
],
"properties": {
"tax_id": {
"type": "string",
"description": "The exact tax id. A CNPJ is 14 characters and may carry letters in its first 12 since July 2026 (e.g. 12ABC34501DE35); a CPF is 11 digits. Punctuation is fine."
},
"country": {
"type": "string",
"default": "BR",
"maxLength": 2,
"minLength": 2,
"description": "ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess."
}
}
}{
"type": "object",
"properties": {
"kind": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether it is a company or a person."
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"status": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"metadata": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "Whatever the registry holds beyond these."
},
"city_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"started_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"trade_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"postal_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"activity_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One registered taxpayer, as the registry describes it.\n\nEverything but country, tax_id, kind and name can be absent: the\nregistry publishes what it has.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}search_cities
Find a municipality's IBGE code from its name. Issuing resolves city_code from city and state by itself, so this is for the name that matches more than one city, or an address the API answered CITY_NOT_FOUND for. Returns at most 20, each with its code, name and state; ask the user which one when more than one fits. Read-only.
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"maxLength": 100,
"minLength": 2,
"description": "The start of the city's name, accents optional, e.g. santa rita."
},
"state": {
"anyOf": [
{
"type": "string",
"maxLength": 2,
"minLength": 2
},
{
"type": "null"
}
],
"default": null,
"description": "Narrows to one UF, e.g. SP."
},
"country": {
"type": "string",
"default": "BR",
"maxLength": 2,
"minLength": 2,
"description": "ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess."
}
}
}{
"type": "object",
"$defs": {
"City": {
"type": "object",
"properties": {
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "For Brazil, the 7-digit IBGE code city_code takes."
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"country": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One municipality and its code.",
"additionalProperties": true
}
},
"properties": {
"cities": {
"type": "array",
"items": {
"$ref": "#/$defs/City"
}
}
},
"description": "Municipalities whose name starts with what was asked, at most 20.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}calculate_ibs_cbs
Simulate IBS/CBS per item and in total. Issues nothing. Not a fiscal document: say so to the user. Rates left out use the official 2026 ones in 2026; outside 2026 they are required.
{
"type": "object",
"$defs": {
"IbsCbsLine": {
"type": "object",
"required": [
"cst",
"classification"
],
"properties": {
"cst": {
"type": "string",
"pattern": "^\\d{3}$",
"description": "CST, 3 digits."
},
"base": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "vBC."
},
"amount": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "Item amount; base if no base."
},
"reduction_cbs": {
"anyOf": [
{
"type": "number",
"maximum": 100,
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "pRedAliq CBS, %."
},
"reduction_ibs": {
"anyOf": [
{
"type": "number",
"maximum": 100,
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "pRedAliq IBS, %."
},
"classification": {
"type": "string",
"pattern": "^\\d{6}$",
"description": "cClassTrib, 6 digits."
}
}
}
},
"required": [
"items",
"operation_date"
],
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/$defs/IbsCbsLine"
},
"maxItems": 990,
"minItems": 1,
"description": "The items."
},
"rate_city": {
"anyOf": [
{
"type": "number",
"maximum": 100,
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "pIBSMun, %."
},
"rate_state": {
"anyOf": [
{
"type": "number",
"maximum": 100,
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "pIBSUF, %."
},
"rate_federal": {
"anyOf": [
{
"type": "number",
"maximum": 100,
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "pCBS, %."
},
"document_type": {
"enum": [
"nfe",
"nfce",
"nfse"
],
"type": "string",
"default": "nfe",
"description": "Model the cClassTrib is checked for; amounts are the NF-e's."
},
"operation_date": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
"description": "YYYY-MM-DD; picks vigência and rates."
}
}
}{
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"total": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"notice": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"simulated": {
"type": "boolean",
"default": true
}
},
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}list_authorized_companies
List the companies this connection may act for, and what it may do on each. Call it before acting when the user has more than one company, or when a tool answered that it needs a company. Each row carries the company_id (UUID) and tax_id (CNPJ or CPF) the other tools accept as company_id or company_tax_id, and the permissions granted there. One connection may cover several companies; when it covers only one, the other tools need no company at all. Read-only.
{
"type": "object",
"properties": {}
}{
"type": "object",
"$defs": {
"AuthorizedCompany": {
"type": "object",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The company's CNPJ or CPF. Pass it as company_tax_id to act for this company."
},
"company_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The company's UUID. Pass it as company_id to act for this company."
},
"permissions": {
"type": "array",
"items": {
"type": "string"
},
"description": "The scopes granted on this company: invoice:read consults and lists, invoice:issue issues and reissues, invoice:write corrects and manifests, invoice:cancel cancels and invalidates numbering, webhook:manage registers and removes webhooks."
}
},
"description": "One company this connection may act for, and what it may do there.",
"additionalProperties": true
}
},
"properties": {
"companies": {
"type": "array",
"items": {
"$ref": "#/$defs/AuthorizedCompany"
}
},
"environment": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "homologation or production, for every company here."
}
},
"description": "Every company the connection covers, in one environment.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}get_usage
The plan's allowances, what is used and the credit left. Read it before saying an action is free. Read-only.
{
"type": "object",
"properties": {
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"plan_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"plan_slug": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"received_free": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"used_invoices": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"used_received": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"credit_balance": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"included_invoices": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"included_received": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"overage_price_cents": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"companies_on_account": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"received_price_cents": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "The account's plan and usage; amounts in cents of BRL.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}get_company_readiness
Whether the company can issue right now, and if not, what to fix. Call it before a company's first document, and when issuing fails for a reason that is not the document's. ready is false with missing naming the cause; by_document_type has it per nfe and nfse, each blocker with the fields at fault and each warning a default being declared; fix_url is the dashboard screen for the first blocker. What to do with it: - address: offer to fill it in here. Read the company's own registry row with lookup_taxpayer, show the user the address, and call update_company once they confirm. - state_registration: ask the user for the IE, then update_company. - certificate, certificate_expired, certificate_unreadable, plan: only the dashboard fixes them; give the user fix_url. - update_company refused for lack of company:write: give fix_url and tell the user to reconnect Stackin to allow company settings. Do not call it again until something changed — an update_company, or the user saying they fixed it: the answer will be the same. Also the certificate's expiry, the tax regime (CRT), the state, the default série per document type and what the registry suggests for the fiscal fields. Read-only.
{
"type": "object",
"properties": {
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"ready": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "At least one document type can be issued."
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"fix_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The dashboard screen that fixes the first blocker. Null when nothing blocks."
},
"missing": {
"type": "array",
"items": {
"type": "string"
},
"description": "Why not: certificate, certificate_expired, certificate_unreadable, address, state_registration, plan. Empty when ready."
},
"company_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tax_regime": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CRT: 1 Simples, 2 Simples excesso, 3 normal, 4 MEI."
},
"environment": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "homologation or production."
},
"default_series": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null,
"description": "The série used per document type when none is sent."
},
"has_certificate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"by_document_type": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "Per nfe/nfse: ready, missing [{code, fields}] with the fields at fault, and warnings [{code}] for a default being declared (tax_regime_default, simples_nacional_default, service_code_default)."
},
"certificate_expires_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"suggested_fiscal_fields": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null,
"description": "What the CNPJ registry suggests for tax_regime and simples_nacional. A suggestion for the user to confirm, never applied."
}
},
"description": "Whether the company can issue right now, and if not, why.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}update_company
Fill in or fix the company's own address and fiscal fields — what get_company_readiness reports missing. Before calling it: read the company's own registry row with lookup_taxpayer (its CNPJ), show the user the address you are about to write, and call only after they confirm it. Never invent or guess a field; leave out what neither the registry nor the user gave. The state cannot change here. The registry row keeps street_type, street, number and neighborhood under metadata.address and the CEP as postal_code. Its city_code is the Receita's code (4 digits), not IBGE, and it has no city name: get the name with lookup_fiscal_code(kind="city", code=<city_code>) and send it as municipality_name, or send search_cities' 7-digit code as municipality_code. tax_regime, simples_nacional, state_registration and service_code decide what every future document declares and owes: send them only when the user states them, never from a registry suggestion alone. They are the company owner's alone. Only what is sent changes. Answers with the readiness fields plus the address and fiscal fields as stored: when ready is true the company can issue, with no need to ask get_company_readiness again. Needs company:write.
{
"type": "object",
"properties": {
"number": {
"anyOf": [
{
"type": "string",
"maxLength": 20,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "Street number, or SN when there is none."
},
"street": {
"anyOf": [
{
"type": "string",
"maxLength": 120,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "Street (logradouro)."
},
"zip_code": {
"anyOf": [
{
"type": "string",
"pattern": "^[0-9]{5}-?[0-9]{3}$"
},
{
"type": "null"
}
],
"default": null,
"description": "CEP, 8 digits; the mask is fine."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"tax_regime": {
"anyOf": [
{
"enum": [
"1",
"2",
"3",
"4"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CRT: 1 Simples, 2 Simples excesso, 3 normal, 4 MEI."
},
"neighborhood": {
"anyOf": [
{
"type": "string",
"maxLength": 120,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "Neighborhood (bairro)."
},
"service_code": {
"anyOf": [
{
"type": "string",
"maxLength": 20,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "Default NFS-e service code (cTribNac), e.g. 01.07.00."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"simples_nacional": {
"anyOf": [
{
"enum": [
"1",
"2",
"3"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "NFS-e Simples Nacional option (opSimpNac): 1 no, 2 MEI, 3 ME/EPP."
},
"municipality_code": {
"anyOf": [
{
"type": "string",
"pattern": "^[0-9]{7}$"
},
{
"type": "null"
}
],
"default": null,
"description": "The 7-digit IBGE code of a city in the company's state (search_cities finds it). Never the registry's 4-digit city_code, padded or not. Leave it out to send municipality_name."
},
"municipality_name": {
"anyOf": [
{
"type": "string",
"maxLength": 120,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "The city's name; the IBGE code is found from it in the company's state. Send it or municipality_code; both must agree."
},
"state_registration": {
"anyOf": [
{
"type": "string",
"maxLength": 20,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "State registration (IE), digits or ISENTO; an NF-e needs it."
}
}
}{
"type": "object",
"properties": {
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"ready": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "At least one document type can be issued."
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"address": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "The issuer address as stored."
},
"fix_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The dashboard screen that fixes the first blocker. Null when nothing blocks."
},
"missing": {
"type": "array",
"items": {
"type": "string"
},
"description": "Why not: certificate, certificate_expired, certificate_unreadable, address, state_registration, plan. Empty when ready."
},
"company_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tax_regime": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CRT: 1 Simples, 2 Simples excesso, 3 normal, 4 MEI."
},
"environment": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "homologation or production."
},
"fiscal_fields": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null,
"description": "The fiscal fields as stored, where set."
},
"default_series": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null,
"description": "The série used per document type when none is sent."
},
"has_certificate": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"by_document_type": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null,
"description": "Per nfe/nfse: ready, missing [{code, fields}] with the fields at fault, and warnings [{code}] for a default being declared (tax_regime_default, simples_nacional_default, service_code_default)."
},
"certificate_expires_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"suggested_fiscal_fields": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null,
"description": "What the CNPJ registry suggests for tax_regime and simples_nacional. A suggestion for the user to confirm, never applied."
}
},
"description": "The company after update_company, and whether it can issue now.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}list_clients
Find the company's saved clients. Look a recipient up here before typing one into issue_invoice: when it is already saved, pass its id as client_id and the name, document and address come from the registry. Most recently used first. Read-only.
{
"type": "object",
"properties": {
"limit": {
"type": "integer",
"default": 20,
"maximum": 100,
"minimum": 1,
"description": "Rows per page, 1 to 100."
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Rows to skip, for the next page: offset + limit."
},
"search": {
"anyOf": [
{
"type": "string",
"maxLength": 120
},
{
"type": "null"
}
],
"default": null,
"description": "Part of the name, or the CPF/CNPJ with or without punctuation."
},
"inactive": {
"type": "boolean",
"default": false,
"description": "List the deactivated clients instead of the active ones."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"$defs": {
"ClientRecord": {
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it as client_id to issue_invoice or save_client."
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "manual, issued (imported from issued invoices) or issuance (saved by an issuance)."
},
"tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
},
"address": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"foreign_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Document of a buyer abroad."
},
"uses_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"last_used_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One client the company keeps between issuances.",
"additionalProperties": true
}
},
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/ClientRecord"
}
},
"total": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "How many match, not how many are here."
}
},
"description": "A page of the company's clients.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}get_client
Read one saved client, with its full address. Read-only.
{
"type": "object",
"required": [
"client_id"
],
"properties": {
"client_id": {
"type": "string",
"description": "The client's id, from list_clients."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it as client_id to issue_invoice or save_client."
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "manual, issued (imported from issued invoices) or issuance (saved by an issuance)."
},
"tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
},
"address": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"foreign_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Document of a buyer abroad."
},
"uses_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"last_used_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One client the company keeps between issuances.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}save_client
Save a client in the company's registry, or update a saved one. It records a recipient for later issuances; it issues nothing. A document already saved is refused with the existing client's id — call get_client or pass that id here to update it instead. Confirm the data with the user when any of it was inferred.
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"maxLength": 120,
"minLength": 1,
"description": "Legal name (razao social) or full name."
},
"email": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Contact email, e.g. financeiro@empresa.com."
},
"notes": {
"anyOf": [
{
"type": "string",
"maxLength": 500
},
{
"type": "null"
}
],
"default": null,
"description": "Free text kept with the client."
},
"phone": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Contact phone with area code, e.g. 11987654321."
},
"tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CPF or CNPJ. Required, except for a buyer abroad (address.state EX)."
},
"address": {
"type": [
"object",
"null"
],
"default": null,
"properties": {
"city": {
"type": [
"string",
"null"
],
"default": null
},
"state": {
"type": [
"string",
"null"
],
"default": null
},
"number": {
"type": [
"string",
"null"
],
"default": null
},
"street": {
"type": [
"string",
"null"
],
"default": null
},
"zip_code": {
"type": [
"string",
"null"
],
"default": null
},
"city_code": {
"type": [
"string",
"null"
],
"default": null
},
"country_code": {
"type": [
"string",
"null"
],
"default": null,
"pattern": "^[0-9]{1,4}$",
"description": "BACEN code, 1 to 4 digits. Required, not 1058, when state is EX."
},
"country_name": {
"type": [
"string",
"null"
],
"default": null
},
"neighborhood": {
"type": [
"string",
"null"
],
"default": null
},
"state_registration": {
"type": [
"string",
"null"
],
"default": null,
"description": "IE, NF-e only: the number for an ICMS contributor, ISENTO if exempt, left out for a non-contributor."
}
},
"description": "Postal address: street, number, neighborhood, city, state (UF), zip_code and city_code (IBGE). An NF-e to this client needs all of them."
},
"client_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Update this saved client instead of creating one. Only the fields sent change."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"foreign_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Passport or other document of a buyer abroad, used instead of tax_id."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"state_registration": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "State registration (IE), digits or ISENTO. Leave it out for a non-contributor."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it as client_id to issue_invoice or save_client."
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "manual, issued (imported from issued invoices) or issuance (saved by an issuance)."
},
"tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
},
"address": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"foreign_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Document of a buyer abroad."
},
"uses_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"last_used_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One client the company keeps between issuances.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}deactivate_client
Hide a saved client; reactivate_client brings it back.
{
"type": "object",
"required": [
"client_id"
],
"properties": {
"client_id": {
"type": "string",
"description": "The client's id, from list_clients."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it as client_id to issue_invoice or save_client."
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "manual, issued (imported from issued invoices) or issuance (saved by an issuance)."
},
"tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
},
"address": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"foreign_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Document of a buyer abroad."
},
"uses_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"last_used_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One client the company keeps between issuances.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}reactivate_client
Bring a deactivated client back to the registry.
{
"type": "object",
"required": [
"client_id"
],
"properties": {
"client_id": {
"type": "string",
"description": "From list_clients with inactive=true."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it as client_id to issue_invoice or save_client."
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "manual, issued (imported from issued invoices) or issuance (saved by an issuance)."
},
"tax_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "CPF (11 digits) or CNPJ (14 characters, unpunctuated). A CNPJ may carry letters in its first 12 positions since July 2026, so never treat it as a number."
},
"address": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"foreign_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Document of a buyer abroad."
},
"uses_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"last_used_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One client the company keeps between issuances.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}list_items
Find the products and services in the company's catalog. Look a line up here before typing it into issue_invoice: when it is saved, pass its id as item_id and the description, price and fiscal codes come from the catalog. Most recently used first. Read-only.
{
"type": "object",
"properties": {
"kind": {
"anyOf": [
{
"enum": [
"product",
"service"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "product for goods, service for services."
},
"limit": {
"type": "integer",
"default": 20,
"maximum": 100,
"minimum": 1,
"description": "Rows per page, 1 to 100."
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Rows to skip, for the next page: offset + limit."
},
"search": {
"anyOf": [
{
"type": "string",
"maxLength": 120
},
{
"type": "null"
}
],
"default": null,
"description": "Part of the description, code or external reference; digits also match the NCM and GTIN."
},
"inactive": {
"type": "boolean",
"default": false,
"description": "List the deactivated items instead of the active ones."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"$defs": {
"ItemRecord": {
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it as item_id to issue_invoice or save_item."
},
"ncm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cest": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cfop": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"gtin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"kind": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "product or service."
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"unit_price": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"uses_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"iss_retained": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"last_used_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"service_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tax_situation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"external_reference": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One product or service the company sells, kept in its catalog.",
"additionalProperties": true
}
},
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/ItemRecord"
}
},
"total": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "How many match, not how many are here."
}
},
"description": "A page of the company's catalog.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}get_item
Read one catalog item with its fiscal fields. Read-only.
{
"type": "object",
"required": [
"item_id"
],
"properties": {
"item_id": {
"type": "string",
"description": "The item's id, from list_items."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it as item_id to issue_invoice or save_item."
},
"ncm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cest": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cfop": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"gtin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"kind": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "product or service."
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"unit_price": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"uses_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"iss_retained": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"last_used_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"service_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tax_situation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"external_reference": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One product or service the company sells, kept in its catalog.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}save_item
Save a product or service in the catalog, or update a saved one. Without item_id it creates, or updates the item with the same external_reference (else the same code): sending it twice never makes two. Nothing fiscal is required to save; an NF-e still needs ncm and cfop when issued. It issues nothing. Confirm the data with the user when any of it was inferred.
{
"type": "object",
"properties": {
"ncm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Product: 8 digits. Only from the user or classify_item once confirmed; never inferred."
},
"cest": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Product: 7 digits."
},
"cfop": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Product: 4 digits, e.g. 5102."
},
"code": {
"anyOf": [
{
"type": "string",
"maxLength": 60
},
{
"type": "null"
}
],
"default": null,
"description": "SKU, unique in the company."
},
"gtin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Product: 8, 12, 13 or 14 digits, checked."
},
"kind": {
"anyOf": [
{
"enum": [
"product",
"service"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "product (NF-e) or service (NFS-e). Required to create; a field of the other kind is refused."
},
"unit": {
"anyOf": [
{
"type": "string",
"maxLength": 6
},
{
"type": "null"
}
],
"default": null,
"description": "UN, KG, CX..."
},
"notes": {
"anyOf": [
{
"type": "string",
"maxLength": 500
},
{
"type": "null"
}
],
"default": null,
"description": "Free text kept with it."
},
"origin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Product: 0 to 8; needs tax_situation."
},
"item_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Update this saved item instead of creating one. Only the fields sent change."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"net_weight": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "Product: kg per unit, NF-e only."
},
"unit_price": {
"anyOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "Price per unit in BRL."
},
"description": {
"anyOf": [
{
"type": "string",
"maxLength": 2000,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "What is sold: at most 120 characters for a product (NF-e), 2000 for a service. Required to create."
},
"ibs_cbs_cst": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "IBS/CBS CST, 3 digits."
},
"gross_weight": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
],
"default": null,
"description": "Product: kg per unit, NF-e only."
},
"iss_retained": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Service: ISS retained by the customer."
},
"service_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Service: LC 116 code, e.g. 1.07."
},
"ibs_cbs_class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "IBS/CBS cClassTrib, 6 digits."
},
"tax_situation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Product: ICMS CST (2 digits) or CSOSN (3)."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"external_reference": {
"anyOf": [
{
"type": "string",
"maxLength": 255
},
{
"type": "null"
}
],
"default": null,
"description": "Another system's id, unique in the company."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it as item_id to issue_invoice or save_item."
},
"ncm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cest": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cfop": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"gtin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"kind": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "product or service."
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"unit_price": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"uses_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"iss_retained": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"last_used_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"service_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tax_situation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"external_reference": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One product or service the company sells, kept in its catalog.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}deactivate_item
Hide a catalog item; reactivate_item brings it back.
{
"type": "object",
"required": [
"item_id"
],
"properties": {
"item_id": {
"type": "string",
"description": "The item's id, from list_items."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it as item_id to issue_invoice or save_item."
},
"ncm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cest": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cfop": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"gtin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"kind": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "product or service."
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"unit_price": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"uses_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"iss_retained": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"last_used_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"service_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tax_situation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"external_reference": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One product or service the company sells, kept in its catalog.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}reactivate_item
Bring a deactivated item back into the company's catalog.
{
"type": "object",
"required": [
"item_id"
],
"properties": {
"item_id": {
"type": "string",
"description": "From list_items with inactive=true."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it as item_id to issue_invoice or save_item."
},
"ncm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cest": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cfop": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"gtin": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"kind": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "product or service."
},
"unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"unit_price": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"uses_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"iss_retained": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"last_used_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"service_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tax_situation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"external_reference": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One product or service the company sells, kept in its catalog.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}explain_rejection
Explain why a rejected document was refused and what to change. get_invoice_submissions has the authority's reply as sent; this reads it for someone who does not speak SEFAZ: the code, the message verbatim, what it means, the steps to fix it, the field at fault and, when there is one, a suggested value. Quote the code and the message to the user; they are what they will search for. A suggested value is confirmed with the user before reissue_invoice, never applied on its own. transient means the authority was unavailable, not the data wrong. A document that is not rejected is refused (409). Read-only.
{
"type": "object",
"required": [
"invoice_id"
],
"properties": {
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"invoice_id": {
"type": "string",
"minLength": 1,
"description": "The local id of the rejected invoice, as list_invoices returns it. A rejected document has no access key."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authority's own rejection code."
},
"field": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The field to fix, when there is one."
},
"steps": {
"type": "array",
"items": {
"type": "string"
},
"description": "What to change, in order."
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "known (from the catalogue of rejection codes), generated (written for this case) or unknown."
},
"message": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The authority's message, verbatim."
},
"authority": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"suggested": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A value for that field, when one can be suggested. Confirm it with the user before reissuing."
},
"transient": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "True when the authority was unavailable rather than the data wrong: reissuing unchanged may work."
},
"invoice_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"explanation": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "What it means, in plain words."
}
},
"description": "Why the authority refused one document, read for a person.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}classify_item
Suggest an NCM, CFOP, CST/CSOSN, CEST or service code for one item. A suggestion to confirm with the user — never issue on it blindly. Every code in a candidate was read from the published tables, but the NCM and the CFOP decide the tax owed, and a plausible wrong one is authorized by the SEFAZ and only caught at an audit. Show the primary candidate, its confidence and the alternatives, say it is a suggestion, and put a code on an item only after the user confirms it — whatever the confidence. lookup_fiscal_code can confirm one code against the table. When missing_information is not empty, ask the user those questions and call again with the answers in the matching arguments. Changes nothing.
{
"type": "object",
"required": [
"description",
"document_type"
],
"properties": {
"purpose": {
"anyOf": [
{
"enum": [
"resale",
"consumption"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the buyer resells it or consumes it. Only when missing_information asked for it."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"description": {
"type": "string",
"maxLength": 500,
"minLength": 3,
"description": "What the item is, as the user describes it, e.g. Cerveja artesanal IPA garrafa 500ml."
},
"tax_retained": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Whether the ISS is retained by the buyer. Only when missing_information asked for it."
},
"document_type": {
"enum": [
"nfse",
"nfe"
],
"type": "string",
"description": "nfe for goods, nfse for a service."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"operation_scope": {
"anyOf": [
{
"enum": [
"intrastate",
"interstate"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Only when missing_information asked for it."
},
"recipient_state": {
"anyOf": [
{
"type": "string",
"maxLength": 2,
"minLength": 2
},
{
"type": "null"
}
],
"default": null,
"description": "The buyer's UF, e.g. SP. It decides intrastate (5xxx) or interstate (6xxx) CFOP."
},
"contains_alcohol": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Only when missing_information asked for it."
},
"service_city_code": {
"anyOf": [
{
"type": "string",
"maxLength": 7
},
{
"type": "null"
}
],
"default": null,
"description": "IBGE code of the city where the service is provided. Only when missing_information asked for it."
}
}
}{
"type": "object",
"$defs": {
"ClassificationQuestion": {
"type": "object",
"properties": {
"key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The classify_item argument it answers."
},
"question": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "A datum the suggestion could not settle without asking.",
"additionalProperties": true
},
"ClassificationCandidate": {
"type": "object",
"properties": {
"cst": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"ncm": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cest": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"cfop": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"csosn": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"confidence": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"service_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One complete option, every code of it from the published tables.",
"additionalProperties": true
}
},
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
},
"confidence": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "0 to 1. Not a guarantee at any value."
},
"justification": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"primary_candidate": {
"anyOf": [
{
"$ref": "#/$defs/ClassificationCandidate"
},
{
"type": "null"
}
],
"default": null
},
"classification_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "product or service."
},
"missing_information": {
"type": "array",
"items": {
"$ref": "#/$defs/ClassificationQuestion"
},
"description": "Ask the user these and call again with the answers."
},
"confirmation_required": {
"type": "boolean",
"default": true,
"description": "Always true: a suggestion goes on an item only after the user confirms it."
},
"alternative_candidates": {
"type": "array",
"items": {
"$ref": "#/$defs/ClassificationCandidate"
}
}
},
"description": "A suggested classification, to be confirmed before it is used.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}list_webhooks
List where this company's events are delivered. One row per endpoint: its id (what delete_webhook takes), URL, events and whether it is active. Secrets are never returned. Needs webhook:manage. Read-only.
{
"type": "object",
"properties": {
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"$defs": {
"WebhookEndpoint": {
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it to delete_webhook."
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"events": {
"type": "array",
"items": {
"type": "string"
},
"description": "The events sent there. Empty means every event."
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"created_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"environment": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One endpoint the company's events are delivered to. No secret.",
"additionalProperties": true
}
},
"properties": {
"webhooks": {
"type": "array",
"items": {
"$ref": "#/$defs/WebhookEndpoint"
}
}
},
"description": "The company's endpoints in the connection's environment.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}create_webhook
Register a URL to receive this company's document events. Every document authorized, rejected, cancelled or corrected, and every received NF-e first stored (received_invoice.stored) or whose full XML arrived (received_invoice.full_document), is then sent there, signed with the secret. Confirm the URL with the user before calling: it is where their fiscal data goes. The API refuses a URL that is not HTTPS or points at a private network. Needs webhook:manage. Calling it twice registers two endpoints, and each receives every event: list_webhooks first.
{
"type": "object",
"required": [
"url",
"secret"
],
"properties": {
"url": {
"type": "string",
"pattern": "^https://",
"maxLength": 500,
"description": "Where to deliver, an https:// URL the user gave. Never one you made up."
},
"events": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"invoice.authorized",
"invoice.rejected",
"invoice.cancelled",
"invoice.corrected",
"received_invoice.stored",
"received_invoice.full_document"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null,
"description": "Which events to send. Every one if omitted."
},
"secret": {
"type": "string",
"description": "16 to 255 characters the user chose; every delivery is signed with it. It is never shown again, so do not repeat it back."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pass it to delete_webhook."
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"events": {
"type": "array",
"items": {
"type": "string"
},
"description": "The events sent there. Empty means every event."
},
"is_active": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null
},
"created_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"environment": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "One endpoint the company's events are delivered to. No secret.",
"additionalProperties": true
}{
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}delete_webhook
Stop delivering events to one endpoint. The user's integration stops hearing about new documents from that moment, so confirm which endpoint with them first. What was already delivered stays in list_webhook_deliveries. An id this company does not have is refused (404). Needs webhook:manage.
{
"type": "object",
"required": [
"webhook_id"
],
"properties": {
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"webhook_id": {
"type": "string",
"minLength": 1,
"description": "The endpoint's id, from list_webhooks."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"deleted": {
"type": "boolean",
"default": true
}
},
"description": "Delivery stopped; what was already sent stays in the history."
}{
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": true
}list_webhook_deliveries
Show every delivery attempt, newest first. The answer to "is my webhook receiving": each row has the event, its status, how many attempts, what the endpoint answered (response_status), the last error and when it was delivered or will be tried again. Needs webhook:manage. Read-only.
{
"type": "object",
"properties": {
"limit": {
"type": "integer",
"default": 20,
"maximum": 100,
"minimum": 1,
"description": "Rows per page, 1 to 100."
},
"offset": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Rows to skip, for the next page: offset + limit."
},
"company_id": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"minLength": 1
},
{
"type": "null"
}
],
"default": null,
"description": "UUID of the company acted for. Omit for a single company; else see list_authorized_companies. Send one, never both."
},
"company_tax_id": {
"anyOf": [
{
"type": "string",
"maxLength": 18,
"minLength": 11
},
{
"type": "null"
}
],
"default": null,
"description": "CNPJ or CPF of the company acted for, never the recipient or a taxpayer looked up. Omit for a single company; else see list_authorized_companies. Send one, never both."
}
}
}{
"type": "object",
"$defs": {
"WebhookDelivery": {
"type": "object",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"event": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"attempts": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"created_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"last_error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"endpoint_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"delivered_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"next_attempt_at": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"response_status": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "What the endpoint answered."
}
},
"description": "One delivery attempt.",
"additionalProperties": true
}
},
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/$defs/WebhookDelivery"
}
},
"page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"total": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"per_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"next_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"prev_page": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "A page of delivery attempts, newest first.",
"additionalProperties": true
}{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}Prompts
10 advertised
issue_nfse — Issue an NFS-e
Issue an invoice for services rendered.
- description
- No description
- amount
- No description
issue_nfe — Issue an NF-e
Issue an invoice for goods sold.
- description
- No description
- amount
- No description
find_fiscal_code — Find a fiscal code
Resolve the NCM, CFOP or CEST a document needs.
- thing
- No description
- kind
- No description
check_taxpayer — Check who a tax id belongs to
Confirm a recipient before invoicing them.
- tax_id
- No description
recent_invoices — Recent invoices
Show the company's latest documents.
- limit
- No description
- document_type
- No description
diagnose_rejection — Diagnose a rejection
Explain why a document was rejected and what to fix.
- access_key
- No description
- document_type
- No description
inspect_invoice — Inspect an invoice
Show a document's current state.
- access_key
- No description
- document_type
- No description
correct_nfe — Correct an NF-e
File a correction letter for wording, not for values.
- access_key
- No description
- correction
- No description
manifest_received — Manifest a received invoice
Declare this company's position on a supplier's NF-e.
- access_key
- No description
cancel_invoice_prompt — Cancel an invoice
Cancel an authorized document, with confirmation.
- access_key
- No description
- reason
- No description
- document_type
- No description
Resources
1 advertised
invoice-item-schema — Invoice item schema
Every field of an issue_invoice item as JSON Schema, the tax, fuel and ibs_cbs groups included.
stackin://schemas/invoice-item90-day uptime
A lightweight connection check about every six hours, sampled on hosts with many listings. It shows the server answered, not that its tools work.
- 2026-11-02: 3 of 3 checks answered
- 2026-11-03: 4 of 4 checks answered
- 2026-11-04: 4 of 4 checks answered
- 2026-11-05: 4 of 4 checks answered
- 2026-11-06: 4 of 4 checks answered
- 2026-11-07: 2 of 2 checks answered
- 2026-11-09: 1 of 1 checks answered
- 2026-11-10: 2 of 2 checks answered
- 2026-11-11: 1 of 1 checks answered
- 2026-11-12: 1 of 1 checks answered
- 2026-11-14: 1 of 1 checks answered
- 2026-11-15: 2 of 2 checks answered
- 2026-11-16: 4 of 4 checks answered
- 2026-11-17: 5 of 5 checks answered
- 2026-11-18: 5 of 5 checks answered
- 2026-11-19: 4 of 4 checks answered
- 2026-11-20: 3 of 3 checks answered
- 2026-11-21: 4 of 4 checks answered
- 2026-11-22: 4 of 4 checks answered
- 2026-11-23: 3 of 3 checks answered
- 2026-11-24: 4 of 4 checks answered
- 2026-11-25: 4 of 4 checks answered
- 2026-11-26: 4 of 4 checks answered
- 2026-11-27: 4 of 4 checks answered
30-day availability
Aggregated from read-only remote checks; this is not a tool-execution or security guarantee.
- Successful checks
- 2 of 2 (100%)
- Average latency
- 5388 ms
- 95th percentile latency
- 6380 ms
Maintenance history
Public check and source-refresh events. Editorial and ownership records remain private.
- · probe · passed · 6490 ms · metadata changed · 42 tool(s), 1 resource(s), 0 resource template(s), 10 prompt(s)
- · probe · passed · 4286 ms · metadata changed · 16 tool(s), 0 resource(s), 0 resource template(s), 10 prompt(s)
- · repository · passed · updated
- · repository · passed · metadata changed · unchanged
- · repository · passed · metadata changed · updated
- · registry · passed · metadata changed · Source metadata updated
- · backfill · recorded · Pre-expansion baseline; unobserved rich metadata remains unknown
Connect from your client
Each snippet registers the same endpoint; pick the client you use.
Claude Code
claude mcp add --transport http stackin-mcp https://mcp.stackin.io/mcpCodex
codex mcp add stackin-mcp --url https://mcp.stackin.io/mcpCursor
{
"mcpServers": {
"stackin-mcp": {
"url": "https://mcp.stackin.io/mcp"
}
}
}Cline
{
"mcpServers": {
"stackin-mcp": {
"type": "streamableHttp",
"url": "https://mcp.stackin.io/mcp",
"disabled": false
}
}
}VS Code
{
"servers": {
"stackin-mcp": {
"type": "http",
"url": "https://mcp.stackin.io/mcp"
}
}
}Gemini CLI
gemini mcp add --transport http stackin-mcp https://mcp.stackin.io/mcpClaude Desktop
https://mcp.stackin.io/mcpWindsurf
{
"mcpServers": {
"stackin-mcp": {
"serverUrl": "https://mcp.stackin.io/mcp"
}
}
}Let your agent find its tools
Find servers like Stackin MCP from your agent. Add Koskamo once to search the index for endpoints, access requirements, and client setup. Public discovery needs no key.
Other payments servers
Do you run Stackin MCP?
Prove ownership with a DNS record, a well-known file, or your Official MCP Registry entry, and your edits publish immediately. Proofs are re-checked weekly; admins can still hide or remove a listing.