nfse_issue
Emits a new NFS-e (Nota Fiscal de Serviços Eletrônica). The issuing company is identified by company_tax_id (its CNPJ) or company_id. Minimal call: company_tax_id + amount. The customer is optional (omit it for an anonymous consumer invoice), and the competence date, service code and municipality default to today and to the company settings. Returns immediately with the queued status; the final status comes later. With emission_type SCHEDULE or RECURRING nothing is issued yet: it returns the schedule (schedule_id) instead. Without credits it fails with an insufficient credits error. With type "nfe" it emits an NF-e (goods, model 55, homologação only) instead: it takes company_id, the nfe object and a required idempotency_key, and its final status is read with type "nfe". An NF-e can also be scheduled: with emission_type SCHEDULE or RECURRING (and competence_date, recurrence_frequency like an NFS-e) the nfe object is checked now and stored as it is; each run issues it on its day, with the items and prices as they were saved (Arquivix Notas does not control stock). It returns schedule_id. With type "nfce" it emits a NFC-e (sale to the consumer, model 65, homologação only): same fields, the NFC-e body goes in the nfe object (no natOp; the consumer CPF is optional; it cannot be scheduled: it is a sale at the counter); its final status is read with type "nfce".
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "nfse_issue"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nfe | No | The NF-e as in POST /v1/invoices (camelCase, without companyId and type): recipient {taxId, name, indIeDest, stateRegistration?, email?, address{street, number, district, zip, cityCode, city, state}}, items[] {code, description, ncm, cfop, unit, quantity, unitPrice, tax? {csosn}}, payments[] {tPag, amount, card? {tpIntegra?, cnpj?, tBand?, cAut?}: left out, tPag 03, 04 and 17 go with tpIntegra 2}, natOp?, change?, additionalInfo?. The customer informs CFOP, NCM and CSOSN; Arquivix Notas calculates an estimate (Simples credit and approximate taxes). Phase 1: homologação only, Simples Nacional (CSOSN 102 or 400). For type "nfce" (consumer sale, model 65) put the NFC-e here instead: recipient? {taxId?, name?, email?, address? (needed for indPres 4)}, indPres? (1 in person, 4 delivery, 5 in person outside the store), items[], payments[] {tPag, amount, card? {tpIntegra?, cnpj?, tBand?, cAut?}}, change?, additionalInfo?; no natOp. The CPF/CNPJ of the consumer is optional but required above the limit of the state (R$ 10.000,00 by default). The NFC-e uses QR Code v3 (no CSC), has no correction letter and can be cancelled within 30 minutes. | |
| type | No | Kind of invoice: "nfse" (default, services), "nfe" (goods, model 55) or "nfce" (sale to the consumer, model 65). NF-e and NFC-e are homologação only and need their own release for the account. With "nfe" or "nfce" use invoice_id, not access_key. | nfse |
| notes | No | Free text printed on the invoice as complementary information. Does not change any tax. | |
| amount | No | Total value of the service in BRL. Either this or services, not both. | |
| customer | No | Tomador. Optional: omit it for an invoice without tomador. When sent with any data, tax_id (CPF or CNPJ) is required. | |
| discount | No | Unconditional discount in BRL (>= 0, at most the amount). | |
| services | No | Itemized alternative to amount: the total is the sum of quantity x unit_price. | |
| deduction | No | Deduction from the ISS tax base in BRL, declared by the issuer (> 0 and less than amount minus discount). The issuer is responsible for the declared value; Arquivix Notas does not check whether the deduction is allowed. | |
| company_id | No | UUID of the issuing company. Wins over company_tax_id when both are sent. | |
| send_email | No | Email the authorized invoice to the customer. | |
| description | No | Optional service description (used with amount). When omitted, the name of the service code is used. | |
| external_id | No | Your own reference for this invoice. | |
| service_code | No | Optional national service code (6 digits). Inherits company.defaultServiceCode when omitted, then 100901 (LC 116 item 10.09). | |
| emission_type | No | IMMEDIATE (default) issues now. SCHEDULE issues once on competence_date; RECURRING issues repeatedly starting on competence_date (needs recurrence_frequency). Both create a schedule and return its id: runs happen at 09:00 America/Sao_Paulo on business days, a weekend date runs on Monday, and each note takes the competence of the day it runs. Manage schedules with the schedule_* tools. | |
| company_tax_id | No | CNPJ of the issuing company (punctuation optional). Alternative to company_id. | |
| purchase_order | No | Purchase order, service order or project number the customer asked to see on the invoice. Does not change any tax. | |
| competence_date | No | YYYY-MM-DD. Defaults to today (America/Sao_Paulo). With emission_type SCHEDULE or RECURRING it is required and is the date of the first run (from tomorrow on). | |
| idempotency_key | No | Repeat the same key to avoid issuing twice. | |
| municipality_code | No | Optional IBGE place of service (7 digits). Inherits company.municipalityCode when omitted. | |
| recurrence_ends_on | No | YYYY-MM-DD, optional. Last day the recurrence may run. Without it, it runs until paused or cancelled. | |
| service_profile_id | No | Optional service tax profile id (UUID). | |
| recurrence_frequency | No | Required with emission_type RECURRING. |