Core APIs
NF-e Invoices
18 endpoints
/api/invoice/createIssue a new invoice
Issues an NF-e (model 55). The issuing company is identified by the token header; do not send company_id in the body.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature: MD5(token + path + body + timestamp) |
| timestamp | string | Unix timestamp in seconds (5-minute window) |
Body — top-level fields
| Field | Type | Description |
|---|---|---|
| Identification and operation | ||
| id | string | Unique client-supplied ID for idempotency (composes the dedup key) |
| nature_of_operation * | string | Operation nature (e.g., "Sale of goods") |
| transaction_type * | string | Type: "0"=inbound, "1"=outbound, "2"=import, "3"=export |
| model * | string | Document model: "55"=NF-e |
| issuance_type * | string | Issuance type ("1"=normal, "9"=contingency, etc.) |
| ambiente * | string | "1"=production, "2"=homologation |
| finalidade | string | Purpose: "1"=normal, "2"=complementary, "3"=adjustment, "4"=return |
| ref_nfe_chave | string | 44-digit access key of the referenced NF-e (complementary/adjustment/return) |
| is_reopen | boolean | Reopen/overwrite a previously issued NF-e |
| dh_sai_ent | string | Exit or entry datetime (ISO 8601). Default: current timestamp |
| Amounts and discounts | ||
| total_discount_amount | decimal | Total invoice discount |
| price_includes_ipi | boolean | Whether unit prices already include IPI. When true, IPI is back-calculated from the gross price and the invoice total equals the quoted price; default false. Can be overridden per product |
| troco | decimal | Change amount (typical for NFC-e) |
| seguro | decimal | Insurance amount (apportioned across products as XML vSeg) |
| outras_despesas | decimal | Other expenses (apportioned across products as XML vOutro) |
| Indicators and additional info | ||
| ind_final | string | End consumer: "0"=B2B, "1"=B2C |
| ind_pres | string | Presence indicator: "1"=in-person, "2"=internet, "3"=tele-service, etc. |
| informacoes_complementares | string | Complementary info (written to infAdic.infCpl) |
| informacoes_fisco | string | Information for the tax authority (written to infAdic.infAdFisco) |
Body — cliente (object, required)
transaction_type 0 or 1): cpf or cnpj, name, endereco, bairro (min. 2 chars), city, uf, and cep are required. For import/export (transaction_type 2 or 3): only name is required.
| Field | Type | Description |
|---|---|---|
| cpf | string | Customer CPF (alternative to cnpj) |
| cnpj | string | Customer CNPJ (alternative to cpf) |
| ie | string | State Registration (Inscrição Estadual) |
| name * | string | Company / customer name |
| endereco | string | Street address |
| complemento | string | Address complement |
| numero | string | Address number |
| bairro | string | Neighborhood (minimum 2 characters for domestic operations) |
| city | string | City |
| uf | string | State (UF) — overwritten by the UF resolved from the CEP |
| cep | string | ZIP code (validates UF and city) |
| telefone | string | Phone |
| string | ||
| id_estrangeiro | string | Foreign ID (used for import/export) |
| c_pais | int | BACEN country code. Default: 1058 (Brazil) |
| x_pais | string | Country name. Default: "BRASIL" |
Body — products[] (array, at least 1 item)
category_id (reference to a pre-registered tax category), or the impostos object with inline configuration.
| Field | Type | Description |
|---|---|---|
| codigo | string | Internal product code |
| name * | string | Product description (CJK characters are stripped) |
| ncm * | string | NCM with 8 digits |
| cest | string | CEST code (required when ICMS-ST applies) |
| gtin | string | GTIN / barcode |
| gtin_tributavel | string | Taxable-unit GTIN |
| count * | decimal | Quantity |
| unit * | string | Commercial unit (e.g., "UN", "KG", "MT") |
| unit_price * | decimal | Unit price |
| total_price * | decimal | Total item value |
| discount_price | decimal | Discount applied to the item |
| price_includes_ipi | boolean | Per-product override of price_includes_ipi; omit to follow the invoice-level setting |
| origem * | int | Goods origin (0=Domestic, 1=Foreign — direct import, etc.) |
| indicador_total * | int | Composes the NF-e total: 0=no, 1=yes |
| category_id | string | ID of a pre-registered tax category (required if impostos is not provided) |
| impostos | object | Inline tax configuration (alternative to category_id). Structure below. The former name tax_info is still accepted. |
| disable_difal | boolean | Disables DIFAL calculation for this item |
| desconta_icms_pis_cofins | boolean | Deduct ICMS before computing PIS/COFINS — tax on (amount − ICMS), the current Brazilian standard; default false (no deduction, higher tax) |
| ii | object | Import Tax — required for CFOP 3.xxx. Structure below |
| import_declarations | array | Import Declarations (DI) — required when transaction_type="2". Structure below |
| nItemPed | int | Purchase Order Item (I61). Sequential item number within the order referenced by xPed (which comes from root id). Valid range: 1–999999. Default: omitted. |
Body — products[].impostos
| Field | Type | Description |
|---|---|---|
| industria | string | Base industry/rate (alias: aliquota) |
| icms | ||
| icms.codigo_cfop | string | CFOP |
| icms.situacao_tributaria | string | ICMS CST/CSOSN |
| icms.tipo_pessoa | string | Person type (PF/PJ) |
| icms.codigo_beneficio_fiscal | string | cBenef (tax-benefit code) |
| icms.aliquota | string | Own ICMS rate in % (CST 00, 10, 20, 51, 70, 90). If empty, the system derives it from the interstate/internal table |
| icms.aliquota_reducao | string | Own ICMS base reduction percentage (CST 20, 51, 70, 90) |
| icms.aliquota_st | string | ICMS-ST rate of the destination state in % (CST 10, 30, 70, 90) |
| icms.aliquota_reducao_st | string | ICMS-ST base reduction percentage (CST 10, 30, 70, 90) |
| icms.aliquota_mva | string | MVA/IVA-ST in % (CST 10, 30, 70, 90) |
| icms.aliquota_fcp | string | Own FCP rate in % — emits pFCP/vFCP in the ICMS group (CST 00, 10, 20, 51, 70, 90) |
| icms.aliquota_fcp_st | string | FCP-ST rate in % (CST 10, 30, 70, 90) |
| icms.aliquota_fcp_uf_dest | string | Destination state’s FCP rate % (pFCPUFDest). Falls back to aliquota_fcp when omitted |
| icms.aliquota_uf_dest | string | Destination state’s ICMS rate %. Usually not needed — the platform keeps standard rates per state. Only override when the product has a differentiated rate in the destination state (beverages, tobacco, electricity). Destination state, not the sender’s |
| icms.difal_desconta_icms_inter | boolean | Deduct the interstate ICMS already paid from the DIFAL base — the "com exclusão" in state rules. See "Interstate: how to set the DIFAL base" on this page |
| icms.difal_base_por_dentro | boolean | Gross up the DIFAL base because the tax is included in the price — the "base dupla" in state rules. See "Interstate: how to set the DIFAL base" on this page |
| icms.v_bc_uf_dest | string | If you already computed the DIFAL base, pass the amount (R$) here. The two options above stop applying |
| icms.aliquota_credito | string | Simples Nacional credit rate in % (CSOSN 101, 201, 900) |
| icms.aliquota_diferimento | string | ICMS deferral percentage (CST 51) |
| icms.motivo_desoneracao | string | ICMS exemption reason code (CST 20, 40, 41, 50, 90) |
| icms.ad_rem_icms | string | Single-phase ICMS — ad rem rate in BRL/unit (CST 02, 15, 53) |
| icms.ad_rem_icms_ret | string | Single-phase ICMS — withheld ad rem in BRL/unit (CST 15, 61) |
| icms.p_dif_mono | string | Single-phase ICMS — deferral percentage (CST 53) |
| icms.q_bc_mono | string | Single-phase ICMS — taxed quantity (liters/kg). Empty uses the item quantity (CST 02, 15, 53) |
| icms.valor_desoneracao | string | Exempted ICMS amount in BRL — emits vICMSDeson (CST 40, 41, 50, 90) |
| icms.v_bc_st_ret | string | Calculation base of the ICMS-ST withheld in the previous operation (provided, not calculated — CST 60, CSOSN 500) |
| icms.p_st | string | Rate borne by the final consumer, in % (provided, not calculated — CST 60, CSOSN 500) |
| icms.v_icms_st_ret | string | ICMS-ST amount withheld in the previous operation (provided, not calculated — CST 60, CSOSN 500) |
| icms.v_icms_substituto | string | Substitute's own ICMS amount (provided, not calculated — CST 60, CSOSN 500) |
| icms.v_bc_fcp_st_ret | string | Calculation base of the FCP withheld by ST (provided, not calculated — CST 60, CSOSN 500) |
| icms.p_fcp_st_ret | string | FCP rate withheld by ST, in % (provided, not calculated — CST 60, CSOSN 500) |
| icms.v_fcp_st_ret | string | FCP amount withheld by ST (provided, not calculated — CST 60, CSOSN 500) |
| ipi | ||
| ipi.codigo_enquadramento | string | IPI legal framework code |
| ipi.situacao_tributaria | string | IPI CST |
| ipi.aliquota | string | IPI rate |
| ipi.valor_unidade | string | IPI by quantity — value in BRL/unit. Only used when there is no percentage rate; if aliquota is present, the percentage takes precedence (CST 00, 50, 49, 99) |
| ipi.tipo_pessoa | string | Person type |
| pis | ||
| pis.situacao_tributaria | string | PIS CST |
| pis.aliquota | string | PIS rate |
| pis.valor_unidade | string | PIS by quantity — value in BRL/unit. vPIS = quantity × value (CST 03 and other per-quantity forms) |
| pis.tipo_pessoa | string | Person type |
| cofins | ||
| cofins.situacao_tributaria | string | COFINS CST |
| cofins.aliquota | string | COFINS rate |
| cofins.valor_unidade | string | COFINS by quantity — value in BRL/unit. vCOFINS = quantity × value (CST 03 and other per-quantity forms) |
| cofins.tipo_pessoa | string | Person type |
| is (Selective Tax) | ||
| is.cenario | string | IS scenario |
| is.situacao_tributaria | string | IS CST |
| is.aliquota | string | IS rate |
| is.tipo_pessoa | string | Person type |
| ibs_cbs (Tax Reform) | ||
| ibs_cbs.situacao_tributaria | string | IBS/CBS CST |
| ibs_cbs.tipo_pessoa | string | Person type |
| ibs_cbs.classificacao_tributaria | string | IBS/CBS tax classification |
| ibs_cbs.p_ibs_uf | string | IBS state rate in % (optional; empty uses the transition default, 0.10 in 2026). Accepts dot or comma |
| ibs_cbs.p_ibs_mun | string | IBS municipal rate in % (optional; default 0 in 2026) |
| ibs_cbs.p_cbs | string | CBS rate in % (optional; default 0.90 in 2026) |
| ibs_cbs.p_red_aliq | string | Rate reduction percentage (CST 011, 200, 515) |
| ibs_cbs.p_dif | string | Deferral percentage (CST 510, 515) |
| ibs_cbs.p_red_bc | string | Tax base reduction percentage (CST 222) |
| ibs_cbs.proporcao | string | Operation proportion in % (CST 221) |
| ibs_cbs.aliquota_cbs_mono | string | Single-phase CBS — rate in % over the base; takes precedence over valor_unidade_cbs (CST 620) |
| ibs_cbs.aliquota_ibs_mono | string | Single-phase IBS — rate in % over the base; takes precedence over valor_unidade_ibs (CST 620) |
| ibs_cbs.valor_unidade_cbs | string | Single-phase CBS — ad rem in BRL/unit; only used when there is no percentage rate (CST 620) |
| ibs_cbs.valor_unidade_ibs | string | Single-phase IBS — ad rem in BRL/unit; only used when there is no percentage rate (CST 620) |
| ibs_cbs.valor_deducao_legal | string | Legal base deduction value in BRL (CST 830) |
| difal | ||
| difal.disable_difal | boolean | Disables DIFAL for the item (alternative to disable_difal at the product level) |
Interstate: how to set the DIFAL base
This section applies only to interstate sales to individuals (non-taxpayers). Not needed for intrastate or B2B invoices.
Step 1 — look up the buyer’s state
| Buyer’s state | Send in addition to aliquota, aliquota_fcp |
|---|---|
| PE, RJ | nothing else |
| SE | only difal_base_por_dentro: true |
| the other 24 states AC AL AM AP BA CE DF ES GO MA MG MS MT PA PB PI PR RN RO RR RS SC SP TO | difal_desconta_icms_inter: truedifal_base_por_dentro: true |
Important: the DIFAL base method directly determines the tax due; choosing the wrong one leads to underpayment (with exposure to assessments and penalties) or overpayment. The table above reflects the prevailing practice per state and is provided for reference only — state legislation changes, and specific goods may follow differentiated rules. Confirm the applicable method for the destination state with your accountant or tax advisor before going live. If unsure, send neither difal_desconta_icms_inter nor difal_base_por_dentro: the base equals the invoice amount, which is the most conservative treatment.
Step 2 — request examples by scenario
Selling to RJ — difal_desconta_icms_inter and difal_base_por_dentro not required (FECP 2%)
{
"icms": { "codigo_cfop": "6102", "situacao_tributaria": "00",
"aliquota": "4", "aliquota_fcp": "2" }
}Selling to AL — difal_desconta_icms_inter and difal_base_por_dentro both set to true (FECP 1%)
{
"icms": { "codigo_cfop": "6102", "situacao_tributaria": "00",
"aliquota": "4", "aliquota_fcp": "1",
"difal_desconta_icms_inter": true,
"difal_base_por_dentro": true }
}If your system already calculates the DIFAL base, send v_bc_uf_dest; difal_desconta_icms_inter and difal_base_por_dentro then no longer apply
{
"icms": { "aliquota": "4", "aliquota_fcp": "1", "v_bc_uf_dest": "122.29" }
}What the three options produce
| Setting | DIFAL base | DIFAL due |
|---|---|---|
| neither difal_desconta_icms_inter nor difal_base_por_dentro | 100.00 | 16.50 |
| both true | 122.29 | 21.07 |
| v_bc_uf_dest=150 | 150.00 | 26.75 |
Invoice 100.00, interstate ICMS paid 4.00, destination rate 20.5%, FECP 1%.
Why states differ (background, safe to skip)
ICMS is a tax-inclusive tax. Some states require the DIFAL itself to be added back into its own base (base dupla) after deducting the interstate ICMS already paid (com exclusão); others simply use the invoice amount (base única). difal_desconta_icms_inter and difal_base_por_dentro correspond to these two steps. The destination rate itself is maintained by the platform.
Body — products[].ii (Import Tax)
| Field | Type | Description |
|---|---|---|
| vBC | decimal | II calculation base |
| vDespAdu | decimal | Customs expenses |
| vII | decimal | II amount |
| vIOF | decimal | IOF amount |
Body — products[].import_declarations[]
| Field | Type | Description |
|---|---|---|
| nDI | string | DI number |
| dDI | string (date) | DI date |
| xLocDesemb | string | Customs clearance location |
| UFDesemb | string | Customs clearance state |
| dDesemb | string (date) | Customs clearance date |
| cExportador | string | Exporter code |
| tpViaTransp | int | International transport mode |
| tpIntermedio | int | Intermediation type |
| vAFRMM | decimal | AFRMM amount |
| additions | array | DI additions (fields: nAdicao, nSeqAdic, cFabricante, vDescDI, nDraw) |
Body — shipping_address / delivery_address (objects, optional)
shipping_address is the pickup location (physical origin, if different from the issuer). delivery_address is the delivery location (physical destination, if different from the customer). When present, both require: cpf or cnpj, name, endereco, bairro (min. 2 chars), city, uf, and cep. Both objects share the same structure.
| Field | Type | Description |
|---|---|---|
| cpf | string | CPF (alternative to cnpj) |
| cnpj | string | CNPJ (alternative to cpf) |
| ie | string | State Registration |
| name * | string | Company / name |
| endereco * | string | Street address |
| complemento | string | Complement |
| number | string | Number (note: the field is number, not numero) |
| bairro * | string | Neighborhood |
| city * | string | City |
| uf * | string | State |
| cep * | string | ZIP code |
| telefone | string | Phone |
| string |
Body — transportation (object, optional)
transportation is omitted, the system assumes transport_mode="9" (no freight).
| Field | Type | Description |
|---|---|---|
| transport_mode | string | Freight modality: "0"=by issuer, "1"=by recipient, "2"=by third party, "3"=sender's own transport, "4"=recipient's own transport, "9"=no freight |
| freight_amount | decimal | Total freight amount |
| carrier_info — carrier | ||
| carrier_info.cpf | string | Carrier CPF (alternative to cnpj) |
| carrier_info.cnpj | string | Carrier CNPJ (alternative to cpf) |
| carrier_info.ie | string | State Registration |
| carrier_info.name | string | Company name |
| carrier_info.endereco | string | Street address |
| carrier_info.city | string | City |
| carrier_info.uf | string | State |
| carrier_info.cep | string | ZIP code |
| vehicle_info — vehicle | ||
| vehicle_info.plate | string | License plate |
| vehicle_info.uf | string | Plate state |
| vehicle_info.rntc | string | RNTC (National Cargo Carrier Registration) |
| trailer_info — trailer (same structure as vehicle_info) | ||
| trailer_info.plate | string | Trailer plate |
| trailer_info.uf | string | State |
| trailer_info.rntc | string | RNTC |
| packages[] — volumes | ||
| packages[].qty | int | Quantity |
| packages[].gross_weight | decimal | Gross weight |
| packages[].net_weight | decimal | Net weight |
| packages[].packaging_type | string | Packaging type |
| packages[].number | string | Numbering |
| packages[].mark | string | Mark |
| packages[].seals | array<string> | Seals |
| transport_tax_retention_info — ICMS retention on freight | ||
| transport_tax_retention_info.freight_service_amount | decimal | Transport service amount |
| transport_tax_retention_info.tax_base | decimal | Retention calculation base |
| transport_tax_retention_info.tax_rate | decimal | Retention rate |
| transport_tax_retention_info.cfop | string | CFOP |
| transport_tax_retention_info.cep | string | ZIP code |
Body — pag_info[] (array, optional)
[{ "payment_method": "01", "payment_indicator": "0" }] (cash, in cash).
| Field | Type | Description |
|---|---|---|
| payment_method * | string | Payment method: "01"=cash, "02"=check, "03"=credit card, "04"=debit card, "05"=store credit, "10"=meal voucher, "11"=food voucher, "15"=bank slip, "17"=PIX, "90"=no payment, "99"=others |
| payment_indicator * | string | Indicator: "0"=in cash, "1"=on credit |
| payment_value | decimal | Amount paid |
| card_info — card details (for payment_method 03/04) | ||
| card_info.integration_type * | string | Card-machine integration type (required if card_info is present) |
| card_info.brand_code * | string | Card brand (required if card_info is present) |
| card_info.acquirer_cnpj | string | Acquirer CNPJ |
| card_info.authorization_code | string | Authorization code |
* Required field.
Response fields (data)
| Field | Type | Description |
|---|---|---|
| uuid | string | Internal NF-e identifier. Use it in follow-up calls (/api/invoice/get_detail, /refresh, /cancel) |
| status | string | Situation: "Success" (authorized), "Failed" (rejected/failed), "Processing", "Canceled" |
| motivo | string | Official tax authority message for the cStat (bilingual PT / 中文 format) |
| nfe | int | Issued NF-e number |
| serie | int | NF-e series |
| chave | string | 44-digit access key (empty when the invoice was not authorized) |
| modelo | string | Document model: "nfe" |
| epec | boolean | Issued under EPEC contingency |
| xml | string | URL of the authorized XML. The DANFE (PDF) and other formats come from /api/invoice/get_detail |
Response — rejection / error
success is false and data.motivo holds the reason; chave comes back empty. Field validation errors (before reaching tax authority) return success: false with the message in message and no data object.
{
"success": false,
"data": {
"uuid": "65f8b9a1c2d3e4f5a6b7c8d9",
"status": "Failed",
"motivo": "Rejeição 226: Código da UF do Emitente diverge da UF autorizadora / 拒绝 226: 发件人所在州代码与授权州不一致",
"nfe": 100,
"serie": 1,
"chave": "",
"modelo": "nfe",
"epec": false,
"xml": ""
}
}/api/invoice/get_listList NF-e (paginated)
Lists the company's NF-e with pagination. Parameters are passed via query string (not in the body). The time filter is optional, but if used, both start_create_time and end_create_time are required.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature (path includes the query string) |
| timestamp | string | Unix timestamp in seconds |
Query string
| Parameter | Type | Description |
|---|---|---|
| page * | int | Page number (≥ 1) |
| page_size * | int | Page size (1–50) |
| start_create_time | long | Unix timestamp in milliseconds — start (requires end_create_time) |
| end_create_time | long | Unix timestamp in milliseconds — end |
| status | string | Filter by status. Values: "Success" (authorized), "Canceled" (canceled), "Voided" (voided), "Processing" (processing), "InvoicingFailed" (invoicing failed), "Failed" (failed), "Contingencia" (offline contingency), "Unknown" (unknown) |
* Required field.
/api/invoice/get_detailGet NF-e details
Returns the details of a specific NF-e by UUID or by access key. Includes XML URL, DANFE URLs (full, simplified, and label) and metadata.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature (path includes the query string) |
| timestamp | string | Unix timestamp in seconds |
Query string
| Parameter | Type | Description |
|---|---|---|
| uuid | string | NF-e UUID |
| chave | string | NF-e access key (44 digits) |
Provide uuid or chave (at least one). If both are sent, uuid takes precedence.
/api/invoice/refreshRefresh invoice status
Queries the current NF-e status at the tax authority and updates the local record. Useful when issuance remained in processing or contingency.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Description |
|---|---|---|
| uuid * | string | UUID of the NF-e to query |
* Required field.
/api/invoice/cancelCancel invoice
Cancels an authorized NF-e. The justification sent to the tax authority is fixed: "Erro no preenchimento da nota fiscal." — it cannot be configured via payload.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Description |
|---|---|---|
| uuid * | string | UUID of the NF-e to cancel (internal identifier returned by /api/invoice/create) |
* Required field.
Response fields (data)
| Field | Type | Description |
|---|---|---|
| motivo | string | Official tax authority message confirming the cancellation |
| status | string | Situation: "Canceled" |
| nfe | int | Canceled NF-e number |
| serie | int | NF-e series |
| chave | string | 44-digit access key |
| modelo | string | Document model: "nfe" |
| epec | boolean | Issued under EPEC contingency |
| xml | string | URL of the cancellation event XML |
Response — error
success: false with the tax authority message in message and no data object. Happens when uuid is missing, the certificate is invalid, or tax authority rejects the cancellation (e.g. deadline exceeded, invoice already canceled).
{
"success": false,
"message": "Rejeição: NF-e já está cancelada na base de dados da tax authority"
}/api/invoice/invalidInvalidate numbering range
Invalidates a contiguous range of NF-e numbers that were never authorized (not to be confused with cancellation — cancellation applies to already-authorized invoices). The operation is registered at the tax authority and is irreversible.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Description |
|---|---|---|
| modelo * | string | Document model: "55"=NF-e, "65"=NFC-e. (Note: the field is modelo, not model) |
| ambiente * | string | "1"=production, "2"=homologation |
| serie * | int | Series of the numbering to invalidate |
| start_number * | int | Starting number of the range |
| end_number * | int | Ending number of the range |
| motivo * | string | Justification for the invalidation (minimum 15 characters, tax authority requirement) |
* Required field.
Response fields (data)
| Field | Type | Description |
|---|---|---|
| uuid | string | Internal identifier of the invalidation record |
| xml | string | URL of the invalidation XML authorized by the tax authority |
Response — error
success: false with the tax authority message in message and no data object. Happens when a required field is missing, the certificate is invalid, or tax authority rejects the invalidation (e.g. range already invalidated).
{
"success": false,
"message": "Rejeição: Faixa de numeração já inutilizada"
}/api/invoice/get_danfeGet NF-e DANFE
Returns three URLs for an NF-e DANFE: the full DANFE (PDF), the simplified DANFE PDF (receipt format) and the simplified DANFE as a PNG (label image). PDFs are generated on demand from the authorized XML and cached in OSS. On subsequent calls, if the invoice status has not changed, the existing cache is returned; if the status has changed (e.g. the invoice was cancelled), PDFs are regenerated.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature: MD5(token + path + body + timestamp) |
| timestamp | string | Unix timestamp in seconds (5-minute window) |
Body
| Field | Type | Description |
|---|---|---|
| uuid ⚠ | string | Internal NF-e UUID (returned by /api/invoice/create) |
| chave ⚠ | string | NF-e access key (44 digits) |
⚠ Either uuid or chave is required.
Response fields
| Field | Type | Description |
|---|---|---|
| danfe | string | URL of the full DANFE PDF (A4 format) |
| danfe_simples | string | URL of the simplified DANFE PDF (receipt format) |
| danfe_simples_png | string | URL of the simplified DANFE PNG (label image) |
Error responses
| Message | Cause |
|---|---|
| uuid/chave不能为空 | Neither uuid nor chave was provided |
| 发票不存在 | Invoice not found for the token user, or authorized XML missing |
| 发票详情不存在 | Invoice detail (with protocol) not found |
| 获取PDF失败:<reason> | Failure generating the PDF from XML |
/api/invoice/get_xmlBatch export NF-e
Starts an asynchronous bulk export task for the user's invoices, filtering by period and status. Can generate an Excel spreadsheet (metadata only) or a ZIP package with the XMLs. The first call creates the task and returns status: "Processing"; subsequent calls with the same parameters return the progress until status: "Success", when the url field contains the download link.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Description |
|---|---|---|
| type * | string | Output format: "excel" (metadata spreadsheet) or any other value (e.g. "xml") for ZIP with XMLs |
| status | string | Filter by invoice status (e.g. "Success", "Canceled", "Voided"). For type=excel, lowercased internally |
| month | int | Month (1–12). When provided, overrides start_create_time/end_create_time; uses America/Sao_Paulo timezone and the current year (or previous year if the month is in the future) |
| start_create_time | long | Period start, inclusive (Unix timestamp in milliseconds). The UTC date and time of the value are read as Brasília time: send the UTC midnight of the day, e.g. Date.UTC(2026, 7, 1) = 1785542400000 means 2026-08-01 00:00 in Brasília |
| end_create_time | long | Period end, exclusive (same rule). Send the UTC midnight of the day after the last day you want: for the whole of August 2026, Date.UTC(2026, 8, 1) = 1788220800000 |
* Required field.
start_create_time/end_create_time are read by their UTC date and time and interpreted as Brasília time (UTC−3, no daylight saving). Send the UTC midnight of the calendar days: start inclusive, end exclusive. Example, full days 2026-08-29 through 2026-09-01: start_create_time = 1787961600000 (2026-08-29T00:00Z) and end_create_time = 1788307200000 (2026-09-02T00:00Z). Do not add 3 hours to the value.
Response fields
| Field | Type | Description |
|---|---|---|
| status | string | "Processing" while the task runs, "Success" when the file is ready |
| progress_count | int | Number of invoices processed so far |
| total_count | int | Total invoices to process |
| url | string | Download URL of the final file (empty while status = Processing) |
uid + token + period + status + type). Repeated calls with the same parameters return the same task's progress, without triggering new executions.
Error responses
| Message | Cause |
|---|---|
| 发票类型字段不能为空 | type missing |
/api/invoice/consultar_statusGet NF-e status
Consults the current status of an NF-e or NFC-e directly at the tax authority using the access key (44 digits), via the NfeConsultaProtocolo4 service. Works for both own invoices (issued by the token company) and third-party invoices (e.g. captured via DistDFe). The model (NF-e/NFC-e) is detected automatically from positions 20-21 of the key.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Company token (whose certificate will be used in the consultation) |
| sign | string | MD5 signature: MD5(token + path + body + timestamp) |
| timestamp | string | Unix timestamp in seconds (5-minute window) |
Body
| Field | Type | Description |
|---|---|---|
| chave * | string | Access key (44 numeric digits). Issuer UF is extracted from positions 0-1; model from positions 20-21 (55=NF-e, 65=NFC-e). |
| ambiente | string | Which environment to query: 1=production, 2=homologation (also accepts producao/homologacao). If omitted, the environment the note was issued in is used; production when the note is not found locally. The two are separate databases — querying production for a note issued in homologation always returns 217. |
* Required field.
Response fields
| Field | Type | Description |
|---|---|---|
| chave | string | Access key queried |
| status | string | Normalized status (see table below) |
| cstat | int | Raw tax authority cStat code |
| motivo | string | Raw tax authority xMotivo message |
Status mapping
status | tax authority cStat | Meaning |
|---|---|---|
| autorizada | 100, 150 | NF-e authorized for use |
| cancelada | 101, 151 | Cancelled (also returned if there is a linked cancellation event, even with cStat=100) |
| denegada | 110, 301, 302 | Use denied by the tax authority |
| inutilizada | 102 | Number invalidated (numbering range) |
| nao_encontrada | 217 | NF-e not present in the tax authority database |
| desconhecido | others | Unmapped cStat — check raw cstat and motivo |
Error responses
| Message | Cause |
|---|---|
| chave inválida: deve ter 44 dígitos | Key missing, with size other than 44, or containing non-numeric characters |
| empresa não possui certificado configurado | The token company has no cert_file registered |
| tax authority retornou resposta vazia | tax authority returned no response (timeout, offline) |
| erro ao consultar tax authority: <detail> | Exception while calling the service (invalid XML, timeout, expired certificate, etc.) |
/api/invoice/returnIssue return NF-e
Issues a return NF-e (model 55, purpose 4) from an original NF-e. Two modes are supported: full return (reference the original invoice via uuid or chave — the return is a full clone of the original NF-e) or partial/custom return (send chave + the complete invoice fields in the request body itself, same structure as /api/invoice/create).
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body — fields always read from the root
| Field | Type | Description |
|---|---|---|
| uuid | string | UUID of the original NF-e (full return; send either this or chave). It is a 36-character GUID with dashes, not the 24-character _id. With uuid and no return_detail the note is cloned in full; if return_detail is also sent, a partial return is performed |
| chave | string | 44-digit access key of the original NF-e (required for partial return; alternative to uuid for full return) |
| return_detail | object | Partial-return detail object. Every partial-return field must go inside this object (cliente, products, transaction_type, model, issuance_type, ambiente, id); leaving them at the request root returns an error. chave, cfop and natureza_operacao are always read from the root, and the root natureza_operacao overrides the one inside the object |
| cfop * | string | Return CFOP. A return NF-e is inbound (tpNF=0) and requires an inbound CFOP: "1202", "1411" within the state, "2202", "2411" interstate. If omitted, "1202"/"2202" is chosen automatically. Sending an outbound CFOP ("5202", "6202", ...) conflicts with tpNF and is rejected by the tax authority |
| natureza_operacao | string | Operation nature (e.g., "Devolução de venda"). Alias accepted: nature_of_operation |
Body — fields inside return_detail
All fields below go inside the return_detail object. Placing them at the request root has no effect — the endpoint returns an error instead of silently falling back to a full return.
| Field | Type | Description |
|---|---|---|
| transaction_type | string | Operation type. Required but the value has no effect: the endpoint unconditionally overrides it to inbound (tpNF=0), so "0" and "1" behave identically — it is only a placeholder |
| model | string | Document model: "55" (required for partial return) |
| issuance_type | string | Issuance type: "1"=normal (required for partial return) |
| ambiente | string | Environment: "1"=production, "2"=homologation (required for partial return) |
| id | string | Order number (return deduplication key). Returns do not use the order-reservation mechanism, so duplicate protection relies entirely on this field: when a return already exists for the same id, that note is returned instead of issuing a new one. Without it there is no duplicate protection at all and the same return can be issued repeatedly — strongly recommended |
| total_discount_amount | number | Total discount amount for the note. Defaults to 0 |
| cliente | object | Recipient data, same structure as /api/invoice/create (required for partial return). Quirk: the address number field is number (in English), not numero. Without number, the address goes out with nro "S/N"; IBGE code, city and state are resolved from cep |
| products | array | Returned items, same structure as /api/invoice/create (required for partial return). codigo is optional — when absent, cProd falls back to name Tax data via category_id or impostos — either one; use the latter when the original invoice was issued by another provider. |
| products[].n_item | int | Item number on the original invoice (1..990). Homologação only: there the return references the original per item, and a partial return cannot infer that number (the original may not be on this platform). Omitted, the reference group is dropped and tax authority returns Rejeição 321. Production references at header level and does not need this field |
* Required field. uuid OR chave is also required (exactly one).
Automatic on returns: payment goes out as 90 (No Payment) — pag_info is ignored; empty natureza_operacao defaults to "Devolução de Mercadoria"; item taxation (CST/CSOSN, PIS/COFINS, IPI, IBS/CBS) comes from the fiscal category of category_id, matched by person type and scenario, or is sent inline per item via impostos — either one.
Complete Example with Transportation
{
"nature_of_operation": "Venda de mercadoria",
"transaction_type": "1",
"model": "55",
"issuance_type": "1",
"ambiente": "2",
"ind_final": "0",
"ind_pres": "1",
"cliente": {
"cnpj": "12345678000199",
"ie": "123456789",
"name": "Empresa Cliente Ltda",
"endereco": "Rua Exemplo",
"number": "123",
"complemento": "Sala 45",
"bairro": "Centro",
"city": "São Paulo",
"uf": "SP",
"cep": "01234567",
"telefone": "11999999999",
"email": "contato@empresa.com"
},
"products": [
{
"codigo": "PROD001",
"name": "Smartphone XYZ",
"ncm": "85171210",
"cest": "2804000",
"count": 2,
"unit": "matriz",
"unit_price": 1500.00,
"total_price": 3000.00,
"category_id": "YOUR_CATEGORY_ID",
"origem": "0",
"indicador_total": "1"
}
],
"transportation": {
"transport_mode": "0",
"freight_amount": 30.00,
"carrier_info": {
"cnpj": "12345678000188",
"name": "Transportadora Expressa",
"endereco": "Rua da Transportadora",
"city": "São Paulo",
"uf": "SP"
},
"vehicle_info": {
"plate": "ABC1234",
"uf": "SP",
"rntc": "123456"
},
"packages": [
{
"qty": 1,
"packaging_type": "CX",
"gross_weight": 2.500,
"net_weight": 2.000
}
]
},
"shipping_address": {
"cnpj": "12345678000199",
"name": "Remetente Ltda",
"endereco": "Rua do Remetente",
"number": "100",
"bairro": "Centro",
"city": "São Paulo",
"uf": "SP",
"cep": "01001000"
},
"delivery_address": {
"cnpj": "98765432000111",
"name": "Destinatário Ltda",
"endereco": "Rua do Destinatário",
"number": "200",
"bairro": "Centro",
"city": "Rio de Janeiro",
"uf": "RJ",
"cep": "20040020"
},
"pag_info": [
{
"payment_method": "03",
"payment_indicator": "0",
"card_info": {
"integration_type": "1",
"brand_code": "01"
}
}
],
"informacoes_complementares": "Sem informações adicionais",
"informacoes_fisco": "ICMS recolhido conforme legislação"
}
Complete Import Example
{
"id": "PED-IMP-001",
"nature_of_operation": "Importacao para revenda",
"transaction_type": "2",
"model": "55",
"issuance_type": "1",
"ambiente": "1",
"finalidade": "1",
"ind_final": "0",
"ind_pres": "9",
"cliente": {
"name": "EXPORTADOR EXTERIOR CO LTD",
"endereco": "Pudong District",
"numero": "456",
"city": "Shanghai",
"id_estrangeiro": "CN-EXP-001",
"c_pais": 1600,
"x_pais": "CHINA"
},
"products": [
{
"name": "Fonte chaveada 12V 2A Quickfitting",
"codigo": "123450000888",
"ncm": "85044090",
"count": 2,
"unit": "PC",
"unit_price": 0.25,
"total_price": 0.50,
"origem": 1,
"indicador_total": "1",
"category_id": "YOUR_CATEGORY_ID",
"import_declarations": [
{
"nDI": "2312345678",
"dDI": "2026-04-12",
"xLocDesemb": "PORTO DE SANTOS",
"UFDesemb": "SP",
"dDesemb": "2026-04-15",
"tpViaTransp": 1,
"vAFRMM": 0.01,
"tpIntermedio": 1,
"cExportador": "EXP-CN-001",
"additions": [
{
"nAdicao": 1,
"nSeqAdic": 1,
"cFabricante": "FAB-CN-001",
"vDescDI": 0,
"nDraw": ""
}
]
}
]
},
{
"name": "Quick fitting MA",
"codigo": "123450000157",
"ncm": "85044090",
"count": 2,
"unit": "PC",
"unit_price": 0.25,
"total_price": 0.50,
"origem": 1,
"indicador_total": "1",
"category_id": "YOUR_CATEGORY_ID",
"ii": {
"vBC": 0.50,
"vDespAdu": 0.00,
"vII": 0.00,
"vIOF": 0.00
},
"import_declarations": [
{
"nDI": "2312345678",
"dDI": "2026-04-12",
"xLocDesemb": "PORTO DE SANTOS",
"UFDesemb": "SP",
"dDesemb": "2026-04-15",
"tpViaTransp": 1,
"vAFRMM": 1.00,
"tpIntermedio": 1,
"cExportador": "EXP-CN-001",
"additions": [
{
"nAdicao": 1,
"nSeqAdic": 2,
"cFabricante": "FAB-CN-001",
"vDescDI": 0,
"nDraw": ""
}
]
}
]
}
],
"pag_info": [
{
"payment_method": "90",
"payment_indicator": "0"
}
]
}
transaction_type: "2"— inbound (import) operation.clientewithoutcnpj/cpf/uf/cep; usesid_estrangeiro,c_pais(BACEN table — China = 1600) andx_pais.category_idmust point to a fiscal category with CFOP 3.xxx and CST/CSOSN compatible with import.- Product
origem=1(foreign — direct import) or2(foreign — purchased domestically). - The
iiblock (Import Tax) is required when CFOP is 3.xxx. Values come from the DI issued by the customs broker (vBC, vDespAdu, vII, vIOF). May be zero for testing. - The
import_declarationsblock (Import Declaration) contains customs clearance data: nDI, dDI, clearance location/state/date, transport mode, intermediary, exporter and additions. vAFRMMis required whentpViaTransp = 1(Sea).
Supplementary NFe and Adjustment NFe are invoices issued to correct tax values of an already authorized invoice. Unlike CC-e, which only corrects registration data, these invoices allow changing tax amounts, quantities, and prices.
- Used to add values that were reported lower than correct in the original invoice
- Price supplement, quantity, or tax amount
- Example: issued invoice with 12% ICMS but the correct rate was 18% — issue supplementary with the difference
- Used for various tax adjustments provided by legislation
- Inventory adjustment, credit transfer, tax regularization
- Example: ICMS adjustment by assessment, credit transfer between branches
- Both are new invoices — they generate a new access key and new number
- Must reference the original invoice via the
ref_nfe_chavefield (44-digit key) - The original invoice must be authorized
- Each consumes 1 credit (same as a regular issuance)
Authentication
Uses the same endpoint and authentication as the NFe issuance:
| Header | Type | Description |
|---|---|---|
| token | string | Company token (obtained during registration) |
| sign | string | MD5 Signature: MD5(token + path + body + timestamp) |
| timestamp | string | Unix timestamp in seconds (5-minute window) |
/api/invoice/createIssue complementary NF-e
Required Headers
| Header | Type | Description |
|---|---|---|
| token | string | Company token |
| sign | string | MD5 Signature: MD5(token + path + body + timestamp) |
| timestamp | string | Unix timestamp in seconds (5-minute window) |
Specific Fields
| Field | Type | Description |
|---|---|---|
| finalidade | string | "2" for Supplementary (required) |
| ref_nfe_chave | string | Access key of the original invoice — 44 digits (required) |
/api/invoice/create endpoint for regular issuance. See the NFe issuance documentation for details on all fields.
"90" (No Payment) since it is only a supplement of tax values.
/api/invoice/createIssue adjustment NF-e
Required Headers
| Header | Type | Description |
|---|---|---|
| token | string | Company token |
| sign | string | MD5 Signature: MD5(token + path + body + timestamp) |
| timestamp | string | Unix timestamp in seconds (5-minute window) |
Specific Fields
| Field | Type | Description |
|---|---|---|
| finalidade | string | "3" for Adjustment (required) |
| ref_nfe_chave | string | Access key of the original invoice — 44 digits (required) |
| Value | Description |
|---|---|
| 1 | Normal (default) |
| 2 | Supplementary |
| 3 | Adjustment |
| 4 | Return |
- Supplementary (2): Supplements values from the original invoice (price, tax, quantity reported lower than correct)
- Adjustment (3): Tax adjustments provided by legislation (regularization, credit transfer, inventory adjustment)
/api/invoice/v2/createIssue NF-e asynchronously
The request body and validation are identical to /api/invoice/create. The difference is that it does not wait for the tax authority: once validated, the request is queued and the receipt number task_id is returned immediately; issuance completes in the background. Fetch the result by polling /api/invoice/v2/task/get or receive it on the webhook address configured in the portal (see “Webhook callbacks” below).
Required headers
| Field | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
/api/invoice/create (cliente, products[], pag_info…) and are not repeated here. A callback_url in the request is ignored: the callback address comes only from the portal configuration.| Field | Type | Description |
|---|---|---|
| is_reopen | boolean | Reopen / overwrite a previously issued NF-e, same meaning as in v1 |
Processing rules
| Rule | Description |
|---|---|
| Idempotency | When the business id id is sent, identical requests from the same CNPJ within 5 minutes reuse the same task and return the same task_id without re-queuing; without id no deduplication is applied. |
| Rate limit | At most 100 pending or processing tasks per CNPJ per minute; beyond that the response is Rate limit exceeded for this CNPJ. |
| Status | pending on acceptance, processing while running, final success / failed. |
Response fields
| Field | Type | Description |
|---|---|---|
| task_id | string | Task number, used for polling and callback deduplication |
| id | string | Business id from the request (empty if not sent) |
| status | string | Task status, always pending on acceptance |
Response — rejected
{ "success": false, "message": "Rate limit exceeded for this CNPJ, please slow down" }
/api/invoice/v2/task/getGet async issuance result
Query task status and result by task_id. The canonical path is /api/invoice/v2/task/get; the legacy path /api/invoice/task/get remains available with identical behaviour and billing. Only tasks submitted by the same account can be queried, otherwise Task not found. Poll every 1–2 seconds; tasks usually finish within seconds.
Required headers
| Field | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Description |
|---|---|---|
| task_id * | string | Task number returned by /api/invoice/v2/create |
status
| Status | Meaning |
|---|---|
| pending | Accepted, waiting to be processed |
| processing | Being submitted to the tax authority |
| success | Issued; the response carries the same data as /api/invoice/create |
| failed | Issuance failed; message holds the reason (tax authority rejection reason when available) |
status is the task status (lowercase); on success data.status is the issuance result status (e.g. Success), identical to /api/invoice/create.When an asynchronous issuance task reaches a final state, the platform pushes one result notification to the address configured by the integrator. Push and polling can be combined: rely on the callback and use polling as a fallback.
Configuration and address requirements
- Account-level address: integrator portal, “Account → Webhook URL”.
- Application-level address: configured on the application (API key) that manages the company, with optional per-endpoint subscription; application level takes precedence over account level.
- A request-level
callback_urlis not supported and is ignored. - The address must be a public http(s) URL, never a private or loopback address; redirects are not followed (3xx counts as failure); timeout 10 s; any 2xx counts as delivered.
Delivery timing and retries
- Delivered once immediately after the task reaches
success/failed. - On failure, retried at +1 min, +10 min, +60 min, +4 h and +12 h, 6 attempts in total (about 17 hours); after that delivery stops and
/api/invoice/v2/task/getremains available as a fallback. - Delivery is at-least-once; deduplicate by
task_id.
Payload (decrypted)
| Field | Type | Description |
|---|---|---|
| task_id | string | Task number, deduplication key |
| id | string | Business id from the request |
| company_id | int | Issuing company ID |
| cnpj | string | Issuing company CNPJ |
| status | string | success / failed |
| result | object | On success, the same response object as /api/invoice/create plus data.danfe (DANFE PDF URL); null on failure |
| error | string | Failure reason, tax authority rejection reason when available; empty string on success |
| test | boolean | Present and true only on messages sent by the portal “Test push” button; receivers should ignore them |
{
"task_id": "66d0a1b2c3d4e5f6a7b8c9d0",
"id": "PED-1001",
"company_id": 1263,
"cnpj": "12345678000199",
"status": "success",
"result": {
"success": true,
"message": "成功",
"data": {
"uuid": "65f8b9a1c2d3e4f5a6b7c8d9",
"status": "Success",
"motivo": "Autorizado o uso da NF-e",
"nfe": 100, "serie": 1,
"chave": "35260112345678000199550010000001001000000017",
"modelo": "nfe", "epec": false,
"xml": "https://oss.example.com/.../chave.xml",
"danfe": "https://oss.example.com/.../chave.pdf"
}
},
"error": ""
}Encrypted envelope
Payloads are delivered encrypted with AES-256-GCM. The key is derived from the integrator’s API key, so no extra secret is exchanged: key = SHA-256(UTF-8(token)), where token is the application key managing the company. GCM provides integrity: tampering with any field (including ts) makes decryption fail, so no separate signature header is added.
Headers: X-Webhook-Timestamp (Unix seconds, equal to the envelope ts) and X-Webhook-Encryption: A256GCM. If no key can be resolved the payload is delivered in plain text without the X-Webhook-Encryption header; receivers should branch on that header.
Decryption: nonce, payload and tag are Base64; the additional authenticated data (AAD) is the decimal string of ts (UTF-8).
POST {webhook_url}
Content-Type: application/json
X-Webhook-Timestamp: 1786990396
X-Webhook-Encryption: A256GCM
{
"enc": "A256GCM",
"kid": "token",
"ts": 1786990396,
"nonce": "<base64, 12 bytes>",
"payload": "<base64 ciphertext>",
"tag": "<base64, 16 bytes>"
}Python decryption example (cryptography)
import base64, hashlib, json
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
def decrypt(token, body):
env = json.loads(body)
key = hashlib.sha256(token.encode("utf-8")).digest()
aad = str(env["ts"]).encode("utf-8")
data = base64.b64decode(env["payload"]) + base64.b64decode(env["tag"])
plain = AESGCM(key).decrypt(base64.b64decode(env["nonce"]), data, aad)
return json.loads(plain)Node.js decryption example
const crypto = require("crypto");
function decrypt(token, body) {
const env = JSON.parse(body);
const key = crypto.createHash("sha256").update(token, "utf8").digest();
const d = crypto.createDecipheriv("aes-256-gcm", key, Buffer.from(env.nonce, "base64"));
d.setAAD(Buffer.from(String(env.ts), "utf8"));
d.setAuthTag(Buffer.from(env.tag, "base64"));
const plain = Buffer.concat([d.update(Buffer.from(env.payload, "base64")), d.final()]);
return JSON.parse(plain.toString("utf8"));
}Integration testing
- The “Test push” button next to the webhook URL in the portal sends an encrypted test message (
test: true) to that address to verify connectivity and decryption. - The system test inbox (
/webhook/inbox/{slot},slotbeing any identifier of your choice) can also be configured as the webhook URL; decrypted messages are then visible in the portal.
The CC-e (Electronic Correction Letter) is an event linked to the NF-e that allows correcting information in an already authorized invoice, without changing tax values. Regulated by Ajuste SINIEF 01/07.
- Recipient or issuer address
- Recipient company name (without changing CNPJ/CPF)
- Fiscal operation code (CFOP), as long as it does not change the nature of taxes
- Product description
- Additional data and supplementary information
- Tax values (tax base, rate, tax amount)
- Product quantity and value
- Issuer or recipient CNPJ/CPF
- Data that changes tax calculations
- Only invoices with authorized (Success) status can receive CC-e
- Correction text must be between 15 and 1000 characters
- Up to 20 CC-e can be issued for the same invoice
- Each CC-e consumes 1 credit
Authentication
All CC-e endpoints use the same authentication as the main API:
| Header | Type | Description |
|---|---|---|
| token | string | Company token (obtained during registration) |
| sign | string | MD5 Signature: MD5(token + path + body + timestamp) |
| timestamp | string | Unix timestamp in seconds (5-minute window) |
/api/invoice/cce/sendSend Correction Letter (CC-e)
Sends a CC-e (event 110110) to the tax authority to correct data of an already authorized NF-e. The sequence (nSeqEvento) is calculated automatically — do not send it. Only non-fiscal data can be corrected (does not correct values, CNPJ, IE, etc.).
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Description |
|---|---|---|
| uuid | string | NF-e UUID (required if chave is absent) |
| chave | string | 44-digit access key of the NF-e (required if uuid is absent) |
| correcao * | string | Correction text (tax authority limit: 15–1000 characters) |
| n_seq_evento | int | Event sequence number. By default it is derived from the correction letters already registered on this platform. Provide a higher value explicitly when the invoice has received correction letters elsewhere |
* Required field. At least one of uuid or chave is also required.
Invoices issued elsewhere can also receive a correction letter: the letter is an event independent of the original invoice, and the only requirement is that the issuer tax number embedded in the access key belongs to a company under this token. For such invoices the platform holds no original record, so the sequence number cannot be derived and defaults to 1. If the tax authority reports that an event with that number already exists, resubmit with a higher n_seq_evento. Correction letter PDF is not available for these invoices; only the event XML is.
/api/invoice/cce/get_listList CC-e
Returns all CC-e (Correction Letters) issued for a specific NF-e, ordered from most recent to oldest.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Description |
|---|---|---|
| uuid | string | NF-e UUID (required if chave is absent) |
| chave | string | 44-digit access key of the NF-e (required if uuid is absent) |
At least one of uuid or chave is required.
/api/invoice/cce/download_pdfDownload CC-e PDF
Returns the CC-e PDF URL. The PDF is generated on demand on the first call (rendered from the invoice XML + CC-e XML) and stored in OSS; subsequent calls return the existing URL.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Description |
|---|---|---|
| cce_id * | string | CC-e ID (ObjectId) returned by /api/invoice/cce/get_list in the id field |
* Required field.
/api/invoice/cce/download_xmlDownload CC-e XML
Returns the URL of the signed CC-e XML (already stored in OSS after submission to the tax authority).
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Description |
|---|---|---|
| cce_id * | string | CC-e ID (ObjectId) returned by /api/invoice/cce/get_list in the id field |
* Required field.