Invoices
Issue NFS-e, fetch status, download documents and request email delivery.
Permissions: nfse.invoices.issue to issue/request email; nfse.invoices.view for fetches, documents and signed URLs.
/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.
| Field | Type | Required | Description |
|---|---|---|---|
| companyId | string UUID | Send this field or companyTaxId; if both exist, companyId takes precedence. | |
| companyTaxId | string | CNPJ of a company already registered in the account/environment; punctuation optional. | |
| externalId | string | Reference from the integrating system; does not replace the idempotency key. | |
| customer | object | Optional: omit it or send {} for an invoice without tomador (the customer is left out of the DPS). When sent with any data, taxId is required (valid CPF or CNPJ, normalized); name is optional, email (optional; required when email sending is enabled; no email format validation in this DTO/domain) and address (optional: street, city, state, zip, country are optional strings; if you fill in city or state, fill in both; state must be valid). | |
| service | object | ✓ | code is optional: without it the company defaultServiceCode is used and, if the company has none, 100901 (LC 116 item 10.09, representation of any nature); exactly 6 digits when provided. municipalityCode inherits the company municipality; when provided, exactly 7 digits and sets the service location. description is optional: when empty, the name of the service code is used. Empty, null or invalid values of the other fields do not use the defaults. |
| amount | number | ✓ | Value in reais, positive, up to 9999999999.99 with at most 2 decimals. |
| competenceDate | string ISO 8601 | ✓ | Valid competence date. Without options.type it cannot be in the future (422 ERROR_FUTURE_DATE). With SCHEDULE or RECURRING it is the date of the first run, from tomorrow on (see Scheduled and recurring invoices). |
| discount | number | Unconditional discount in BRL, from 0 up to the invoice amount, at most 2 decimal places. | |
| deduction | number | Deduction from the ISS base declared by the issuer, in BRL: greater than 0 and less than amount minus discount, at most 2 decimal places (0 is the same as omitting it). Sent in the DPS as vDedRed/vDR, it reduces the ISS tax base. The invoice is still issued for the full amount. The issuer is responsible for the declared value; Corvo does not check whether the deduction is allowed. IBS/CBS is still calculated on the amount without the deduction. See ISS base deduction. | |
| purchaseOrder | string | Purchase order or service order number the customer asked to see on the invoice, up to 60 characters on one line. Sent in the DPS as serv/infoCompl/xPed and printed on the PDF. It changes no tax. | |
| notes | string | Free text printed on the invoice as complementary information, up to 2,000 characters (line breaks allowed). Sent in the DPS as serv/infoCompl/xInfComp. It changes no tax. A blank value is the same as omitting it. | |
| boolean | Requests a notification; defaults to false. | ||
| options.email.send | boolean | When set, takes precedence over email. | |
| options.type | string | IMMEDIATE (default), SCHEDULE or RECURRING. SCHEDULE and RECURRING create a schedule instead of issuing now; see Scheduled and recurring invoices. | |
| options.recurrence.frequency | string | WEEKLY, BIWEEKLY or MONTHLY. Required with RECURRING; not allowed with the other types. | |
| options.recurrence.endsOn | string YYYY-MM-DD | Last day the recurrence may run (inclusive). Without it, it runs until paused or cancelled. |
curl -X POST "$BASE_URL/invoices" \
-H "X-API-Key: $CORVO_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: pedido_123_emissao' \
-d '{
"companyTaxId": "11222333000181",
"externalId": "pedido_123",
"customer": {
"name": "Cliente Exemplo",
"taxId": "52998224725",
"email": "cliente@example.com",
"address": { "city": "São Paulo", "state": "SP" }
},
"service": {
"description": "Prestação de serviço"
},
"amount": 150.50,
"competenceDate": "2026-10-01",
"options": { "email": { "send": true } }
}'Response — 202 Accepted
{
"data": {
"id": "6c4d2e81-0a3b-4c5d-9e7f-1a2b3c4d5e6f",
"companyId": "3f1c8a90-6b2e-4d5a-9c11-8e2f0a7b4d11",
"environment": "test",
"externalId": "pedido_123",
"idempotencyKey": "pedido_123_emissao",
"status": "queued",
"amount": 150.5,
"currency": "BRL",
"competenceDate": "2026-10-01T00:00:00.000Z",
"stage": "pending",
"createdAt": "2026-10-10T12:00:00.000Z"
}
}/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.
| Field | Type | Required | Description |
|---|---|---|---|
| invoices | array | ✓ | List of 1 to 50 items. Each item takes the fields of POST /v1/invoices (companyId or companyTaxId, service, amount, competenceDate, optional customer, discount, deduction, options...). Items can belong to different companies of the account. Fewer than 1 or more than 50 items returns 400 ERROR_VALIDATION for the whole request. |
| invoices[].idempotencyKey | string | Idempotency key of the item (up to 255 characters). With the same key and the same content, repeating the batch returns the invoice already saved with replayed: true instead of issuing again. The Idempotency-Key header is not used by this route. |
curl -X POST "$BASE_URL/invoices/batches" \
-H "X-API-Key: $CORVO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"invoices": [
{
"companyTaxId": "11222333000181",
"idempotencyKey": "planilha-out-linha-2",
"customer": { "name": "Cliente A", "taxId": "52998224725" },
"service": { "description": "Consultoria" },
"amount": 150.50,
"competenceDate": "2026-10-01"
},
{
"companyTaxId": "45723174000110",
"idempotencyKey": "planilha-out-linha-3",
"service": { "description": "Manutenção mensal" },
"amount": 300,
"competenceDate": "2026-10-01"
}
]
}'Response — 202 Accepted
{
"data": {
"total": 3,
"accepted": 2,
"rejected": 1,
"results": [
{
"index": 0,
"status": "accepted",
"invoice": {
"id": "6c4d2e81-0a3b-4c5d-9e7f-1a2b3c4d5e6f",
"companyId": "3f1c8a90-6b2e-4d5a-9c11-8e2f0a7b4d11",
"environment": "test",
"idempotencyKey": "planilha-out-linha-2",
"status": "queued",
"amount": 150.5,
"currency": "BRL",
"competenceDate": "2026-10-01T00:00:00.000Z",
"stage": "pending",
"createdAt": "2026-10-10T12:00:00.000Z"
}
},
{
"index": 1,
"status": "accepted",
"replayed": true,
"invoice": {
"id": "0b7a1f52-3c4d-4e6f-8a9b-2c3d4e5f6a7b",
"status": "queued",
"idempotencyKey": "planilha-out-linha-3",
"amount": 300
}
},
{
"index": 2,
"status": "rejected",
"error": {
"code": "ERROR_VALIDATION",
"message": "Request validation failed",
"details": [
{ "field": "amount", "code": "ERROR_OUT_OF_RANGE", "message": "amount must be greater than 0" }
]
}
}
]
}
}/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.
| Field | Type | Required | Description |
|---|---|---|---|
| (corpo) | objeto | ✓ | Same body as POST /v1/invoices (company, service, amount, competenceDate, optional customer, discount, deduction). Requires the nfse.invoices.issue permission. It does not require a certificate or a ready company. |
curl -X POST "$BASE_URL/invoices/calculate" \
-H "X-API-Key: $CORVO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"companyTaxId": "11222333000181",
"service": { "code": "060101", "description": "Haircut" },
"amount": 50,
"competenceDate": "2026-10-13"
}'Response — 200 OK
{
"data": {
"preEmission": true,
"status": "ready",
"disclaimer": "Pre-emission calculation. Values are not a fiscal document and may differ from the final validation by Sefin.",
"competenceDate": "2026-10-13",
"taxRegime": "MEI",
"classification": {
"serviceCode": "060101",
"source": "official_catalog",
"operationNature": "SERVICE",
"nbsCode": null,
"cst": null,
"classCode": null,
"serviceProfileId": null,
"catalogValidated": false
},
"applicability": {
"customerRequired": false,
"strategy": "mei",
"iss": {
"status": "NOT_APPLICABLE",
"reason": "ISS recolhido no DAS-MEI"
},
"federalWithholding": {
"status": "NOT_APPLICABLE",
"reason": "no federal withholding on payments to Simples Nacional/MEI optants (IN RFB 1.234/2012, art. 4, XI)"
},
"cbs": {
"status": "NOT_APPLICABLE",
"reason": "MEI não destaca IBS/CBS na fase de teste de 2026"
},
"ibs": {
"status": "NOT_APPLICABLE",
"reason": "MEI não destaca IBS/CBS na fase de teste de 2026"
}
},
"taxes": {},
"withholdings": [],
"netReceivableAmount": "50.00",
"collectionWaived": false,
"calculation": {
"source": "none",
"calculatorVersion": null,
"rulesVersion": "2026.11-r1",
"legalReferences": [
"Ato Conjunto RFB/CGIBS nº 4/2026, alterado pelo nº 7/2026; orientação CGNFS-e de 07/08/2026"
]
},
"warnings": [
{
"code": "CLASSIFICATION_NOT_CATALOG_VALIDATED",
"message": "Service tax classification was not validated against the official catalog",
"step": "ServiceTaxClassifier"
}
],
"pendingFields": [],
"blocking": null,
"trace": [
{
"step": "CompanyFiscalProfile",
"status": "applied",
"durationMs": 2.4
},
{
"step": "ServiceTaxClassifier",
"status": "applied",
"durationMs": 7.1
},
{
"step": "TaxApplicabilityResolver",
"status": "applied",
"durationMs": 0.3
},
{
"step": "RtcTaxCalculator",
"status": "skipped",
"durationMs": 0.03,
"reason": "MEI não destaca IBS/CBS na fase de teste de 2026"
},
{
"step": "FiscalValidator",
"status": "applied",
"durationMs": 0.1
}
]
}
}Scheduled and recurring invoices
Use options.type: "SCHEDULE" to issue an invoice once on a future date, or options.type: "RECURRING" to repeat it every week, every two weeks or every month. Neither issues now: they create a **schedule**, and the response is the schedule (202), not an invoice. competenceDate is the date of the first run: from tomorrow on and up to 15 days ahead (up to 31 days for RECURRING, so a monthly one can start today).
| Situation | Result |
|---|---|
No options.type (or IMMEDIATE) and a future competenceDate | 422 with ERROR_FUTURE_DATE in details[].code. |
SCHEDULE or RECURRING with a competenceDate from tomorrow on, within the limit (default 15 days ahead) | 202 with the schedule (id, kind, status: active, next_run_on). The invoice only exists when the schedule runs. |
SCHEDULE or RECURRING with a competenceDate of today or in the past | 422 with first_date_too_soon in details[].code. To issue now, use IMMEDIATE. |
SCHEDULE or RECURRING beyond the limit | 422 with schedule_horizon_exceeded. |
RECURRING without options.recurrence.frequency | 422 with required. A recurrence with SCHEDULE or IMMEDIATE gives 422 with not_allowed. |
options.recurrence.endsOn equal to or before the first date | 422 with ends_before_start. |
| More than 200 active schedules in the account | 422 with ERROR_SCHEDULE_LIMIT. |
Create a monthly recurrence
curl -X POST "$BASE_URL/invoices" \
-H "X-API-Key: $CORVO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"companyTaxId": "11222333000181",
"service": { "description": "Monthly fee" },
"amount": 150,
"competenceDate": "2026-11-10",
"options": {
"type": "RECURRING",
"recurrence": { "frequency": "MONTHLY", "endsOn": "2027-10-10" }
}
}'Response: the schedule
{
"data": {
"id": "8f6c2b1e-0d4a-4c43-9c1a-2d7f5e3b9a10",
"kind": "recurring",
"frequency": "MONTHLY",
"status": "active",
"pause_reason": null,
"company_id": "5b0e7c5a-5d0b-4f45-8d6c-3a2a1e9d7f20",
"anchor_on": "2026-11-10",
"next_run_on": "2026-11-10",
"ends_on": "2027-10-10",
"attempts": 0,
"last_run_on": null,
"invoice": { "amount": 150, "service": { "description": "Monthly fee" } },
"created_at": "2026-11-06T15:00:00.000Z"
}
}Manage schedules
| Method | Route | Description | Status |
|---|---|---|---|
| GET | /v1/schedules | List schedules (filters status and companyId) | 200 |
| GET | /v1/schedules/:id | Get a schedule | 200 |
| GET | /v1/schedules/:id/runs | Run history: due date, day it ran, result, issued invoice or error | 200 |
| PATCH | /v1/schedules/:id | Change invoice, endsOn, frequency or anchorOn; applies to the next runs | 200 |
| POST | /v1/schedules/:id/pause | Pause | 200 |
| POST | /v1/schedules/:id/resume | Resume a paused schedule | 200 |
| POST | /v1/schedules/:id/cancel | Cancel (final) | 200 |
A schedule has id, kind (once or recurring), frequency, status (active, paused, completed, cancelled), pause_reason (customer or failures), company_id, anchor_on, next_run_on, ends_on, attempts (failures in a row, 0 to 3), last_run_on, invoice (the body issued on each run) and created_at. Permissions: nfse.invoices.view to read and nfse.invoices.issue to create and change. A test key sees only test schedules, and a live key only live ones.
Scheduling an NF-e
An NF-e (type: "nfe") can be scheduled and repeated the same way: send options.type SCHEDULE or RECURRING (and options.recurrence) with the NF-e body, and competenceDate as the day of the first run (from tomorrow on). The whole NF-e is checked now, exactly as POST /v1/invoices/validate does (company ready, recipient with full address, items, payments, XSD), so a broken note never becomes a schedule. The answer is 202 with the schedule, which has type: "nfe".
| Situation | Result |
|---|---|
| Each run (09:00, business days) | Issues the NF-e as it was saved, with an Idempotency-Key made of the schedule and the day: a retry or a restart never issues the same note twice. The credit is used at the run. |
| Items and price | They stay as they were saved: Corvo does not control stock. To change them, PATCH /v1/schedules/:id with invoice (each field sent replaces the stored one as a whole, so send the full items). |
| The SEFAZ is down at the run | Nothing fails: the NF-e is queued as usual and Corvo sends it when the SEFAZ is back. |
The NF-e is refused at the run (invalid data, company not ready, NFE_PRODUCTION_DISABLED, no credits) | The attempt fails, is retried on the next business day and, after 3 failed attempts in a row, the schedule pauses and the workspace gets an e-mail. Resume it after fixing the cause. |
type: "nfce" with SCHEDULE or RECURRING | 422 with INVOICE_OPERATION_NOT_SUPPORTED: the NFC-e is a sale at the counter and is issued on the spot. |
GET /v1/schedules and GET /v1/schedules/:id answer type (nfse or nfe), and GET /v1/schedules?type=nfe filters. Permissions follow the kind: nfe.documents.view and nfe.documents.issue for an NF-e schedule. In the MCP, nfse_issue with type: "nfe" takes emission_type, competence_date and recurrence_frequency, and the schedule_* tools work on both kinds (schedule_update takes the NF-e fields in nfe).
Customer abroad
For a customer outside Brazil, send customer.foreign instead of the CPF or CNPJ. The invoice identifies the customer by its NIF (the tax id in its own country) and carries the address abroad.
| Field | Rule |
|---|---|
customer.name | Required for a customer abroad. |
foreign.taxId | Tax id in the customer's country (NIF), up to 40 characters. Send this field **or** noTaxIdReason, never both. |
foreign.noTaxIdReason | When the customer has no tax id: exempt or not_required. |
foreign.country | Two-letter country code (ISO 3166-1), other than BR. |
foreign.postalCode, city, region | Postal code (up to 11), city and state, province or region (up to 60 each). Required. |
foreign.street, number, district | Street (up to 255), number and district or neighbourhood (up to 60 each). The invoice layout requires all three. |
foreign.complement | Optional, up to 156 characters. |
| Cannot be combined | customer.taxId and customer.address (the Brazilian address) answer 422 with not_allowed. |
Invoice for a customer abroad
curl -X POST "$BASE_URL/invoices" \
-H "X-API-Key: $CORVO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: pedido_981_emissao" \
-d '{
"companyTaxId": "11222333000181",
"service": { "description": "Software development" },
"amount": 5000,
"competenceDate": "2026-11-10",
"customer": {
"name": "Acme Inc.",
"foreign": {
"taxId": "12-3456789",
"country": "US",
"postalCode": "94105",
"city": "San Francisco",
"region": "CA",
"street": "1 Market St",
"number": "100",
"district": "SoMa"
}
}
}'Substituting an invoice
POST /v1/invoices/:id/substitute issues a new invoice that replaces an **authorized** one. The Receita cancels the original in the same act that authorizes the substitute, so there is no gap without a valid invoice. The answer is 202 with the substitute in queued, with substitutesInvoiceId pointing at the original.
| Field | Rule |
|---|---|
description | Required, 15 to 255 characters: why the invoice is being substituted. Sent in the DPS as subst/xMotivo. |
service.description | Optional. New service description. |
purchaseOrder, notes | Optional. Omitting keeps what the original had; an empty text removes it. |
| What does not change | Customer, competence date and amount stay as in the original. For MEI and Simples Nacional the Receita refuses a substitute that changes any of them (rule E0061). To correct those, cancel the invoice and issue another. |
| Original | Stays authorized until the Receita authorizes the substitute. Once it does, the original becomes cancelled and you receive nfse.invoice.cancelled with substitutedBy. If the Receita refuses, the original does not change and the substitute is rejected. |
| Credit | The substitute uses a credit, like any issued invoice. The credit of the original is not returned. |
| Errors | 409 ERROR_INVOICE_NOT_SUBSTITUTABLE when the invoice is not authorized; 404 when it does not exist. |
/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.
| Field | Type | Required | Description |
|---|---|---|---|
| description | string | ✓ | Required, 15 to 255 characters: why the invoice is being substituted (DPS subst/xMotivo). |
| service.description | string | New service description. | |
| purchaseOrder | string | New purchase order. Omitting keeps the original; an empty text removes it. | |
| notes | string | New notes. Omitting keeps the original; an empty text removes it. |
curl -X POST "$BASE_URL/invoices/$INVOICE_ID/substitute" \
-H "X-API-Key: $CORVO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: pedido_981_substituicao" \
-d '{
"description": "Descricao do servico corrigida",
"service": { "description": "Consultoria em tecnologia, outubro/2026" },
"purchaseOrder": "PO-4521"
}'Response — 202 Accepted
{
"data": {
"id": "9b2f4c1e-7a35-4d0f-8c21-5e6a1b3d7f90",
"status": "queued",
"substitutesInvoiceId": "6f1c0e2a-4b7d-4c1e-9a55-2b8f7c3d9e10",
"substitutionDescription": "Descricao do servico corrigida",
"amount": 1000,
"serviceSnapshot": {
"description": "Consultoria em tecnologia, outubro/2026",
"code": "010601",
"municipalityCode": "3550308",
"purchaseOrder": "PO-4521"
}
}
}Saved customers
After an invoice with a customer is accepted, Corvo keeps the CPF or CNPJ, the name and the email of that customer (an accepted NF-e also keeps the address, the indIeDest and the state registration, to fill the next NF-e). On the next invoice for the same document, send only customer.taxId: the name comes from the saved customer. What you send in the request always wins, and an invoice already issued never changes.
| Rule | Detail |
|---|---|
| Scope | One saved customer per document in each workspace and environment. test and live never mix. |
| What is filled | Only the name, and only when the request carries none. The saved email is not used to send the invoice. |
| Not saved yet | The invoice follows as before: without a name, the customer is issued as Consumidor. Send the name on the first invoice. |
| Updates | The saved name follows the latest invoice; a saved email is kept when the invoice carries no email. |
| Where it applies | Single invoices, batches, spreadsheets, schedules and recurrences, and the MCP tools. |
| Idempotency | The request hash is computed before the name is filled, so repeating the same call still returns the same invoice. |
/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).
| Field | Type | Required | Description |
|---|---|---|---|
| search | string | Part of the name or start of the document. | |
| limit | number | Items per page (default 50). | |
| cursor | string | Cursor returned by the previous page. |
curl "$BASE_URL/customers?search=acme&limit=50" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{
"data": [
{
"taxId": "11222333000181",
"name": "Acme Ltda",
"email": "financeiro@acme.com.br",
"lastUsedAt": "2026-11-10T12:00:00.000Z",
"createdAt": "2026-11-01T12:00:00.000Z",
"updatedAt": "2026-11-10T12:00:00.000Z"
}
],
"pagination": { "limit": 50, "hasMore": false, "nextCursor": null }
}/v1/customers/:taxId200 OKGets a saved customer by CPF or CNPJ, with or without punctuation. Answers 404 when the document was never saved.
curl "$BASE_URL/customers/11222333000181" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{
"data": {
"taxId": "11222333000181",
"name": "Acme Ltda",
"email": "financeiro@acme.com.br",
"lastUsedAt": "2026-11-10T12:00:00.000Z",
"createdAt": "2026-11-01T12:00:00.000Z",
"updatedAt": "2026-11-10T12:00:00.000Z"
}
}/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.
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | New name, up to 300 characters. | |
| string | null | New email, or null to remove it. | ||
| address | object | null | Recipient address for NF-e: street, number, complement?, district, zip (8 digits), cityCode (IBGE, 7 digits), city, state. null removes it. | |
| indIeDest | 1 | 2 | 9 | null | 1 taxpayer, 2 exempt, 9 non-taxpayer. | |
| stateRegistration | string | null | State registration (IE) of the customer. |
curl -X PATCH "$BASE_URL/customers/11222333000181" \
-H "X-API-Key: $CORVO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name":"Acme S.A."}'Response — 200 OK
{
"data": {
"taxId": "11222333000181",
"name": "Acme S.A.",
"email": "financeiro@acme.com.br",
"lastUsedAt": "2026-11-10T12:00:00.000Z",
"createdAt": "2026-11-01T12:00:00.000Z",
"updatedAt": "2026-11-10T12:00:00.000Z"
}
}/v1/customers/:taxId200 OKForgets the saved customer. Invoices already issued do not change, and the name is no longer filled in.
curl -X DELETE "$BASE_URL/customers/11222333000181" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{
"data": null
}ISS base deduction
The issuer can declare in deduction an amount that the municipality's legislation allows to be deducted from the ISS tax base. The value is sent in the DPS as vDedRed/vDR and reduces the ISS base; the invoice is still issued for the full amount (amount).
| Field / tax | How it is handled |
|---|---|
amount | Total amount of the invoice. |
deduction | Amount to deduct from the ISS base. Greater than 0 and less than amount minus discount; 0 is the same as omitting it. |
| ISS | Base = amount − discount − deduction. |
| Federal withholdings | Base unchanged: amount − discount. |
| IBS/CBS | Calculated on the amount without the deduction. |
| Net receivable | Does not change with the deduction. |
| Validation errors | 422 with out_of_range (negative, or not less than amount minus discount) or invalid_decimal_places in details[].code, on field: "deduction". |
| Response | The invoice echoes deduction when one was declared. |
Invoice with a deduction
curl -X POST "$BASE_URL/invoices" \
-H "X-API-Key: $CORVO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order_123" \
-d '{
"companyTaxId": "11222333000181",
"service": { "description": "Maintenance service" },
"amount": 100,
"deduction": 40,
"competenceDate": "2026-10-20"
}'Invoice schema
Each invoice has these fields:
| Fields | Type / notes |
|---|---|
id, companyId | Identification strings. |
environment | test or live. |
externalId, idempotencyKey | String or null. |
status | Enum described below. |
customerSnapshot | taxId, name, email?, address?: { city, state, country? }. |
serviceSnapshot | description, code, municipalityCode. |
taxSnapshot | Fiscal information object. |
amount, currency, competenceDate | Number in reais, currency and ISO 8601 date-time (the competence date at midnight UTC, e.g. 2026-10-01T00:00:00.000Z). |
discount, deduction | Optional numbers in reais: the unconditional discount and the issuer-declared deduction from the ISS base (see ISS base deduction). |
dpsId, dpsSeries, dpsNumber | String/string/number or null. |
accessKey, nfseNumber | String/number or null. |
fiscalProvider, fiscalSchemaVersion | Strings. |
issuedAt, authorizedAt | ISO date or null. |
emailSnapshot | Optional object with send. |
lastErrorCode, lastErrorMessage, lastErrorProvider | String or null. |
documentsReadyAt | ISO date or null. |
lastEmailStatus, lastEmailSentAt | queued, sent, failed or null; ISO date or null. |
documentsStatus | Derived state: pending or ready. |
emailStatus | Derived state: queued, sent, failed or null. |
stage | Derived state: pending, authorized, documents_ready, completed, failed. |
scheduledFor | ISO release date of a scheduled invoice, or null. |
cancellationReason, cancellationDescription | Reason (issue_error, service_not_provided or other) and justification of the cancellation request, or null. |
cancelledAt | ISO date when the invoice reached cancelled, or null. |
cancellationRequestedAt | ISO date of a cancellation requested while the invoice was processing, or null. The invoice is cancelled at the Sefin as soon as it is authorized. |
createdAt, updatedAt | ISO dates. |
documentKeyVersion | Optional number, when present in the snapshot. |
requestHash is removed from serialization. The current response uses documentsReadyAt/documentsStatus, not the documentsReady boolean shown by a Swagger DTO. There is no lastEmail object in the current JSON — use the fields above. stage: completed can also occur with the email in failed; check emailStatus to know whether a send succeeded.
Fiscal statuses: queued, processing, authorized, rejected, retry_pending, reconciliation_required, manual_review, failed, cancelling, cancelled. Do not treat authorization as immediate availability of every document.
/v1/invoices200 OKLists invoices, newest first.
| Field | Type | Required | Description |
|---|---|---|---|
| companyId | string UUID | Filters by company. | |
| status | string | One of the fiscal statuses above. | |
| from | string ISO 8601 | Inclusive filter by competence date — not by createdAt. | |
| to | string ISO 8601 | Inclusive filter by competence date — not by createdAt. | |
| externalId | string | Exact match on your own reference, for every type (NFS-e, NF-e and NFC-e). It is not unique: more than one invoice can have it. | |
| customerTaxId | string | Only invoices issued to this customer, by CPF (11 digits) or CNPJ (14 digits), digits only. | |
| limit | integer | Integer between 1 and 1000; defaults to 50. | |
| cursor | string | nextCursor from the previous page, keeping the same filters. |
curl "$BASE_URL/invoices?status=authorized&limit=50" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{
"data": [
{
"id": "6c4d2e81-0a3b-4c5d-9e7f-1a2b3c4d5e6f",
"status": "authorized",
"amount": 150.5,
"competenceDate": "2026-10-01T00:00:00.000Z",
"createdAt": "2026-10-10T12:00:00.000Z"
}
],
"pagination": {
"limit": 50,
"hasMore": true,
"nextCursor": "eyJ2IjoxLCJjcmVhdGVkQXQiOiIyMDI2LTEwLTA5VDEyOjAwOjAwLjAwMDAwMFoiLCJpZCI6IjNmMWM4YTkwIn0"
}
}/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.
curl "$BASE_URL/invoices/external/pedido_123" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{
"data": {
"id": "6c4d2e81-0a3b-4c5d-9e7f-1a2b3c4d5e6f",
"type": "nfse",
"externalId": "pedido_123",
"status": "authorized"
}
}/v1/invoices/:id200 OKFetches a single invoice by id.
curl "$BASE_URL/invoices/$INVOICE_ID" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{
"data": {
"id": "6c4d2e81-0a3b-4c5d-9e7f-1a2b3c4d5e6f",
"status": "authorized",
"stage": "documents_ready",
"documentsStatus": "ready",
"accessKey": "35260712345678900000350010000000011000000019",
"nfseNumber": 123
}
}/v1/invoices/:id/xml200 OKDownloads the XML of an authorized invoice.
curl "$BASE_URL/invoices/$INVOICE_ID/xml" \
-H "X-API-Key: $CORVO_API_KEY" --fail --output nfse.xml/v1/invoices/:id/pdf200 OKDownloads the PDF of an authorized invoice.
curl "$BASE_URL/invoices/$INVOICE_ID/pdf" \
-H "X-API-Key: $CORVO_API_KEY" --fail --output nota.pdf/v1/companies/:companyId/invoice-package200 OKDownloads the month package for the accountant: a ZIP with xml/, pdf/ and resumo.csv.
curl "$BASE_URL/companies/$COMPANY_ID/invoice-package?month=2026-10" \
-H "X-API-Key: $CORVO_API_KEY" --fail --output nfse-2026-10.zip/v1/invoices/:id/events200 OKFetches the status history of an invoice, oldest first. Paginated like any list (limit, cursor).
curl "$BASE_URL/invoices/$INVOICE_ID/events" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{
"data": [
{
"id": "e1d2c3b4-5a6f-4b7c-8d9e-0f1a2b3c4d5e",
"invoiceId": "6c4d2e81-0a3b-4c5d-9e7f-1a2b3c4d5e6f",
"fromStatus": "queued",
"toStatus": "authorized",
"reason": null,
"createdAt": "2026-10-10T12:01:00.000Z"
}
],
"pagination": {
"limit": 50,
"hasMore": false,
"nextCursor": null
}
}/v1/invoices/:id/download-url200 OKGenerates a short-lived signed URL for the invoice documents.
| Field | Type | Required | Description |
|---|---|---|---|
| format | string | ✓ | "pdf" or "xml". |
curl -X POST "$BASE_URL/invoices/$INVOICE_ID/download-url" \
-H "X-API-Key: $CORVO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "format": "pdf" }'Response — 200 OK
{
"data": {
"downloadUrl": "https://storage.example.com/documento-assinado",
"expiresAt": "2026-10-10T15:00:00.000Z",
"fileName": "nfse-123.pdf",
"mimeType": "application/pdf"
}
}/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.
curl -X POST "$BASE_URL/invoices/$INVOICE_ID/email" \
-H "X-API-Key: $CORVO_API_KEY" \
-H 'Idempotency-Key: pedido_123_email'Response — 202 Accepted
{
"data": {
"emailId": "pedido_123_email",
"status": "queued"
}
}/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.
curl -X POST "$BASE_URL/invoices/$INVOICE_ID/cancel" \
-H "X-API-Key: $CORVO_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"reason":"issue_error","description":"Service amount was informed incorrectly"}'Response — 202 Accepted
{
"data": {
"id": "6f1c0e2a-4b7d-4c1e-9a55-2b8f7c3d9e10",
"status": "cancelling",
"stage": "completed",
"cancellationReason": "issue_error",
"cancellationDescription": "Service amount was informed incorrectly",
"cancelledAt": null,
"cancellationRequestedAt": null
}
}Overview and status
/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.
Query
| Field | Type | Required | Description |
|---|---|---|---|
| period | string | 7d (default) or 30d. |
curl "$BASE_URL/invoices/overview?period=30d" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{
"data": {
"period": "30d",
"from": "2026-10-26",
"to": "2026-11-24",
"timezone": "America/Sao_Paulo",
"counts": { "authorized": 118, "rejected": 2, "processing": 1 },
"dailyActivity": [ { "date": "2026-11-24", "count": 6 } ],
"recentInvoices": [ /* up to 5 invoices, like GET /v1/invoices/:id */ ]
}
}/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.
curl "$BASE_URL/fiscal-portal/status" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{ "data": { "environment": "live", "available": true, "since": null, "retryAt": null } }/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.
| Field | Type | Required | Description |
|---|---|---|---|
| action | string | ✓ | retry | discard |
| invoiceIds | uuid[] | ✓ | 1 to 100 invoice ids. |
curl -X POST "$BASE_URL/invoices/review" \
-H "X-API-Key: $CORVO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action":"retry","invoiceIds":["5f9e0a4a-2f27-4c0c-8a48-6a2a0b8a1d33"]}'Response — 202 Accepted
{ "data": { "results": [ { "id": "5f9e0a4a-2f27-4c0c-8a48-6a2a0b8a1d33", "outcome": "accepted" } ] } }/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.
Query
| Field | Type | Required | Description |
|---|---|---|---|
| month | string | ✓ | Competence month, YYYY-MM. |
curl "$BASE_URL/companies/:companyId/invoice-package/summary?month=2026-10" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{ "data": { "month": "2026-10", "count": 42, "total": 127500, "limit": 500, "companyName": "Acme", "companyTaxId": "12345678000195" } }Favorite services
Services a company issues often. Save them once and reuse the description, code and amount when issuing.
/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.
curl "$BASE_URL/companies/:companyId/service-favorites" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{ "data": [ {
"id": "9c2c9a60-7d2e-4a5f-b0a6-2d7d57b7a3c4",
"companyId": "0b7a5a3e-3c33-4d5e-9a3b-6a3d2f6b9b10",
"label": "Consultoria mensal",
"description": "Consultoria em tecnologia da informação",
"serviceCode": "010101",
"amountCents": 150000,
"municipalityCode": null,
"createdAt": "2026-11-24T12:00:00.000Z"
} ] }/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.
| Field | Type | Required | Description |
|---|---|---|---|
| label | string | ✓ | Name shown in the list. |
| description | string | ✓ | Service description printed on the invoice. |
| serviceCode | string | ✓ | Service code (LC 116). |
| amountCents | integer | Default amount in cents. | |
| municipalityCode | string | 7-digit IBGE code. |
curl -X POST "$BASE_URL/companies/:companyId/service-favorites" \
-H "X-API-Key: $CORVO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"label":"Consultoria mensal","description":"Consultoria em tecnologia da informação","serviceCode":"010101","amountCents":150000}'Response — 201 Created
{ "data": {
"id": "9c2c9a60-7d2e-4a5f-b0a6-2d7d57b7a3c4",
"companyId": "0b7a5a3e-3c33-4d5e-9a3b-6a3d2f6b9b10",
"label": "Consultoria mensal",
"description": "Consultoria em tecnologia da informação",
"serviceCode": "010101",
"amountCents": 150000,
"municipalityCode": null,
"createdAt": "2026-11-24T12:00:00.000Z"
} }/v1/companies/:companyId/service-favorites/:favoriteId200 OKRemoves a favorite service. Issued invoices are not changed. Needs nfse.invoices.issue.
curl -X DELETE "$BASE_URL/companies/:companyId/service-favorites/:favoriteId" \
-H "X-API-Key: $CORVO_API_KEY"Response — 200 OK
{ "data": { "deleted": true } }