We use cookies and similar technologies, including Google Analytics and the Meta Pixel, to improve your experience, measure site traffic and understand signup campaigns. By clicking "Accept", you agree to this use.

Learn more about our privacy practices

NFS-e API reference

Base URL: https://api.corvo.tech/v1. Authenticate with the X-API-Key header. Full contract in OpenAPI: https://corvo.tech/openapi.json. Each section links to the docs page with parameters and examples.

Companies

Details and examples
MethodEndpointSuccessDescription
POST/v1/companies201 CreatedRegisters a company.
GET/v1/companies200 OKLists the companies in the account/environment.
GET/v1/companies/:id200 OKFetches a single company by id.
PATCH/v1/companies/:id200 OKUpdates 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.
DELETE/v1/companies/:id200 OKDeletes a company (logical deletion).
GET/v1/cnpj/:cnpj200 OKPublic registry data of a CNPJ (names, address, Simples Nacional, MEI, situation, activities/CNAE and suggestedServiceCode, a service code to suggest, never to apply without asking), to pre-fill a company or a customer form. Send the CNPJ with or without punctuation. 400 CNPJ_INVALID for a malformed CNPJ; 404 CNPJ_NOT_FOUND when the registry does not know the CNPJ; 503 CNPJ_LOOKUP_UNAVAILABLE when it has no answer right now. Needs nfse.companies.manage or nfse.invoices.issue; 20 requests per minute.
GET/v1/companies/:id/dps-sequence200 OKThe DPS series and the last number used (0 when none yet). Needs nfse.companies.view.
PUT/v1/companies/:id/dps-sequence200 OKContinues the numbering from the last number the company issued elsewhere (see it in the last note, PDF or XML). The next invoice uses the following number. It only moves forward: a lower number answers 422 DPS_NUMBER_BELOW_CURRENT. Needs nfse.companies.manage.
GET/v1/companies/:id/fiscal-profile200 OKThe fiscal profile history of the company (regime, Simples Nacional, special regime, IBS/CBS option) by validity period. Needs nfse.companies.view.
PUT/v1/companies/:id/fiscal-profile200 OKOpens a new validity period of the fiscal profile, from validFrom. Sending a state equal to the open one changes nothing, so the call is safe to repeat. Needs nfse.companies.manage.
POST/v1/companies/:id/fiscal-profile/:profileId/approve201 CreatedMarks a fiscal profile as reviewed and approved. Needs nfse.companies.manage.
GET/v1/companies/:id/service-tax-profiles200 OKThe profiles effective on date (default: today in America/Sao_Paulo). Needs nfse.companies.view.
POST/v1/companies/:id/service-tax-profiles201 CreatedAdds a service to the catalog. Besides name, serviceCode and effectiveFrom you can send the classification (nbsCode, cst, classCode, operationIndicator), ISS (issTaxation, issRate, issWithholdingDefault) and withholdings (withholdingPolicy UNKNOWN, NONE_CONFIRMED or CONFIGURED, with withholdingRates in percent). Needs nfse.companies.manage.
PATCH/v1/companies/:id/service-tax-profiles/:serviceId200 OKChanges the listed fields of a profile; omitted fields stay. Needs nfse.companies.manage.
POST/v1/companies/:id/service-tax-profiles/:serviceId/approve201 CreatedApproves the saved classification of the service for this company. Needs nfse.companies.manage.
DELETE/v1/companies/:id/service-tax-profiles/:serviceId200 OKDeletes a profile that has expired and was never approved (422 otherwise). Needs nfse.companies.manage.
GET/v1/companies/:companyId/accountant-package200 OKThe accountant e-mail and the last month sent. Needs nfse.companies.view.
PUT/v1/companies/:companyId/accountant-package200 OKSets the accountant e-mail; null or blank turns the monthly send off. A new address gets a short hello (testEmailSent) so a wrong recipient is noticed. Needs nfse.companies.manage.
POST/v1/companies/:companyId/accountant-package/send200 OKSends the package of a month now, even if it was already sent. status is sent (queued for e-mail, not proof of delivery) or skipped-test, skipped-no-email, skipped-empty, skipped-too-large, with nothing sent. 10 per hour. Needs nfse.companies.manage.
GET/v1/companies/:companyId/accountant-package/sends200 OKThe last 12 attempts to send the package. Needs nfse.companies.view.

Certificates

