Updates a company. Accepts the creation fields, all optional. Send simplesRate (and simplesIssRate, or null to remove it) to update the Simples rate, for example every month.
Requests NFS-e issuance. Issuance is asynchronous: HTTP success means the request was registered/queued — it does not mean fiscal authorization. These examples use the CNPJ (companyTaxId) of a company registered with municipalityCode and defaultServiceCode. The issuer municipality always comes from the company.
POST
/v1/invoices/batches
202 Accepted
Requests the issuance of **1 to 50 invoices in a single call**, for one company or for several. Each item has the same fields as POST /v1/invoices plus an optional idempotencyKey. Items are checked one by one: valid items are saved together in a single transaction, invalid items come back as rejected with the reason and are **not** saved. Issuance stays asynchronous, as in POST /v1/invoices.
POST
/v1/invoices/calculate
200 OK
Calculates the taxes of an invoice **without issuing it**: it stores no invoice, uses no credit, reserves no DPS number, schedules nothing and does not call Sefin. Use it to check the fiscal setup and show the amount to the customer before POST /v1/invoices.
GET
/v1/invoices
200 OK
Lists invoices, newest first.
GET
/v1/invoices/:id
200 OK
Fetches a single invoice by id.
GET
/v1/invoices/:id/xml
200 OK
Downloads the XML of an authorized invoice.
GET
/v1/invoices/:id/pdf
200 OK
Downloads the PDF of an authorized invoice.
GET
/v1/invoices/:id/events
200 OK
Fetches the status history of an invoice, oldest first. Paginated like any list (limit, cursor).
POST
/v1/invoices/:id/download-url
200 OK
Generates a short-lived signed URL for the invoice documents.
POST
/v1/invoices/:id/email
202 Accepted
Requests email delivery of the invoice to the address stored in customerSnapshot.email; no alternative recipient is accepted. The invoice must be authorized with documents ready.
POST
/v1/invoices/:id/cancel
200 OK / 202 Accepted
Cancels an invoice. A queued invoice (scheduled or not yet processed) is cancelled immediately; an authorized NFS-e moves to cancelling while event 101101 is sent to the Sefin. A processing invoice (being issued) registers the request: 202, still processing, with cancellationRequestedAt set.
Tampered cursor, or one from another collection, tenant or filter (400).
ERROR_RATE_LIMIT_EXCEEDED
Request limit exceeded (429).
ERROR_INSUFFICIENT_CREDITS / ERROR_QUOTA_EXCEEDED
Not enough credits or quota to issue.
ERROR_COMPANY_NOT_READY / ERROR_COMPANY_BLOCKED
Company without an active certificate in live, or blocked.
ERROR_IDEMPOTENCY_CONFLICT
Same Idempotency-Key with a different payload (409).
ERROR_TAX_REGIME_NOT_SUPPORTED
Only MEI and Simples Nacional companies are supported (422).
ERROR_VALIDATION with details[].codeERROR_DEDUCTION_NOT_ALLOWED_FOR_REGIME or ERROR_SIMPLES_SUBLIMIT_NOT_SUPPORTED
A deduction from the ISS base that a MEI or a Simples company cannot declare, or a Simples company above a sublimit (regApTribSN 2 or 3), which is not supported yet (422).
ERROR_GONE
Retired operation, such as one-off credit purchases (410).