create_invoice
Issue a Brazil NFS-e (nota fiscal de serviço eletrônica — the electronic service invoice municipalities/prefeituras require). Two interchangeable providers behind one tool (bring your own credentials as HTTP headers; this server stores nothing, and the merchant certificate + municipal registration stay in the merchant's own provider account): (A) FOCUS NFe — header x-focusnfe-token (free homologação/sandbox token issues test NFS-e with no fiscal effect; the produção token issues real ones; add x-focusnfe-mode: production to switch, default is the safer sandbox). (B) NFE.IO — headers x-nfeio-key (your NFe.io API key) + x-nfeio-company-id (the id of your issuing company/empresa in NFe.io, which holds the CNPJ, municipal registration and certificate; whether it is a Test or Production company — and thus fiscal effect — is set in your NFe.io account, not per request). Routing: whichever credential headers you send picks the provider; if both are present Focus NFe wins unless you set header x-invoice-provider: nfeio. ISSUANCE IS ASYNCHRONOUS: this returns status PROCESSING plus a ref — poll query_invoice with that ref until AUTHORIZED (nota autorizada) or ERROR. Ref semantics differ: with Focus NFe the ref is yours (auto-generated if omitted); with NFe.io the ref returned is NFe.io's own invoice id (a passed-in ref is ignored). For NFe.io the issuer comes from x-nfeio-company-id, so the prestador_* fields are validated but not forwarded. This is for service invoices (serviços); NF-e for physical goods is on the v2 roadmap.
Parameters17
| prestador_cnpj | string | required | Service provider (merchant) CNPJ, 14 digits — the business issuing the invoice. Must match the certificate configured in the Focus NFe account. |
| prestador_inscricao_municipal | string | required | Provider municipal registration (inscrição municipal) issued by the prefeitura where the service is taxed. |
| prestador_codigo_municipio | string | optional | IBGE 7-digit code of the provider municipality (código do município), e.g. 3550308 for São Paulo. Also used as the service municipality unless the service is elsewhere. |
| customer_name | string | required | Buyer/taker legal or full name (razão social or nome do tomador). |
| customer_tax_id | string | required | Buyer CPF (11 digits, individual) or CNPJ (14 digits, company). Digits only or formatted — punctuation is stripped. |
| customer_email | string | optional | Optional buyer email — Focus NFe can email the NFS-e to it once authorized. |
| valor_servicos | number | required | Total service amount in BRL (reais). This is the invoice total the ISS tax and owner policy caps apply to. |
| discriminacao | string | required | Description of the service rendered (discriminação do serviço) — free text shown on the NFS-e. |
| item_lista_servico | string | required | Service list item code from Lei Complementar 116 (lista de serviços), e.g. "01.07" software support, "17.09" consultoria. Determines the ISS classification; required by every prefeitura. |
| aliquota | number | optional | ISS rate. Focus NFe expects it as a decimal fraction (0.05 = 5%). Optional — many municipalities derive it from item_lista_servico; pass it only if your prefeitura requires it. |
| iss_retido | boolean | optional | Whether ISS is withheld by the buyer (ISS retido na fonte). Default false. |
| codigo_tributario_municipio | string | optional | Optional municipal tax/service code (código tributário do município / CNAE-based) some prefeituras require in addition to item_lista_servico. |
| data_emissao | string | optional | Optional issue date-time in ISO-8601 with offset, e.g. 2026-07-10T10:30:00-03:00. Defaults to now. |
| natureza_operacao | string | optional | Operation nature code (natureza da operação). Default "1" (tributação no município). |
| optante_simples_nacional | boolean | optional | Whether the provider is a Simples Nacional opter. Default true. |
| ref | string | optional | Optional caller-chosen unique reference for this NFS-e (used to poll/cancel). Applies to Focus NFe only (auto-generated if omitted); NFe.io ignores it and returns its own invoice id as the ref. |
| provider | string | optional | Optional explicit provider. Omit to auto-route by which credential headers you sent (x-focusnfe-token -> focusnfe, x-nfeio-key -> nfeio). Overrides header x-invoice-provider. |
Raw schema
{
"type": "object",
"properties": {
"prestador_cnpj": {
"type": "string",
"description": "Service provider (merchant) CNPJ, 14 digits — the business issuing the invoice. Must match the certificate configured in the Focus NFe account."
},
"prestador_inscricao_municipal": {
"type": "string",
"description": "Provider municipal registration (inscrição municipal) issued by the prefeitura where the service is taxed."
},
"prestador_codigo_municipio": {
"type": "string",
"description": "IBGE 7-digit code of the provider municipality (código do município), e.g. 3550308 for São Paulo. Also used as the service municipality unless the service is elsewhere."
},
"customer_name": {
"type": "string",
"description": "Buyer/taker legal or full name (razão social or nome do tomador)."
},
"customer_tax_id": {
"type": "string",
"description": "Buyer CPF (11 digits, individual) or CNPJ (14 digits, company). Digits only or formatted — punctuation is stripped."
},
"customer_email": {
"type": "string",
"description": "Optional buyer email — Focus NFe can email the NFS-e to it once authorized."
},
"valor_servicos": {
"type": "number",
"description": "Total service amount in BRL (reais). This is the invoice total the ISS tax and owner policy caps apply to."
},
"discriminacao": {
"type": "string",
"description": "Description of the service rendered (discriminação do serviço) — free text shown on the NFS-e."
},
"item_lista_servico": {
"type": "string",
"description": "Service list item code from Lei Complementar 116 (lista de serviços), e.g. \"01.07\" software support, \"17.09\" consultoria. Determines the ISS classification; required by every prefeitura."
},
"aliquota": {
"type": "number",
"description": "ISS rate. Focus NFe expects it as a decimal fraction (0.05 = 5%). Optional — many municipalities derive it from item_lista_servico; pass it only if your prefeitura requires it."
},
"iss_retido": {
"type": "boolean",
"description": "Whether ISS is withheld by the buyer (ISS retido na fonte). Default false."
},
"codigo_tributario_municipio": {
"type": "string",
"description": "Optional municipal tax/service code (código tributário do município / CNAE-based) some prefeituras require in addition to item_lista_servico."
},
"data_emissao": {
"type": "string",
"description": "Optional issue date-time in ISO-8601 with offset, e.g. 2026-07-10T10:30:00-03:00. Defaults to now."
},
"natureza_operacao": {
"type": "string",
"description": "Operation nature code (natureza da operação). Default \"1\" (tributação no município)."
},
"optante_simples_nacional": {
"type": "boolean",
"description": "Whether the provider is a Simples Nacional opter. Default true."
},
"ref": {
"type": "string",
"description": "Optional caller-chosen unique reference for this NFS-e (used to poll/cancel). Applies to Focus NFe only (auto-generated if omitted); NFe.io ignores it and returns its own invoice id as the ref."
},
"provider": {
"type": "string",
"enum": [
"focusnfe",
"nfeio"
],
"description": "Optional explicit provider. Omit to auto-route by which credential headers you sent (x-focusnfe-token -> focusnfe, x-nfeio-key -> nfeio). Overrides header x-invoice-provider."
}
},
"required": [
"prestador_cnpj",
"prestador_inscricao_municipal",
"customer_name",
"customer_tax_id",
"valor_servicos",
"discriminacao",
"item_lista_servico"
]
}