Details and examples
MethodEndpointSuccessDescription
POST/v1/companies/:companyId/certificates201 CreatedUploads an A1 certificate (.p12/.pfx) for a company. The certificate is parsed, its validity is checked, and its CNPJ must match the company's.
GET/v1/companies/:companyId/certificates200 OKLists the certificates of a company.
DELETE/v1/companies/:companyId/certificates/:certId204 No ContentRevokes a certificate and updates the company's readiness.

Invoices

Details and examples
MethodEndpointSuccessDescription
POST/v1/invoices202 AcceptedRequests 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/batches202 AcceptedRequests 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/calculate200 OKCalculates 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.
POST/v1/invoices/:id/substitute202 AcceptedIssues a new invoice that replaces an authorized one. The original stays authorized until the Receita authorizes the substitute and only then becomes cancelled; if the Receita refuses, the original does not change. Customer, competence date and amount are copied from the original.
GET/v1/customers200 OKLists the saved customers of the key's environment, most recently used first. search matches part of the name or the start of the CPF/CNPJ (punctuation is ignored).
GET/v1/customers/:taxId200 OKGets a saved customer by CPF or CNPJ, with or without punctuation. Answers 404 when the document was never saved.
PATCH/v1/customers/:taxId200 OKCorrects the name, the email, the NF-e address, indIeDest or the state registration of a saved customer. Send only what changes; null removes a field. The correction applies to the next invoices.
DELETE/v1/customers/:taxId200 OKForgets the saved customer. Invoices already issued do not change, and the name is no longer filled in.
GET/v1/invoices200 OKLists invoices, newest first.
GET/v1/invoices/external/:externalId200 OKFinds an invoice by your own reference (the externalId sent when issuing). Same answer as GET /v1/invoices/:id, searching NFS-e, NF-e and NFC-e; type in the body says which one it is.
GET/v1/invoices/:id200 OKFetches a single invoice by id.
GET/v1/invoices/:id/xml200 OKDownloads the XML of an authorized invoice.
GET/v1/invoices/:id/pdf200 OKDownloads the PDF of an authorized invoice.
GET/v1/companies/:companyId/invoice-package200 OKDownloads the month package for the accountant: a ZIP with xml/, pdf/ and resumo.csv.
GET/v1/invoices/:id/events200 OKFetches the status history of an invoice, oldest first. Paginated like any list (limit, cursor).
POST/v1/invoices/:id/download-url200 OKGenerates a short-lived signed URL for the invoice documents.
POST/v1/invoices/:id/email202 AcceptedRequests email delivery of the invoice, by default to the address stored in customerSnapshot.email. Send { "email": "someone@example.com" } in the body to use another recipient (for example to resend to a corrected address). The invoice must be authorized with documents ready.
POST/v1/invoices/:id/cancel200 OK / 202 AcceptedCancels 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.
GET/v1/invoices/overview200 OKCounts for the last 7 or 30 calendar days (America/Sao_Paulo, today included), the authorizations per day and the 5 most recent invoices. Needs nfse.invoices.view.
GET/v1/fiscal-portal/status200 OKWhether the national NFS-e portal is answering for the environment of the key. While available is false, invoices wait in the queue and are sent once it answers again. Needs nfse.invoices.view.
POST/v1/invoices/review202 AcceptedResolves up to 100 invoices in manual_review. retry sends the invoice again with the same DPS: the portal is asked about that DPS first, so it never issues a second NFS-e. discard rejects the invoice (and refunds its credit) only after the portal confirms the DPS was never registered; if the NFS-e exists, the invoice becomes authorized. Invoices not in manual_review are skipped. Follow the result by webhook. Needs nfse.invoices.issue.
GET/v1/companies/:companyId/invoice-package/summary200 OKHow many authorized and cancelled invoices the competence month has, and their total, without building the ZIP. Use it to check the month fits the limit (limit, 500) before GET /v1/companies/:companyId/invoice-package. Needs nfse.invoices.view.
GET/v1/companies/:companyId/service-favorites200 OKThe favorite services of the company; ?kind=product lists the saved products instead (see NF-e). Needs nfse.invoices.view or nfe.documents.view.
POST/v1/companies/:companyId/service-favorites201 CreatedSaves a favorite service, or a product with kind: "product" (see NF-e). Needs nfse.invoices.issue or nfe.documents.issue.
DELETE/v1/companies/:companyId/service-favorites/:favoriteId200 OKRemoves a favorite service. Issued invoices are not changed. Needs nfse.invoices.issue.

Import spreadsheet

