We use cookies to improve your experience and analyze site traffic. By clicking “Accept”, you agree to our use of cookies.

Learn more about our privacy practices

NFS-e API reference

Base URL: https://api.corvo.tech/v1. Authenticate with the X-API-Key header. 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).

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.
GET/v1/invoices200 OKLists invoices, newest first.
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/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 to the address stored in customerSnapshot.email; no alternative recipient is accepted. 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.

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/quote200 OKRecommends the plan for a monthly volume of invoices and estimates the total cost.

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).