Details and examples
MethodEndpointSuccessDescription
POST/v1/imports202 AcceptedUploads a spreadsheet (.csv or .xlsx, up to 2,000 rows and 10 MB) as multipart/form-data. Reading is **asynchronous**: the answer is the import to follow, with status: "processing". If the very same file was uploaded before for this company and environment, duplicate_of carries the earlier import (a warning, not a block).
GET/v1/imports200 OKLists the recent imports of the environment, newest first, with their counters (at most 20). Useful to find an import again, for example one waiting for credits.
GET/v1/imports/:id200 OKStatus and counters of one import. Poll it while status is processing or emitting. While reading, rows_expected is how many rows the file has and counters.total how many are already checked.
GET/v1/imports/:id/rows200 OKThe rows of an import, **one page at a time** (never the whole sheet). Filter by status to list only the rows with problems (invalid) and read the reason in error_code and error_message.
PATCH/v1/imports/:id/rows/:line200 OKCorrects one row and checks it again, only while the import is ready. Send the changed fields in item. customer and service are merged field by field, so editing the e-mail keeps the name. companyId and companyTaxId cannot be changed. The answer is the row, valid or still invalid with the reason. A row already queued for issuing answers 409 with ERROR_IMPORT_STATE.
POST/v1/imports/:id/emit202 AcceptedIssues every valid row, in chunks of 50, with one idempotency key per line: calling it twice never issues twice. If the plan limit or the credits run out, the remaining rows are left as awaiting_credits (not errors). After topping up, **call it again**: only those rows are sent.

Webhooks

Details and examples
MethodEndpointSuccessDescription
GET/v1/webhooks200 OKLists the webhook configurations of the account.
POST/v1/webhooks201 CreatedRegisters a webhook configuration.
DELETE/v1/webhooks/:id200 OKDeletes a webhook configuration.
POST/v1/webhooks/:id/test200 OKSends a webhook.test event — always with environment test — to the registered URL.
GET/v1/webhooks/deliveries200 OKLists webhook deliveries, newest first.
GET/v1/webhooks/deliveries/stats200 OKFetches delivery statistics for the recent window.
POST/v1/webhooks/deliveries/:id/retry200 OKSchedules a new delivery attempt for a failed delivery.

Billing & quotas

Details and examples
MethodEndpointSuccessDescription
GET/v1/billing/plan200 OKFetches the current plan and its consumption.
GET/v1/billing/usage200 OKFetches quota availability for issuance.
POST/v1/billing/upgrade200 OKSchedules the switch to the target plan on the subscription.
POST/v1/billing/downgrade200 OKSchedules a plan change for the end of the period.
GET/v1/plans200 OKLists the plans with their monthly price and allowance.
GET/v1/plans/:slug200 OKFetches the price of one plan.
GET/v1/plans/recommend200 OKCheapest way to cover N notes a month: a plan, a plan plus single notes, or single notes only.

Errors

Details and examples
HTTPUsage
200 / 201 / 202Action completed / resource created / asynchronous processing accepted.
204Operation completed with no body.
400Invalid DTO, parameter, JSON, UUID, limit or cursor.
401 / 403Missing or invalid authentication / access denied (scope, endpoint not enabled for API keys, blocked company).
404Resource not found, including resources of another tenant.
409 / 410Conflict (duplicate CNPJ, idempotency conflict, documents not ready yet) / resource retired.
413 / 415Payload too large / unsupported encoding.
422Fiscal validation in the domain or a rejected business rule (readiness, certificate, quota).
429Rate limit or cooldown; honor Retry-After.
500 / 502 / 503 / 504Internal error / invalid dependency / unavailability / timeout.
codeWhen it happens
ERROR_VALIDATIONInvalid body or query; see details[].
ERROR_INVALID_LIMITlimit outside 1–1000 or not an integer (400).
ERROR_INVALID_CURSORTampered cursor, or one from another collection, tenant or filter (400).
ERROR_RATE_LIMIT_EXCEEDEDRequest limit exceeded (429).
ERROR_INSUFFICIENT_CREDITS / ERROR_QUOTA_EXCEEDEDNot enough credits or quota to issue.
ERROR_COMPANY_NOT_READY / ERROR_COMPANY_BLOCKEDCompany without an active certificate in live, or blocked.
ERROR_IDEMPOTENCY_CONFLICTSame Idempotency-Key with a different payload (409).
ERROR_TAX_REGIME_NOT_SUPPORTEDOnly MEI and Simples Nacional companies are supported (422).
ERROR_VALIDATION with details[].code ERROR_DEDUCTION_NOT_ALLOWED_FOR_REGIME or ERROR_SIMPLES_SUBLIMIT_NOT_SUPPORTEDA 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_GONERetired operation, such as one-off credit purchases (410).