> ## Documentation Index
> Fetch the complete documentation index at: https://invopop-link-fix.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DF-e issuing invoices guide

> Issue Documentos Fiscais Eletrônicos in Brazil

export const brDfeCancelNfeWorkflow = {
  "name": "Cancel NF-e invoice",
  "description": "Cancel an NF-e product invoice via PlugNotas",
  "schema": "bill/invoice",
  "steps": [{
    "id": "7b40e24a-0c51-4462-b3e9-d2d20d424a0d",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `processing`{.state .processing}",
    "config": {
      "state": "processing"
    }
  }, {
    "id": "834e52d6-d50a-4340-9ca6-f07557aa94d5",
    "name": "Cancel NF-e with SEFAZ",
    "provider": "nfe-br.cancel.nfe"
  }, {
    "id": "ddfb8e79-8260-4ecd-bf60-115e837cd135",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `void`{.state .void}",
    "config": {
      "state": "void"
    }
  }],
  "rescue": [{
    "id": "169c4b15-83ae-4243-b0c9-4e4915d15361",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `error`{.state .error}",
    "config": {
      "state": "error"
    }
  }]
};

export const brDfeCancelNfceWorkflow = {
  "name": "Cancel NFC-e invoice",
  "description": "Cancel an NFC-e consumer invoice via PlugNotas",
  "schema": "bill/invoice",
  "steps": [{
    "id": "5e63dc30-535e-11f1-aba1-0fa2408cece2",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `processing`{.state .processing}",
    "config": {
      "state": "processing"
    }
  }, {
    "id": "71238320-535e-11f1-aba1-0fa2408cece2",
    "name": "Cancel NFC-e with SEFAZ",
    "provider": "nfe-br.cancel.nfce"
  }, {
    "id": "65aa8020-535e-11f1-aba1-0fa2408cece2",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `void`{.state .void}",
    "config": {
      "state": "void"
    }
  }],
  "rescue": [{
    "id": "6b3199c0-535e-11f1-aba1-0fa2408cece2",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `error`{.state .error}",
    "config": {
      "state": "error"
    }
  }]
};

export const brDfeCancelNfseWorkflow = {
  "name": "Cancel NFS-e invoice",
  "description": "Cancel an NFS-e service invoice via PlugNotas",
  "schema": "bill/invoice",
  "steps": [{
    "id": "5e63dc30-535e-11f1-aba1-0fa2408cece2",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `processing`{.state .processing}",
    "config": {
      "state": "processing"
    }
  }, {
    "id": "71238320-535e-11f1-aba1-0fa2408cece2",
    "name": "Cancel NFS-e with Prefeitura",
    "provider": "nfe-br.cancel.nfse"
  }, {
    "id": "65aa8020-535e-11f1-aba1-0fa2408cece2",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `void`{.state .void}",
    "config": {
      "state": "void"
    }
  }],
  "rescue": [{
    "id": "6b3199c0-535e-11f1-aba1-0fa2408cece2",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `error`{.state .error}",
    "config": {
      "state": "error"
    }
  }]
};

export const brDfeProductInvoiceWorkflow = {
  "name": "Issue NF-e invoice",
  "description": "Issue an NF-e product invoice via PlugNotas",
  "schema": "bill/invoice",
  "steps": [{
    "id": "ddfb8e79-8260-4ecd-bf59-115e837cd135",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `processing`{.state .processing}",
    "config": {
      "state": "processing"
    }
  }, {
    "id": "169c4b15-83ae-4242-b0c9-4e4915d15361",
    "name": "Add sequential code",
    "provider": "sequence.enumerate",
    "summary": "Dynamic · NF-e · 1",
    "config": {
      "name": "NF-e",
      "padding": 1,
      "start": 1
    }
  }, {
    "id": "283dae9e-ea44-46c0-8f63-5af48ec5f388",
    "name": "Sign envelope",
    "provider": "silo.close"
  }, {
    "id": "12bd4677-dc3c-4043-85ca-54f8d034803d",
    "name": "Send NF-e to SEFAZ",
    "provider": "nfe-br.send.nfe"
  }, {
    "id": "999ad559-1040-4e69-98c9-93e62c8833d4",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `sent`{.state .sent}",
    "config": {
      "state": "sent"
    }
  }],
  "rescue": [{
    "id": "5c38f3d4-1338-4990-a248-0822c5081124",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `error`{.state .error}",
    "config": {
      "state": "error"
    }
  }]
};

export const brDfeConsumerInvoiceWorkflow = {
  "name": "Issue NFC-e invoice",
  "description": "Issue an NFC-e consumer invoice via PlugNotas",
  "schema": "bill/invoice",
  "steps": [{
    "id": "93769100-b652-11f0-a7d9-bfad358c6464",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `processing`{.state .processing}",
    "config": {
      "state": "processing"
    }
  }, {
    "id": "971c6780-b652-11f0-a7d9-bfad358c6464",
    "name": "Add sequential code",
    "provider": "sequence.enumerate",
    "summary": "Dynamic · NFC-e · 1",
    "config": {
      "name": "NFC-e",
      "padding": 1,
      "start": 1
    }
  }, {
    "id": "9f965b50-b652-11f0-a7d9-bfad358c6464",
    "name": "Sign envelope",
    "provider": "silo.close"
  }, {
    "id": "8693f670-b653-11f0-a7d9-bfad358c6464",
    "name": "Send NFC-e to SEFAZ",
    "provider": "nfe-br.send.nfce"
  }, {
    "id": "a9dc0e70-b652-11f0-a7d9-bfad358c6464",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `sent`{.state .sent}",
    "config": {
      "state": "sent"
    }
  }],
  "rescue": [{
    "id": "b0f7f8e0-b652-11f0-a7d9-bfad358c6464",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `error`{.state .error}",
    "config": {
      "state": "error"
    }
  }]
};

export const brDfeServiceInvoiceWorkflow = {
  "name": "Issue NFS-e invoice",
  "description": "Issue an NFS-e service invoice via PlugNotas",
  "schema": "bill/invoice",
  "steps": [{
    "id": "d1c7bde0-b651-11f0-b6c3-efa5610a4723",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `processing`{.state .processing}",
    "config": {
      "state": "processing"
    }
  }, {
    "id": "dbcb8600-b651-11f0-b6c3-efa5610a4723",
    "name": "Add sequential code",
    "provider": "sequence.enumerate",
    "summary": "Dynamic · NFS-e · 1",
    "config": {
      "name": "NFS-e",
      "padding": 1,
      "start": 1
    }
  }, {
    "id": "e8eba950-b651-11f0-b6c3-efa5610a4723",
    "name": "Sign envelope",
    "provider": "silo.close"
  }, {
    "id": "ec64f190-b651-11f0-b6c3-efa5610a4723",
    "name": "Send NFS-e to Prefeitura",
    "provider": "nfe-br.send"
  }, {
    "id": "eecc7bb0-b651-11f0-b6c3-efa5610a4723",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `sent`{.state .sent}",
    "config": {
      "state": "sent"
    }
  }],
  "rescue": [{
    "id": "f9195ac0-b651-11f0-b6c3-efa5610a4723",
    "name": "Set state",
    "provider": "silo.state",
    "summary": "Set state to `error`{.state .error}",
    "config": {
      "state": "error"
    }
  }]
};

export const WorkflowDiagram = ({workflow}) => {
  const stateColors = {
    processing: "yellow",
    sent: "blue",
    received: "blue",
    registered: "green",
    completed: "green",
    error: "red"
  };
  const StateChip = ({state, label}) => <Badge size="sm" color={stateColors[state] || "gray"} icon="square-small" iconType="solid">
      {label.charAt(0).toUpperCase() + label.slice(1)}
    </Badge>;
  const providerIcons = {
    "silo.state": "https://silo.invopop.com/images/status.svg",
    "silo.close": "https://silo.invopop.com/images/check-badge.svg",
    "silo.if": "https://assets.invopop.com/apps/silo/if.svg",
    "silo.folder": "https://silo.invopop.com/images/folder.svg",
    "silo.modify": "https://silo.invopop.com/images/modify.svg",
    "silo.correct": "https://silo.invopop.com/images/replace.svg",
    "silo.sleep": "https://assets.invopop.com/icons/sleep.svg",
    silo: "https://assets.invopop.com/apps/silo/icon.svg",
    "sequence.enumerate": "https://sequence.invopop.com/images/enumerate.svg",
    "transform.job.create": "https://transform.invopop.com/images/jobs.svg",
    webhook: "https://webhook.invopop.com/icon.svg",
    lookup: "https://lookup.invopop.com/icon.png",
    dropbox: "https://dropbox.invopop.com/icon.png",
    pdf: "https://pdf.invopop.com/file-pdf.svg",
    peppol: "https://assets.invopop.com/apps/peppol/icon.svg",
    ubl: "https://assets.invopop.com/apps/ubl/logo.svg",
    cii: "https://assets.invopop.com/apps/cii/logo.svg",
    "gov-fr": "https://assets.invopop.com/flags/fr.svg",
    "chorus-pro": "https://assets.invopop.com/apps/chroruspro/icon.svg",
    "gov-es": "https://assets.invopop.com/apps/gov-es/icon.svg",
    "gov-es.sii": "https://assets.invopop.com/apps/sii/icon.svg",
    "gov-es.ticketbai": "https://assets.invopop.com/apps/ticketbai/icon.svg",
    "gov-es.facturae": "https://assets.invopop.com/apps/facturae/icon.svg",
    verifactu: "https://assets.invopop.com/apps/verifactu/icon.svg",
    "gov-pl": "https://assets.invopop.com/apps/ksef/icon.svg",
    "gov-sa": "https://assets.invopop.com/apps/zatca/icon.svg",
    "gov-ar": "https://assets.invopop.com/apps/arca/icon.svg",
    "at-pt": "https://assets.invopop.com/apps/at-pt/icon.svg",
    "sat-mx": "https://assets.invopop.com/apps/sat-mexico/icon.svg",
    "sw-sapien": "https://assets.invopop.com/apps/sw-sapien/icon.svg",
    "sdi-it": "https://assets.invopop.com/apps/sdi-italy/icon.svg",
    "ticket-it": "https://assets.invopop.com/apps/agenzia-entrate/icon.svg",
    "nfe-br": "https://assets.invopop.com/apps/notas-fiscais-eletronicas-brazil/icon.svg",
    chargebee: "https://assets.invopop.com/apps/chargebee/icon.svg",
    stripe: "https://assets.invopop.com/apps/stripe/icon.svg",
    email: "https://assets.invopop.com/apps/email/icon.svg",
    cron: "https://assets.invopop.com/apps/cron/icon.svg",
    ilyda: "https://assets.invopop.com/apps/ilyda/icon.svg",
    invoicexpress: "https://assets.invopop.com/apps/invoicexpress/icon.svg",
    plemsi: "https://assets.invopop.com/flags/co.svg"
  };
  const iconFor = provider => {
    const parts = (provider || "").split(".");
    for (let i = parts.length; i > 0; i--) {
      const url = providerIcons[parts.slice(0, i).join(".")];
      if (url) return url;
    }
    return null;
  };
  const StepIcon = ({provider}) => {
    const url = iconFor(provider);
    return <span title={provider} className="flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-gray-950/10 bg-white dark:border-white/10 dark:bg-white/5">
        {url ? <img src={url} alt="" className="h-4 w-4" /> : null}
      </span>;
  };
  const renderSummary = summary => {
    const nodes = [];
    const re = /`([^`]+)`(\{[^}]*\})?/g;
    let last = 0;
    let m;
    let k = 0;
    while ((m = re.exec(summary)) !== null) {
      if (m.index > last) nodes.push(summary.slice(last, m.index));
      const attrs = m[2] || "";
      if (attrs.indexOf(".state") >= 0) {
        const state = (attrs.match(/\.state\s+\.([\w-]+)/) || [])[1] || m[1];
        nodes.push(<StateChip key={k++} state={state} label={m[1]} />);
      } else if (attrs) {
        nodes.push(<span key={k++} className="text-sm font-medium text-gray-700 dark:text-gray-300">
            {m[1]}
          </span>);
      } else {
        nodes.push(<code key={k++} className="text-sm rounded bg-gray-100 px-1 font-mono text-sm dark:bg-white/10">
            {m[1]}
          </code>);
      }
      last = m.index + m[0].length;
    }
    if (last < summary.length) nodes.push(summary.slice(last));
    return nodes;
  };
  const NoteRow = ({text}) => <div className="mt-4 mb-1 font-mono text-sm leading-5 text-gray-400 dark:text-gray-500">{"// " + text}</div>;
  const renderSteps = (steps, counter) => (steps || []).map(step => {
    counter.n += 1;
    const n = counter.n;
    const branches = (step.next || []).filter(b => b.steps && b.steps.length > 0);
    return <div key={step.id || "step-" + n}>
          {step.notes ? <NoteRow text={step.notes} /> : null}
          <div className="mt-2.5 flex items-center">
            <span className="absolute left-0 w-10 text-center font-mono text-sm text-gray-400 select-none dark:text-gray-500">
              {n}
            </span>
            <div className="flex min-w-0 flex-1 items-center gap-2 rounded-xl border border-gray-950/5 bg-white px-2 py-2 dark:border-white/10 dark:bg-gray-900">
              <StepIcon provider={step.provider} />
              <span className="text-sm shrink-0 font-medium text-gray-900 dark:text-gray-100">{step.name}</span>
              {step.summary ? <span className="text-sm min-w-0 truncate text-gray-500 dark:text-gray-400">{renderSummary(step.summary)}</span> : null}
            </div>
          </div>
          {branches.length > 0 ? <div className="ml-5 border-l border-gray-200 -my-1 py-1 pl-6 dark:border-white/10">
              {branches.map((branch, bi) => <div key={branch.code || branch.status || bi}>
                  <div className="mt-4">
                    <span className="rounded-md bg-gray-200/70 px-2 py-1 font-mono text-sm text-gray-600 dark:bg-white/10 dark:text-gray-300">
                      {branch.code || branch.status}
                    </span>
                  </div>
                  {renderSteps(branch.steps, counter)}
                </div>)}
            </div> : null}
        </div>;
  });
  const counter = {
    n: 0
  };
  const wf = workflow || ({});
  return <div className="not-prose relative my-5 rounded-2xl border border-gray-950/5 bg-gray-50 py-3 pr-4 pb-5 pl-12 dark:border-white/10 dark:bg-white/[0.03]">
      {renderSteps(wf.steps, counter)}
      {wf.rescue && wf.rescue.length > 0 ? <div className="mt-6 border-t border-dashed border-gray-300 dark:border-white/10">
          <NoteRow text="If any step fails" />
          {renderSteps(wf.rescue, counter)}
        </div> : null}
    </div>;
};

## Introduction

Brazil has a variety of electronic tax documents that must be issued in different cases for various tax purposes. These include service invoices (NFS-e), product invoices (NF-e), and consumer invoices (NFC-e). Each document type is subject to variations from state to state and municipality to municipality, with each jurisdiction applying its own rules, formats, and APIs for issuing fiscal documents.

Invopop's **Documentos Fiscais Eletrônicos** app provides a unified way to issue fiscal documents across all Brazilian states and over 2000 municipalities using GOBL. You can find [the full list of supported municipalities here](https://tecnospeed.com.br/plugdfe/nfse/#homologacao).

This guide will walk you through the steps required to issue electronic fiscal documents in a supplier's name, and to cancel them if needed.

| -             | Sandbox                                              | Live                                                               |
| ------------- | ---------------------------------------------------- | ------------------------------------------------------------------ |
| **Responses** | Simulated/mocked                                     | Real from DFe system                                               |
| **PDF & XML** | Always the same mock-up files attached to silo entry | Actual XML sent to tax authority and actual generated PDF attached |

## Prerequisites

To issue electronic fiscal documents in Brazil, you will need:

* A registered supplier: follow the [DF-e supplier registration guide](/guides/br-dfe-supplier) to connect the Documentos Fiscais Eletrônicos Brazil app and register the supplier's certificate before issuing.
* Customer details (except for NFC-e where the customer is optional).
* Details of the goods or services provided:
  * quantity,
  * price,
  * applicable tax rates (ISS, ICMS, PIS, COFINS, etc.), and,
  * (only for services) service code (*Código Item Lista Serviço*) as defined by the municipality.
* To have chosen an invoice series

## Setup

Prepare the invoicing workflows for the document types you want to issue and cancel.

<Info>
  These instructions apply to both the sandbox and live environments. Please note that the sandbox environment is simulated, and most responses are mocked. The **Documentos Fiscais Eletrônicos Brazil** app must already be connected and configured — this is covered in the [supplier registration guide](/guides/br-dfe-supplier).
</Info>

All of the following steps must be carried out from the [Invopop Console](https://console.invopop.com).

<Steps>
  <Step title="Prepare NFS-e workflow">
    <Info>
      You can skip this step if you're not interested in issuing NFS-e documents.
    </Info>

    Follow one of the methods below and ensure to **Save** and **Publish** the workflow:

    <Card iconType="duotone" title="DF-e issue service invoice (NFS-e)" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=br-dfe-service-invoice" horizontal>
      Add to my workspace →
    </Card>

    <Tabs>
      <Tab title="Workflow">
        <WorkflowDiagram workflow={brDfeServiceInvoiceWorkflow} />
      </Tab>

      <Tab title="Code">
        Copy and paste into a new [Empty Invoice workflow](https://console.invopop.com/redirect/workflows/new?template=empty-invoice) code view.

        ```json Example issue NFS-e invoice workflow theme={null}
        {
            "name": "Issue NFS-e invoice",
            "description": "Issue an NFS-e service invoice via PlugNotas",
            "schema": "bill/invoice",
            "steps": [
                {
                    "id": "d1c7bde0-b651-11f0-b6c3-efa5610a4723",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "dbcb8600-b651-11f0-b6c3-efa5610a4723",
                    "name": "Add sequential code",
                    "provider": "sequence.enumerate",
                    "summary": "Dynamic · NFS-e · 1",
                    "config": {
                        "name": "NFS-e",
                        "padding": 1,
                        "start": 1
                    }
                },
                {
                    "id": "e8eba950-b651-11f0-b6c3-efa5610a4723",
                    "name": "Sign envelope",
                    "provider": "silo.close"
                },
                {
                    "id": "ec64f190-b651-11f0-b6c3-efa5610a4723",
                    "name": "Send NFS-e to Prefeitura",
                    "provider": "nfe-br.send"
                },
                {
                    "id": "eecc7bb0-b651-11f0-b6c3-efa5610a4723",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `sent`{.state .sent}",
                    "config": {
                        "state": "sent"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "f9195ac0-b651-11f0-b6c3-efa5610a4723",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Prepare NF-e Workflow">
    <Info>
      You can skip this step if you're not interested in issuing NF-e documents.
    </Info>

    Follow one of the methods below and ensure to **Save** and **Publish** the workflow:

    <Card iconType="duotone" title="DF-e issue product invoice (NF-e)" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=br-dfe-product-invoice" horizontal>
      Add to my workspace →
    </Card>

    <Tabs>
      <Tab title="Workflow">
        <WorkflowDiagram workflow={brDfeProductInvoiceWorkflow} />
      </Tab>

      <Tab title="Code">
        Copy and paste into a new [Empty Invoice workflow](https://console.invopop.com/redirect/workflows/new?template=empty-invoice) code view.

        ```json Example issue NF-e invoice workflow theme={null}
        {
            "name": "Issue NF-e invoice",
            "description": "Issue an NF-e product invoice via PlugNotas",
            "schema": "bill/invoice",
            "steps": [
                {
                    "id": "ddfb8e79-8260-4ecd-bf59-115e837cd135",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "169c4b15-83ae-4242-b0c9-4e4915d15361",
                    "name": "Add sequential code",
                    "provider": "sequence.enumerate",
                    "summary": "Dynamic · NF-e · 1",
                    "config": {
                        "name": "NF-e",
                        "padding": 1,
                        "start": 1
                    }
                },
                {
                    "id": "283dae9e-ea44-46c0-8f63-5af48ec5f388",
                    "name": "Sign envelope",
                    "provider": "silo.close"
                },
                {
                    "id": "12bd4677-dc3c-4043-85ca-54f8d034803d",
                    "name": "Send NF-e to SEFAZ",
                    "provider": "nfe-br.send.nfe"
                },
                {
                    "id": "999ad559-1040-4e69-98c9-93e62c8833d4",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `sent`{.state .sent}",
                    "config": {
                        "state": "sent"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "5c38f3d4-1338-4990-a248-0822c5081124",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Prepare NFC-e Workflow">
    <Info>
      You can skip this step if you're not interested in issuing NFC-e documents.
    </Info>

    Follow one of the methods below and ensure to **Save** and **Publish** the workflow:

    <Card iconType="duotone" title="DF-e issue consumer invoice (NFC-e)" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=br-dfe-consumer-invoice" horizontal>
      Add to my workspace →
    </Card>

    <Tabs>
      <Tab title="Workflow">
        <WorkflowDiagram workflow={brDfeConsumerInvoiceWorkflow} />
      </Tab>

      <Tab title="Code">
        Copy and paste into a new [Empty Invoice workflow](https://console.invopop.com/redirect/workflows/new?template=empty-invoice) code view.

        ```json Example issue NFC-e invoice workflow theme={null}
        {
            "name": "Issue NFC-e invoice",
            "description": "Issue an NFC-e consumer invoice via PlugNotas",
            "schema": "bill/invoice",
            "steps": [
                {
                    "id": "93769100-b652-11f0-a7d9-bfad358c6464",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "971c6780-b652-11f0-a7d9-bfad358c6464",
                    "name": "Add sequential code",
                    "provider": "sequence.enumerate",
                    "summary": "Dynamic · NFC-e · 1",
                    "config": {
                        "name": "NFC-e",
                        "padding": 1,
                        "start": 1
                    }
                },
                {
                    "id": "9f965b50-b652-11f0-a7d9-bfad358c6464",
                    "name": "Sign envelope",
                    "provider": "silo.close"
                },
                {
                    "id": "8693f670-b653-11f0-a7d9-bfad358c6464",
                    "name": "Send NFC-e to SEFAZ",
                    "provider": "nfe-br.send.nfce"
                },
                {
                    "id": "a9dc0e70-b652-11f0-a7d9-bfad358c6464",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `sent`{.state .sent}",
                    "config": {
                        "state": "sent"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "b0f7f8e0-b652-11f0-a7d9-bfad358c6464",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Prepare NFS-e Cancel Workflow">
    <Info>
      You can skip this step if you're not interested in cancelling NFS-e documents.
    </Info>

    Follow one of the methods below and ensure to **Save** and **Publish** the workflow:

    <Card iconType="duotone" title="DF-e cancel service invoice (NFS-e)" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=br-dfe-cancel-nfse" horizontal>
      Add to my workspace →
    </Card>

    <Tabs>
      <Tab title="Workflow">
        <WorkflowDiagram workflow={brDfeCancelNfseWorkflow} />
      </Tab>

      <Tab title="Code">
        Copy and paste into a new [Empty Invoice workflow](https://console.invopop.com/redirect/workflows/new?template=empty-invoice) code view.

        ```json Example Cancel NFS-e invoice workflow theme={null}
        {
            "name": "Cancel NFS-e invoice",
            "description": "Cancel an NFS-e service invoice via PlugNotas",
            "schema": "bill/invoice",
            "steps": [
                {
                    "id": "5e63dc30-535e-11f1-aba1-0fa2408cece2",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "71238320-535e-11f1-aba1-0fa2408cece2",
                    "name": "Cancel NFS-e with Prefeitura",
                    "provider": "nfe-br.cancel.nfse"
                },
                {
                    "id": "65aa8020-535e-11f1-aba1-0fa2408cece2",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `void`{.state .void}",
                    "config": {
                        "state": "void"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "6b3199c0-535e-11f1-aba1-0fa2408cece2",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Prepare NF-e Cancel Workflow">
    <Info>
      You can skip this step if you're not interested in cancelling NF-e documents.
    </Info>

    Follow one of the methods below and ensure to **Save** and **Publish** the workflow:

    <Card iconType="duotone" title="DF-e cancel product invoice (NF-e)" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=br-dfe-cancel-nfe" horizontal>
      Add to my workspace →
    </Card>

    <Tabs>
      <Tab title="Workflow">
        <WorkflowDiagram workflow={brDfeCancelNfeWorkflow} />
      </Tab>

      <Tab title="Code">
        Copy and paste into a new [Empty Invoice workflow](https://console.invopop.com/redirect/workflows/new?template=empty-invoice) code view.

        ```json Example Cancel NF-e invoice workflow theme={null}
        {
            "name": "Cancel NF-e invoice",
            "description": "Cancel an NF-e product invoice via PlugNotas",
            "schema": "bill/invoice",
            "steps": [
                {
                    "id": "7b40e24a-0c51-4462-b3e9-d2d20d424a0d",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "834e52d6-d50a-4340-9ca6-f07557aa94d5",
                    "name": "Cancel NF-e with SEFAZ",
                    "provider": "nfe-br.cancel.nfe"
                },
                {
                    "id": "ddfb8e79-8260-4ecd-bf60-115e837cd135",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `void`{.state .void}",
                    "config": {
                        "state": "void"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "169c4b15-83ae-4243-b0c9-4e4915d15361",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Prepare NFC-e Cancel Workflow">
    <Info>
      You can skip this step if you're not interested in cancelling NFC-e documents.
    </Info>

    Follow one of the methods below and ensure to **Save** and **Publish** the workflow:

    <Card iconType="duotone" title="DF-e cancel consumer invoice (NFC-e)" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=br-dfe-cancel-nfce" horizontal>
      Add to my workspace →
    </Card>

    <Tabs>
      <Tab title="Workflow">
        <WorkflowDiagram workflow={brDfeCancelNfceWorkflow} />
      </Tab>

      <Tab title="Code">
        Copy and paste into a new [Empty Invoice workflow](https://console.invopop.com/redirect/workflows/new?template=empty-invoice) code view.

        ```json Example Cancel NFC-e invoice workflow theme={null}
        {
            "name": "Cancel NFC-e invoice",
            "description": "Cancel an NFC-e consumer invoice via PlugNotas",
            "schema": "bill/invoice",
            "steps": [
                {
                    "id": "5e63dc30-535e-11f1-aba1-0fa2408cece2",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `processing`{.state .processing}",
                    "config": {
                        "state": "processing"
                    }
                },
                {
                    "id": "71238320-535e-11f1-aba1-0fa2408cece2",
                    "name": "Cancel NFC-e with SEFAZ",
                    "provider": "nfe-br.cancel.nfce"
                },
                {
                    "id": "65aa8020-535e-11f1-aba1-0fa2408cece2",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `void`{.state .void}",
                    "config": {
                        "state": "void"
                    }
                }
            ],
            "rescue": [
                {
                    "id": "6b3199c0-535e-11f1-aba1-0fa2408cece2",
                    "name": "Set state",
                    "provider": "silo.state",
                    "summary": "Set state to `error`{.state .error}",
                    "config": {
                        "state": "error"
                    }
                }
            ]
        }
        ```
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Running

In this section, we'll provide details on how to issue invoices on behalf of a registered supplier, and how to cancel them.

As usual, the recommended approach for running jobs is to perform two steps; first upload the document to the [silo](/api-ref/silo/entries/create-an-entry-put), second [create a job](/api-ref/transform/jobs/create-a-job-put).

All operations described in the following sections can be performed manually via the Invopop Console, or programmatically via the API. The process is essentially the same in both cases, so we'll demonstrate the manual method for this guide.

### Send invoices

The following examples are of example [GOBL](https://docs.gobl.org) documents you can copy and paste directly into the [Invopop Console](https://console.invopop.com) or store via the API as silo entries. Then, you must run the appropriate issue workflow created during setup — "DF-e issue service invoice (NFS-e)", "DF-e issue product invoice (NF-e)", or "DF-e issue consumer invoice (NFC-e)" — over them.

<Info>
  In the sandbox environment, you'll notice that executing the workflow will always result in the same PDF and XML being attached to the silo entry. These are mock-up files returned by the sandbox environment for testing purposes.

  In production, the actual XML file sent to the tax authority and the actual PDF generated will be attached to the silo entry.
</Info>

<AccordionGroup>
  <Accordion title="Example B2B service invoice (NFS-e)">
    In this example, we're issuing a simple service invoice (NFS-e) from a Brazilian supplier to another Brazilian business customer.

    Notice:

    * we've added the [`br-nfse-v1`](https://docs.gobl.org/addons/br-nfse-v1) addon; this ensures the document will be validated using the NFS-e rules built into the [GOBL](https://docs.gobl.org) library,
    * extensions (`ext`) and identities have been used in multiple locations for fields whose values cannot be determined any other way,
    * ISS percentage is provided explicitly as it varies depending on the municipality and type of service,
    * there are no totals or calculations; all these will be made automatically when uploading, and,
    * make sure to process it with the "DF-e issue service invoice (NFS-e)" workflow created during setup.

    <CodeGroup>
      ```json B2B Service Invoice (NFS-e) theme={null}
      {
        "$schema": "https://gobl.org/draft-0/bill/invoice",
        "$addons": [
          "br-nfse-v1"
        ],
        "series": "XXBR",
        "supplier": {
          "name": "TechNova Soluções Digitais Ltda.",
          "tax_id": {
            "country": "BR",
            "code": "05229829000184"
          },
          "identities": [
            {
              "key": "br-nfse-municipal-reg",
              "code": "45678901234567"
            }
          ],
          "addresses": [
            {
              "num": "101",
              "street": "Avenida Paulista",
              "locality": "Bela Vista",
              "region": "São Paulo",
              "state": "SP",
              "code": "01311-000",
              "country": "BR"
            }
          ],
          "emails": [
            {
              "addr": "contact@technova.test"
            }
          ],
          "ext": {
            "br-ibge-municipality": "3550308",
            "br-nfse-simples": "1"
          }
        },
        "customer": {
          "name": "Construforte Engenharia Ltda.",
          "tax_id": {
            "country": "BR",
            "code": "46602178000103"
          },
          "addresses": [
            {
              "num": "75",
              "street": "Avenida Sete de Setembro",
              "street_extra": "Bloco C",
              "locality": "Centro",
              "region": "Salvador",
              "state": "BA",
              "code": "40060-000",
              "country": "BR"
            }
          ]
        },
        "lines": [
          {
            "quantity": "15",
            "item": {
              "name": "Consultancy Services",
              "price": "100.00",
              "ext": {
                "br-nfse-cnae": "62.01-5-01",
                "br-nfse-service": "10.5"
              }
            },
            "taxes": [
              {
                "cat": "ISS",
                "percent": "15%"
              }
            ]
          }
        ]
      }
      ```

      ```json Built version theme={null}
      {
      	"$schema": "https://gobl.org/draft-0/bill/invoice",
      	"$regime": "BR",
      	"$addons": [
      		"br-nfse-v1"
      	],
      	"type": "standard",
      	"series": "XXBR",
      	"issue_date": "2026-07-08",
      	"currency": "BRL",
      	"supplier": {
      		"name": "TechNova Soluções Digitais Ltda.",
      		"tax_id": {
      			"country": "BR",
      			"code": "05229829000184"
      		},
      		"identities": [
      			{
      				"key": "br-nfse-municipal-reg",
      				"code": "45678901234567"
      			}
      		],
      		"addresses": [
      			{
      				"num": "101",
      				"street": "Avenida Paulista",
      				"locality": "Bela Vista",
      				"region": "São Paulo",
      				"state": "SP",
      				"code": "01311-000",
      				"country": "BR"
      			}
      		],
      		"emails": [
      			{
      				"addr": "contact@technova.test"
      			}
      		],
      		"ext": {
      			"br-ibge-municipality": "3550308",
      			"br-nfse-fiscal-incentive": "2",
      			"br-nfse-simples": "1"
      		}
      	},
      	"customer": {
      		"name": "Construforte Engenharia Ltda.",
      		"tax_id": {
      			"country": "BR",
      			"code": "46602178000103"
      		},
      		"addresses": [
      			{
      				"num": "75",
      				"street": "Avenida Sete de Setembro",
      				"street_extra": "Bloco C",
      				"locality": "Centro",
      				"region": "Salvador",
      				"state": "BA",
      				"code": "40060-000",
      				"country": "BR"
      			}
      		]
      	},
      	"lines": [
      		{
      			"i": 1,
      			"quantity": "15",
      			"item": {
      				"name": "Consultancy Services",
      				"price": "100.00",
      				"ext": {
      					"br-nfse-cnae": "62.01-5-01",
      					"br-nfse-service": "10.5"
      				}
      			},
      			"sum": "1500.00",
      			"taxes": [
      				{
      					"cat": "ISS",
      					"percent": "15%",
      					"ext": {
      						"br-nfse-iss-liability": "1"
      					}
      				}
      			],
      			"total": "1500.00"
      		}
      	],
      	"totals": {
      		"sum": "1500.00",
      		"total": "1500.00",
      		"taxes": {
      			"categories": [
      				{
      					"code": "ISS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfse-iss-liability": "1"
      							},
      							"base": "1500.00",
      							"percent": "15%",
      							"amount": "225.00"
      						}
      					],
      					"amount": "225.00"
      				}
      			],
      			"sum": "0.00"
      		},
      		"tax": "0.00",
      		"total_with_tax": "1500.00",
      		"payable": "1500.00"
      	}
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Example B2B service invoice with RTC (NFS-e)">
    In this example, we're issuing a simple service invoice (NFS-e) with the currently supported RTC (Tax Reform) fields.

    Notice the differences from the previous example:

    * we've set the [`br-nfse-operation`](https://docs.gobl.org/addons/br-nfse-v1#operation-indicator) extension, the [`br-nfse-tax-status`](https://docs.gobl.org/addons/br-nfse-v1#tax-status-code-cst) extension and the [`br-nfse-tax-class`](https://docs.gobl.org/addons/br-nfse-v1#tax-classification-code) extension at item level which will be used to determine the IBS and CBS taxes as part of the tax reform.

    <CodeGroup>
      ```json B2B Service Invoice (NFS-e) RTC theme={null}
      {
        "$schema": "https://gobl.org/draft-0/bill/invoice",
        "$addons": [
          "br-nfse-v1"
        ],
        "series": "XXBR",
        "supplier": {
          "name": "TechNova Soluções Digitais Ltda.",
          "tax_id": {
            "country": "BR",
            "code": "05229829000184"
          },
          "identities": [
            {
              "key": "br-nfse-municipal-reg",
              "code": "45678901234567"
            }
          ],
          "addresses": [
            {
              "num": "101",
              "street": "Avenida Paulista",
              "locality": "Bela Vista",
              "region": "São Paulo",
              "state": "SP",
              "code": "01311-000",
              "country": "BR"
            }
          ],
          "emails": [
            {
              "addr": "contact@technova.test"
            }
          ],
          "ext": {
            "br-ibge-municipality": "3550308",
            "br-nfse-simples": "1"
          }
        },
        "customer": {
          "name": "Construforte Engenharia Ltda.",
          "tax_id": {
            "country": "BR",
            "code": "46602178000103"
          },
          "addresses": [
            {
              "num": "75",
              "street": "Avenida Sete de Setembro",
              "street_extra": "Bloco C",
              "locality": "Centro",
              "region": "Salvador",
              "state": "BA",
              "code": "40060-000",
              "country": "BR"
            }
          ]
        },
        "lines": [
          {
            "quantity": "15",
            "item": {
              "name": "Consultancy Services",
              "price": "100.00",
              "ext": {
                "br-nfse-cnae": "62.01-5-01",
                "br-nfse-operation": "030101",
                "br-nfse-service": "10.5",
                "br-nfse-tax-class": "000001",
                "br-nfse-tax-status": "000"
              }
            },
            "taxes": [
              {
                "cat": "ISS",
                "percent": "15%"
              }
            ]
          }
        ]
      }
      ```

      ```json Built version theme={null}
      {
      	"$schema": "https://gobl.org/draft-0/bill/invoice",
      	"$regime": "BR",
      	"$addons": [
      		"br-nfse-v1"
      	],
      	"type": "standard",
      	"series": "XXBR",
      	"issue_date": "2026-07-08",
      	"currency": "BRL",
      	"supplier": {
      		"name": "TechNova Soluções Digitais Ltda.",
      		"tax_id": {
      			"country": "BR",
      			"code": "05229829000184"
      		},
      		"identities": [
      			{
      				"key": "br-nfse-municipal-reg",
      				"code": "45678901234567"
      			}
      		],
      		"addresses": [
      			{
      				"num": "101",
      				"street": "Avenida Paulista",
      				"locality": "Bela Vista",
      				"region": "São Paulo",
      				"state": "SP",
      				"code": "01311-000",
      				"country": "BR"
      			}
      		],
      		"emails": [
      			{
      				"addr": "contact@technova.test"
      			}
      		],
      		"ext": {
      			"br-ibge-municipality": "3550308",
      			"br-nfse-fiscal-incentive": "2",
      			"br-nfse-simples": "1"
      		}
      	},
      	"customer": {
      		"name": "Construforte Engenharia Ltda.",
      		"tax_id": {
      			"country": "BR",
      			"code": "46602178000103"
      		},
      		"addresses": [
      			{
      				"num": "75",
      				"street": "Avenida Sete de Setembro",
      				"street_extra": "Bloco C",
      				"locality": "Centro",
      				"region": "Salvador",
      				"state": "BA",
      				"code": "40060-000",
      				"country": "BR"
      			}
      		]
      	},
      	"lines": [
      		{
      			"i": 1,
      			"quantity": "15",
      			"item": {
      				"name": "Consultancy Services",
      				"price": "100.00",
      				"ext": {
      					"br-nfse-cnae": "62.01-5-01",
      					"br-nfse-operation": "030101",
      					"br-nfse-service": "10.5",
      					"br-nfse-tax-class": "000001",
      					"br-nfse-tax-status": "000"
      				}
      			},
      			"sum": "1500.00",
      			"taxes": [
      				{
      					"cat": "ISS",
      					"percent": "15%",
      					"ext": {
      						"br-nfse-iss-liability": "1"
      					}
      				}
      			],
      			"total": "1500.00"
      		}
      	],
      	"totals": {
      		"sum": "1500.00",
      		"total": "1500.00",
      		"taxes": {
      			"categories": [
      				{
      					"code": "ISS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfse-iss-liability": "1"
      							},
      							"base": "1500.00",
      							"percent": "15%",
      							"amount": "225.00"
      						}
      					],
      					"amount": "225.00"
      				}
      			],
      			"sum": "0.00"
      		},
      		"tax": "0.00",
      		"total_with_tax": "1500.00",
      		"payable": "1500.00"
      	}
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Example B2B product invoice (NF-e)">
    In this example, we're issuing an extended product invoice (NF-e) from a Brazilian supplier to another Brazilian business customer.

    Notice:

    * we've added the [`br-nfe-v4`](https://docs.gobl.org/addons/br-nfe-v4) addon without the `simplified` tag; this sets the [`br-nfe-model`](https://docs.gobl.org/addons/br-nfe-v4#model) extension to `55` (NF-e),
    * the customer is required for NF-e and must include a full address; Brazilian customers must declare the [`br-ibge-municipality`](https://docs.gobl.org/addons/br-nfe-v4#municipality-code) extension and a valid state, while foreign customers can be identified by a country-qualified `identity` (e.g. a passport) instead of a `tax_id`,
    * supplier and customer addresses must include a `country`; it is auto-filled from the party's tax ID (or first identity that declares a country) when omitted,
    * each line must include a [`br-nfe-cfop`](https://docs.gobl.org/addons/br-nfe-v4#cfop-fiscal-operations-and-services-code) extension to classify the fiscal operation,
    * item identities carry the NCM product classification code (`cProd` in the NF-e XML) and the GTIN barcode (`cEAN`),
    * `item.ref` maps to the supplier's internal product code, and `item.unit` is converted to a UNECE unit code,
    * line `discounts` reduce the taxable base (`vDesc`); line `charges` with key `delivery` map to freight (`vFrete`) and key `insurance` to insurance value (`vSeg`),
    * `line.order` provides the line reference within the purchase order (`nItemPed`),
    * a line `notes` entry with key `goods` maps to per-item additional information (`infAdProd`),
    * `ordering.code` sets the purchase order number (`nPed` in `compra`) and `ordering.contracts[0].code` sets the contract number (`nCont`),
    * `delivery.receiver` sets a separate delivery address (`entrega`) when goods ship to a different location than the buyer's fiscal address,
    * the payment instructions key is set to `credit-transfer`, which causes the [`br-nfe-payment-means`](https://docs.gobl.org/addons/br-nfe-v4#payment-method) extension to be set automatically to `18` (transferência bancária),
    * a `general` note maps to complementary information (`infCpl`) in the NF-e XML,
    * tax percentages are provided explicitly as they vary depending on the state and type of goods,
    * there are no totals or calculations; all these will be made automatically when uploading, and,
    * make sure to process it with the "DF-e issue product invoice (NF-e)" workflow created during setup.

    <CodeGroup>
      ```json B2B Product Invoice (NF-e) theme={null}
      {
        "$schema": "https://gobl.org/draft-0/bill/invoice",
        "$addons": [
          "br-nfe-v4"
        ],
        "series": "1",
        "issue_date": "2026-05-22",
        "tax": {
          "ext": {
            "br-nfe-model": "55",
            "br-nfe-presence": "2"
          }
        },
        "supplier": {
          "name": "TechNova Soluções Digitais Ltda.",
          "tax_id": {
            "country": "BR",
            "code": "05229829000184"
          },
          "identities": [
            {
              "key": "br-nfe-state-reg",
              "code": "12345678901234"
            }
          ],
          "addresses": [
            {
              "num": "101",
              "street": "Avenida Paulista",
              "locality": "Bela Vista",
              "region": "São Paulo",
              "state": "SP",
              "code": "01311-000",
              "country": "BR"
            }
          ],
          "emails": [
            {
              "addr": "contact@technova.test"
            }
          ],
          "ext": {
            "br-ibge-municipality": "3550308"
          }
        },
        "customer": {
          "name": "Construforte Engenharia Ltda.",
          "tax_id": {
            "country": "BR",
            "code": "46602178000103"
          },
          "addresses": [
            {
              "num": "75",
              "street": "Avenida Sete de Setembro",
              "street_extra": "Bloco C",
              "locality": "Centro",
              "region": "Salvador",
              "state": "BA",
              "code": "40060-000",
              "country": "BR"
            }
          ],
          "ext": {
            "br-ibge-municipality": "2927408"
          }
        },
        "ordering": {
          "code": "PED-2026-0547",
          "contracts": [
            {
              "code": "CON-2026-015"
            }
          ]
        },
        "delivery": {
          "receiver": {
            "name": "Construforte Engenharia Ltda.",
            "tax_id": {
              "country": "BR",
              "code": "46602178000103"
            },
            "addresses": [
              {
                "num": "1200",
                "street": "Avenida ACM",
                "locality": "Caminho das Árvores",
                "region": "Salvador",
                "state": "BA",
                "code": "41820-014",
                "country": "BR"
              }
            ],
            "ext": {
              "br-ibge-municipality": "2927408"
            }
          }
        },
        "lines": [
          {
            "quantity": "10",
            "order": "1",
            "item": {
              "ref": "USB-C-2M",
              "name": "Cabo USB-C 2 metros",
              "unit": "piece",
              "price": "28.90",
              "identities": [
                {
                  "key": "ncm",
                  "code": "85444290"
                },
                {
                  "key": "gtin",
                  "code": "7891234567890"
                }
              ]
            },
            "discounts": [
              {
                "percent": "5%",
                "reason": "Desconto comercial"
              }
            ],
            "charges": [
              {
                "key": "delivery",
                "amount": "15.00"
              },
              {
                "key": "insurance",
                "amount": "5.00"
              }
            ],
            "notes": [
              {
                "key": "goods",
                "text": "Cabo homologado para carregamento rápido."
              }
            ],
            "taxes": [
              {
                "cat": "ICMS",
                "percent": "12.0%"
              },
              {
                "cat": "PIS",
                "percent": "1.65%"
              },
              {
                "cat": "COFINS",
                "percent": "7.60%"
              }
            ],
            "ext": {
              "br-nfe-cfop": "6102"
            }
          }
        ],
        "payment": {
          "instructions": {
            "key": "credit-transfer"
          }
        },
        "notes": [
          {
            "key": "reason",
            "text": "Venda de Mercadorias"
          },
          {
            "key": "general",
            "text": "Pedido nº 2026/0547."
          }
        ]
      }
      ```

      ```json Built version theme={null}
      {
      	"$schema": "https://gobl.org/draft-0/bill/invoice",
      	"$regime": "BR",
      	"$addons": [
      		"br-nfe-v4"
      	],
      	"type": "standard",
      	"series": "1",
      	"issue_date": "2026-05-22",
      	"currency": "BRL",
      	"tax": {
      		"ext": {
      			"br-nfe-model": "55",
      			"br-nfe-operation-type": "1",
      			"br-nfe-presence": "2",
      			"br-nfe-purpose": "1"
      		}
      	},
      	"supplier": {
      		"name": "TechNova Soluções Digitais Ltda.",
      		"tax_id": {
      			"country": "BR",
      			"code": "05229829000184"
      		},
      		"identities": [
      			{
      				"key": "br-nfe-state-reg",
      				"code": "12345678901234"
      			}
      		],
      		"addresses": [
      			{
      				"num": "101",
      				"street": "Avenida Paulista",
      				"locality": "Bela Vista",
      				"region": "São Paulo",
      				"state": "SP",
      				"code": "01311-000",
      				"country": "BR"
      			}
      		],
      		"emails": [
      			{
      				"addr": "contact@technova.test"
      			}
      		],
      		"ext": {
      			"br-ibge-municipality": "3550308",
      			"br-nfe-regime": "3"
      		}
      	},
      	"customer": {
      		"name": "Construforte Engenharia Ltda.",
      		"tax_id": {
      			"country": "BR",
      			"code": "46602178000103"
      		},
      		"addresses": [
      			{
      				"num": "75",
      				"street": "Avenida Sete de Setembro",
      				"street_extra": "Bloco C",
      				"locality": "Centro",
      				"region": "Salvador",
      				"state": "BA",
      				"code": "40060-000",
      				"country": "BR"
      			}
      		],
      		"ext": {
      			"br-ibge-municipality": "2927408"
      		}
      	},
      	"lines": [
      		{
      			"i": 1,
      			"quantity": "10",
      			"order": "1",
      			"item": {
      				"ref": "USB-C-2M",
      				"name": "Cabo USB-C 2 metros",
      				"identities": [
      					{
      						"key": "ncm",
      						"code": "85444290"
      					},
      					{
      						"key": "gtin",
      						"code": "7891234567890"
      					}
      				],
      				"price": "28.90",
      				"unit": "piece"
      			},
      			"sum": "289.00",
      			"discounts": [
      				{
      					"reason": "Desconto comercial",
      					"percent": "5%",
      					"amount": "14.45"
      				}
      			],
      			"charges": [
      				{
      					"key": "delivery",
      					"amount": "15.00"
      				},
      				{
      					"key": "insurance",
      					"amount": "5.00"
      				}
      			],
      			"taxes": [
      				{
      					"cat": "ICMS",
      					"percent": "12.0%",
      					"ext": {
      						"br-nfe-icms-cst": "00",
      						"br-nfe-icms-origin": "0"
      					}
      				},
      				{
      					"cat": "PIS",
      					"percent": "1.65%",
      					"ext": {
      						"br-nfe-pis-cst": "01"
      					}
      				},
      				{
      					"cat": "COFINS",
      					"percent": "7.60%",
      					"ext": {
      						"br-nfe-cofins-cst": "01"
      					}
      				}
      			],
      			"total": "294.55",
      			"notes": [
      				{
      					"key": "goods",
      					"text": "Cabo homologado para carregamento rápido."
      				}
      			],
      			"ext": {
      				"br-nfe-cfop": "6102"
      			}
      		}
      	],
      	"ordering": {
      		"code": "PED-2026-0547",
      		"contracts": [
      			{
      				"code": "CON-2026-015"
      			}
      		]
      	},
      	"payment": {
      		"instructions": {
      			"key": "credit-transfer",
      			"ext": {
      				"br-nfe-payment-means": "18"
      			}
      		}
      	},
      	"delivery": {
      		"receiver": {
      			"name": "Construforte Engenharia Ltda.",
      			"tax_id": {
      				"country": "BR",
      				"code": "46602178000103"
      			},
      			"addresses": [
      				{
      					"num": "1200",
      					"street": "Avenida ACM",
      					"locality": "Caminho das Árvores",
      					"region": "Salvador",
      					"state": "BA",
      					"code": "41820-014",
      					"country": "BR"
      				}
      			],
      			"ext": {
      				"br-ibge-municipality": "2927408"
      			}
      		}
      	},
      	"totals": {
      		"sum": "294.55",
      		"total": "294.55",
      		"taxes": {
      			"categories": [
      				{
      					"code": "ICMS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-icms-cst": "00",
      								"br-nfe-icms-origin": "0"
      							},
      							"base": "294.55",
      							"percent": "12.0%",
      							"amount": "35.35"
      						}
      					],
      					"amount": "35.35"
      				},
      				{
      					"code": "PIS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-pis-cst": "01"
      							},
      							"base": "294.55",
      							"percent": "1.65%",
      							"amount": "4.86"
      						}
      					],
      					"amount": "4.86"
      				},
      				{
      					"code": "COFINS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-cofins-cst": "01"
      							},
      							"base": "294.55",
      							"percent": "7.60%",
      							"amount": "22.39"
      						}
      					],
      					"amount": "22.39"
      				}
      			],
      			"sum": "0.00"
      		},
      		"tax": "0.00",
      		"total_with_tax": "294.55",
      		"payable": "294.55"
      	},
      	"notes": [
      		{
      			"key": "reason",
      			"text": "Venda de Mercadorias"
      		},
      		{
      			"key": "general",
      			"text": "Pedido nº 2026/0547."
      		}
      	]
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Example B2B product invoice for a Simples Nacional issuer (NF-e)">
    In this example, we're issuing a product invoice (NF-e) from a supplier enrolled in the *Simples Nacional* tax regime.

    Notice the differences from the previous example:

    * the supplier declares its regime with the [`br-nfe-regime`](https://docs.gobl.org/addons/br-nfe-v4#tax-regime-code) extension set to `1` (*Simples Nacional*); use `2` for *Simples Nacional, Excess* or `4` for *MEI* — omitting it defaults to `3` (normal regime),
    * each ICMS line carries the [`br-nfe-icms-csosn`](https://docs.gobl.org/addons/br-nfe-v4#icms-simples-nacional-status-code-csosn) extension (here `101`, taxed with credit permission) instead of the `br-nfe-icms-cst` code that normal-regime issuers use,
    * PIS and COFINS are still required on every line but are not levied per item under *Simples Nacional*, so they use the [`br-nfe-pis-cst`](https://docs.gobl.org/addons/br-nfe-v4#pis-tax-status-code-cst) and [`br-nfe-cofins-cst`](https://docs.gobl.org/addons/br-nfe-v4#cofins-tax-status-code-cst) extensions set to `49` (other operations) at a `0%` rate,
    * there are no totals or calculations; all these will be made automatically when uploading, and,
    * make sure to process it with the "DF-e issue product invoice (NF-e)" workflow created during setup.

    <CodeGroup>
      ```json B2B Product Invoice — Simples Nacional (NF-e) theme={null}
      {
        "$schema": "https://gobl.org/draft-0/bill/invoice",
        "$addons": [
          "br-nfe-v4"
        ],
        "series": "1",
        "tax": {
          "ext": {
            "br-nfe-presence": "1"
          }
        },
        "supplier": {
          "name": "Marcenaria Arte & Design ME",
          "tax_id": {
            "country": "BR",
            "code": "21586733000120"
          },
          "identities": [
            {
              "key": "br-nfe-state-reg",
              "code": "0623458900"
            }
          ],
          "addresses": [
            {
              "num": "85",
              "street": "Rua dos Artesãos",
              "locality": "Savassi",
              "region": "Minas Gerais",
              "state": "MG",
              "code": "30140-071",
              "country": "BR"
            }
          ],
          "emails": [
            {
              "addr": "contato@artedesign.com.br"
            }
          ],
          "ext": {
            "br-ibge-municipality": "3106200",
            "br-nfe-regime": "1"
          }
        },
        "customer": {
          "name": "Comércio de Móveis Paulista Ltda.",
          "tax_id": {
            "country": "BR",
            "code": "33944792000101"
          },
          "addresses": [
            {
              "num": "742",
              "street": "Avenida Paulista",
              "locality": "Bela Vista",
              "region": "São Paulo",
              "state": "SP",
              "code": "01310-100",
              "country": "BR"
            }
          ],
          "ext": {
            "br-ibge-municipality": "3550308"
          }
        },
        "lines": [
          {
            "quantity": "5",
            "item": {
              "name": "Mesa de Jantar em Madeira Maciça",
              "price": "900.00",
              "identities": [
                {
                  "key": "ncm",
                  "code": "94036000"
                }
              ]
            },
            "taxes": [
              {
                "cat": "ICMS",
                "percent": "2.56%",
                "ext": {
                  "br-nfe-icms-csosn": "101"
                }
              },
              {
                "cat": "PIS",
                "percent": "0%",
                "ext": {
                  "br-nfe-pis-cst": "49"
                }
              },
              {
                "cat": "COFINS",
                "percent": "0%",
                "ext": {
                  "br-nfe-cofins-cst": "49"
                }
              }
            ],
            "ext": {
              "br-nfe-cfop": "6102"
            }
          }
        ],
        "payment": {
          "instructions": {
            "key": "credit-transfer"
          }
        },
        "notes": [
          {
            "key": "reason",
            "text": "Venda de mercadoria"
          }
        ]
      }
      ```

      ```json Built version theme={null}
      {
      	"$schema": "https://gobl.org/draft-0/bill/invoice",
      	"$regime": "BR",
      	"$addons": [
      		"br-nfe-v4"
      	],
      	"type": "standard",
      	"series": "1",
      	"issue_date": "2026-07-08",
      	"currency": "BRL",
      	"tax": {
      		"ext": {
      			"br-nfe-model": "55",
      			"br-nfe-operation-type": "1",
      			"br-nfe-presence": "1",
      			"br-nfe-purpose": "1"
      		}
      	},
      	"supplier": {
      		"name": "Marcenaria Arte \u0026 Design ME",
      		"tax_id": {
      			"country": "BR",
      			"code": "21586733000120"
      		},
      		"identities": [
      			{
      				"key": "br-nfe-state-reg",
      				"code": "0623458900"
      			}
      		],
      		"addresses": [
      			{
      				"num": "85",
      				"street": "Rua dos Artesãos",
      				"locality": "Savassi",
      				"region": "Minas Gerais",
      				"state": "MG",
      				"code": "30140-071",
      				"country": "BR"
      			}
      		],
      		"emails": [
      			{
      				"addr": "contato@artedesign.com.br"
      			}
      		],
      		"ext": {
      			"br-ibge-municipality": "3106200",
      			"br-nfe-regime": "1"
      		}
      	},
      	"customer": {
      		"name": "Comércio de Móveis Paulista Ltda.",
      		"tax_id": {
      			"country": "BR",
      			"code": "33944792000101"
      		},
      		"addresses": [
      			{
      				"num": "742",
      				"street": "Avenida Paulista",
      				"locality": "Bela Vista",
      				"region": "São Paulo",
      				"state": "SP",
      				"code": "01310-100",
      				"country": "BR"
      			}
      		],
      		"ext": {
      			"br-ibge-municipality": "3550308"
      		}
      	},
      	"lines": [
      		{
      			"i": 1,
      			"quantity": "5",
      			"item": {
      				"name": "Mesa de Jantar em Madeira Maciça",
      				"identities": [
      					{
      						"key": "ncm",
      						"code": "94036000"
      					}
      				],
      				"price": "900.00"
      			},
      			"sum": "4500.00",
      			"taxes": [
      				{
      					"cat": "ICMS",
      					"percent": "2.56%",
      					"ext": {
      						"br-nfe-icms-csosn": "101",
      						"br-nfe-icms-origin": "0"
      					}
      				},
      				{
      					"cat": "PIS",
      					"percent": "0%",
      					"ext": {
      						"br-nfe-pis-cst": "49"
      					}
      				},
      				{
      					"cat": "COFINS",
      					"percent": "0%",
      					"ext": {
      						"br-nfe-cofins-cst": "49"
      					}
      				}
      			],
      			"total": "4500.00",
      			"ext": {
      				"br-nfe-cfop": "6102"
      			}
      		}
      	],
      	"payment": {
      		"instructions": {
      			"key": "credit-transfer",
      			"ext": {
      				"br-nfe-payment-means": "18"
      			}
      		}
      	},
      	"totals": {
      		"sum": "4500.00",
      		"total": "4500.00",
      		"taxes": {
      			"categories": [
      				{
      					"code": "ICMS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-icms-csosn": "101",
      								"br-nfe-icms-origin": "0"
      							},
      							"base": "4500.00",
      							"percent": "2.56%",
      							"amount": "115.20"
      						}
      					],
      					"amount": "115.20"
      				},
      				{
      					"code": "PIS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-pis-cst": "49"
      							},
      							"base": "4500.00",
      							"percent": "0%",
      							"amount": "0.00"
      						}
      					],
      					"amount": "0.00"
      				},
      				{
      					"code": "COFINS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-cofins-cst": "49"
      							},
      							"base": "4500.00",
      							"percent": "0%",
      							"amount": "0.00"
      						}
      					],
      					"amount": "0.00"
      				}
      			],
      			"sum": "0.00"
      		},
      		"tax": "0.00",
      		"total_with_tax": "4500.00",
      		"payable": "4500.00"
      	},
      	"notes": [
      		{
      			"key": "reason",
      			"text": "Venda de mercadoria"
      		}
      	]
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Example NF-e for a full goods return">
    In this example, we're issuing a NF-e that fully returns the goods of a previously issued B2B product invoice — a *devolução total* under the pre-reform (pre-RTC) rules.

    Notice the differences from a standard product invoice:

    * the document `type` is `credit-note`; it keeps the [`br-nfe-v4`](https://docs.gobl.org/addons/br-nfe-v4) addon and is still issued as an NF-e, so [`br-nfe-model`](https://docs.gobl.org/addons/br-nfe-v4#fiscal-document-model-code) is derived as `55`,
    * a `preceding` entry references the original NF-e and carries its SEFAZ access key (*chave de acesso*) as a stamp — you can copy it from the `sefaz-key` entry in the `stamps` array of the original invoice's envelope `head`, where it was added once the tax authority authorized the document,
    * because this is a full return, the [`br-nfe-purpose`](https://docs.gobl.org/addons/br-nfe-v4#purpose-code) extension is set to `4` (*Goods Return*) and the [`br-nfe-operation-type`](https://docs.gobl.org/addons/br-nfe-v4#operation-type-code) extension to `0` (*Inbound / Entrada*), since the returned goods re-enter the supplier; standard invoices set these automatically to `1` (normal) and `1` (outbound), but corrective documents must set both explicitly,
    * no [`br-nfe-credit-note-type`](https://docs.gobl.org/addons/br-nfe-v4#credit-note-type-code) extension is used: that field only applies to post-reform IBS/CBS credit notes (those set `br-nfe-purpose` to `5`),
    * the line [`br-nfe-cfop`](https://docs.gobl.org/addons/br-nfe-v4#cfop-fiscal-operations-and-services-code) is a return code — `2202` (*Devolução de venda de mercadoria adquirida ou recebida de terceiros*) — mirroring the original `6102` sale but recorded as an inbound inter-state operation (CFOP starting with `2`),
    * the payment sets the [`br-nfe-payment-means`](https://docs.gobl.org/addons/br-nfe-v4#payment-method) extension to `90` (*No payment*), as a return does not involve a new payment,
    * there are no totals or calculations; all these will be made automatically when uploading, and,
    * make sure to process it with the "DF-e issue product invoice (NF-e)" workflow created during setup.

    <CodeGroup>
      ```json Credit Note — Full Return (NF-e) theme={null}
      {
        "$schema": "https://gobl.org/draft-0/bill/invoice",
        "$addons": [
          "br-nfe-v4"
        ],
        "type": "credit-note",
        "series": "1",
        "issue_date": "2024-11-20",
        "tax": {
          "ext": {
            "br-nfe-presence": "1",
            "br-nfe-purpose": "4",
            "br-nfe-operation-type": "0"
          }
        },
        "preceding": [
          {
            "type": "standard",
            "series": "1",
            "code": "1",
            "issue_date": "2024-11-15",
            "stamps": [
              {
                "prv": "sefaz-key",
                "val": "35241105229829000184550010000000011000000019"
              }
            ]
          }
        ],
        "supplier": {
          "name": "TechNova Soluções Digitais Ltda.",
          "tax_id": {
            "country": "BR",
            "code": "05229829000184"
          },
          "identities": [
            {
              "key": "br-nfe-state-reg",
              "code": "12345678901234"
            }
          ],
          "addresses": [
            {
              "num": "101",
              "street": "Avenida Paulista",
              "locality": "Bela Vista",
              "region": "São Paulo",
              "state": "SP",
              "code": "01311-000",
              "country": "BR"
            }
          ],
          "emails": [
            {
              "addr": "contact@technova.test"
            }
          ],
          "ext": {
            "br-ibge-municipality": "3550308"
          }
        },
        "customer": {
          "name": "Construforte Engenharia Ltda.",
          "tax_id": {
            "country": "BR",
            "code": "46602178000103"
          },
          "addresses": [
            {
              "num": "75",
              "street": "Avenida Sete de Setembro",
              "street_extra": "Bloco C",
              "locality": "Centro",
              "region": "Salvador",
              "state": "BA",
              "code": "40060-000",
              "country": "BR"
            }
          ],
          "ext": {
            "br-ibge-municipality": "2927408"
          }
        },
        "lines": [
          {
            "quantity": "10",
            "item": {
              "name": "Cabo USB-C 2 metros",
              "price": "28.90",
              "identities": [
                {
                  "key": "ncm",
                  "code": "85444290"
                }
              ]
            },
            "taxes": [
              {
                "cat": "ICMS",
                "percent": "12.0%"
              },
              {
                "cat": "PIS",
                "percent": "1.65%"
              },
              {
                "cat": "COFINS",
                "percent": "7.60%"
              }
            ],
            "ext": {
              "br-nfe-cfop": "2202"
            }
          }
        ],
        "payment": {
          "instructions": {
            "key": "other",
            "ext": {
              "br-nfe-payment-means": "90"
            }
          }
        },
        "notes": [
          {
            "key": "reason",
            "text": "Devolução total de mercadoria"
          }
        ]
      }
      ```

      ```json Built version theme={null}
      {
      	"$schema": "https://gobl.org/draft-0/bill/invoice",
      	"$regime": "BR",
      	"$addons": [
      		"br-nfe-v4"
      	],
      	"type": "credit-note",
      	"series": "1",
      	"issue_date": "2024-11-20",
      	"currency": "BRL",
      	"preceding": [
      		{
      			"type": "standard",
      			"issue_date": "2024-11-15",
      			"series": "1",
      			"code": "1",
      			"stamps": [
      				{
      					"prv": "sefaz-key",
      					"val": "35241105229829000184550010000000011000000019"
      				}
      			]
      		}
      	],
      	"tax": {
      		"ext": {
      			"br-nfe-model": "55",
      			"br-nfe-operation-type": "0",
      			"br-nfe-presence": "1",
      			"br-nfe-purpose": "4"
      		}
      	},
      	"supplier": {
      		"name": "TechNova Soluções Digitais Ltda.",
      		"tax_id": {
      			"country": "BR",
      			"code": "05229829000184"
      		},
      		"identities": [
      			{
      				"key": "br-nfe-state-reg",
      				"code": "12345678901234"
      			}
      		],
      		"addresses": [
      			{
      				"num": "101",
      				"street": "Avenida Paulista",
      				"locality": "Bela Vista",
      				"region": "São Paulo",
      				"state": "SP",
      				"code": "01311-000",
      				"country": "BR"
      			}
      		],
      		"emails": [
      			{
      				"addr": "contact@technova.test"
      			}
      		],
      		"ext": {
      			"br-ibge-municipality": "3550308",
      			"br-nfe-regime": "3"
      		}
      	},
      	"customer": {
      		"name": "Construforte Engenharia Ltda.",
      		"tax_id": {
      			"country": "BR",
      			"code": "46602178000103"
      		},
      		"addresses": [
      			{
      				"num": "75",
      				"street": "Avenida Sete de Setembro",
      				"street_extra": "Bloco C",
      				"locality": "Centro",
      				"region": "Salvador",
      				"state": "BA",
      				"code": "40060-000",
      				"country": "BR"
      			}
      		],
      		"ext": {
      			"br-ibge-municipality": "2927408"
      		}
      	},
      	"lines": [
      		{
      			"i": 1,
      			"quantity": "10",
      			"item": {
      				"name": "Cabo USB-C 2 metros",
      				"identities": [
      					{
      						"key": "ncm",
      						"code": "85444290"
      					}
      				],
      				"price": "28.90"
      			},
      			"sum": "289.00",
      			"taxes": [
      				{
      					"cat": "ICMS",
      					"percent": "12.0%",
      					"ext": {
      						"br-nfe-icms-cst": "00",
      						"br-nfe-icms-origin": "0"
      					}
      				},
      				{
      					"cat": "PIS",
      					"percent": "1.65%",
      					"ext": {
      						"br-nfe-pis-cst": "01"
      					}
      				},
      				{
      					"cat": "COFINS",
      					"percent": "7.60%",
      					"ext": {
      						"br-nfe-cofins-cst": "01"
      					}
      				}
      			],
      			"total": "289.00",
      			"ext": {
      				"br-nfe-cfop": "2202"
      			}
      		}
      	],
      	"payment": {
      		"instructions": {
      			"key": "other",
      			"ext": {
      				"br-nfe-payment-means": "90"
      			}
      		}
      	},
      	"totals": {
      		"sum": "289.00",
      		"total": "289.00",
      		"taxes": {
      			"categories": [
      				{
      					"code": "ICMS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-icms-cst": "00",
      								"br-nfe-icms-origin": "0"
      							},
      							"base": "289.00",
      							"percent": "12.0%",
      							"amount": "34.68"
      						}
      					],
      					"amount": "34.68"
      				},
      				{
      					"code": "PIS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-pis-cst": "01"
      							},
      							"base": "289.00",
      							"percent": "1.65%",
      							"amount": "4.77"
      						}
      					],
      					"amount": "4.77"
      				},
      				{
      					"code": "COFINS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-cofins-cst": "01"
      							},
      							"base": "289.00",
      							"percent": "7.60%",
      							"amount": "21.96"
      						}
      					],
      					"amount": "21.96"
      				}
      			],
      			"sum": "0.00"
      		},
      		"tax": "0.00",
      		"total_with_tax": "289.00",
      		"payable": "289.00"
      	},
      	"notes": [
      		{
      			"key": "reason",
      			"text": "Devolução total de mercadoria"
      		}
      	]
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Example B2C consumer invoice (NFC-e)">
    In this example, we're issuing a simple consumer invoice (NFC-e) from a Brazilian supplier.

    Notice:

    * we've added the [`br-nfe-v4`](https://docs.gobl.org/addons/br-nfe-v4) addon with the `simplified` tag; this sets the [`br-nfe-model`](https://docs.gobl.org/addons/br-nfe-v4#model) extension to `65` (NFC-e),
    * the customer is optional and in this example we've omitted it,
    * extensions (`ext`) and identities have been used in multiple locations for fields whose values cannot be determined any other way,
    * the payment instructions key is set to `card`, which causes the [`br-nfe-payment-means`](https://docs.gobl.org/addons/br-nfe-v4#payment-method) extension to be set automatically to `03` (cartão de crédito),
    * tax percentages are provided explicitly as they vary depending on the state and type of goods,
    * there are no totals or calculations; all these will be made automatically when uploading, and,
    * make sure to process it with the "DF-e issue consumer invoice (NFC-e)" workflow created during setup.

    <CodeGroup>
      ```json B2C Consumer Invoice (NFC-e) theme={null}
      {
        "$schema": "https://gobl.org/draft-0/bill/invoice",
        "$addons": [
          "br-nfe-v4"
        ],
        "$tags": [
          "simplified"
        ],
        "series": "123",
        "tax": {
          "ext": {
            "br-nfe-presence": "1"
          }
        },
        "supplier": {
          "name": "TechNova Soluções Digitais Ltda.",
          "tax_id": {
            "country": "BR",
            "code": "05229829000184"
          },
          "identities": [
            {
              "key": "br-nfe-state-reg",
              "code": "12345678901234"
            }
          ],
          "addresses": [
            {
              "num": "101",
              "street": "Avenida Paulista",
              "locality": "Bela Vista",
              "region": "São Paulo",
              "state": "SP",
              "code": "01311-000",
              "country": "BR"
            }
          ],
          "emails": [
            {
              "addr": "contact@technova.test"
            }
          ],
          "ext": {
            "br-ibge-municipality": "3550308",
            "br-nfse-simples": "1"
          }
        },
        "lines": [
          {
            "quantity": "2",
            "item": {
              "name": "Cabo USB-C 2 metros",
              "price": "28.90"
            },
            "taxes": [
              {
                "cat": "ICMS",
                "percent": "18.0%"
              },
              {
                "cat": "PIS",
                "percent": "1.65%"
              },
              {
                "cat": "COFINS",
                "percent": "7.60%"
              }
            ]
          }
        ],
        "payment": {
          "instructions": {
            "key": "card"
          }
        },
        "notes": [
          {
            "key": "reason",
            "text": "Venda de mercadoria"
          }
        ]
      }
      ```

      ```json Built version theme={null}
      {
      	"$schema": "https://gobl.org/draft-0/bill/invoice",
      	"$regime": "BR",
      	"$addons": [
      		"br-nfe-v4"
      	],
      	"$tags": [
      		"simplified"
      	],
      	"type": "standard",
      	"series": "123",
      	"issue_date": "2026-07-08",
      	"currency": "BRL",
      	"tax": {
      		"ext": {
      			"br-nfe-model": "65",
      			"br-nfe-operation-type": "1",
      			"br-nfe-presence": "1",
      			"br-nfe-purpose": "1"
      		}
      	},
      	"supplier": {
      		"name": "TechNova Soluções Digitais Ltda.",
      		"tax_id": {
      			"country": "BR",
      			"code": "05229829000184"
      		},
      		"identities": [
      			{
      				"key": "br-nfe-state-reg",
      				"code": "12345678901234"
      			}
      		],
      		"addresses": [
      			{
      				"num": "101",
      				"street": "Avenida Paulista",
      				"locality": "Bela Vista",
      				"region": "São Paulo",
      				"state": "SP",
      				"code": "01311-000",
      				"country": "BR"
      			}
      		],
      		"emails": [
      			{
      				"addr": "contact@technova.test"
      			}
      		],
      		"ext": {
      			"br-ibge-municipality": "3550308",
      			"br-nfe-regime": "3",
      			"br-nfse-simples": "1"
      		}
      	},
      	"lines": [
      		{
      			"i": 1,
      			"quantity": "2",
      			"item": {
      				"name": "Cabo USB-C 2 metros",
      				"price": "28.90"
      			},
      			"sum": "57.80",
      			"taxes": [
      				{
      					"cat": "ICMS",
      					"percent": "18.0%",
      					"ext": {
      						"br-nfe-icms-cst": "00",
      						"br-nfe-icms-origin": "0"
      					}
      				},
      				{
      					"cat": "PIS",
      					"percent": "1.65%",
      					"ext": {
      						"br-nfe-pis-cst": "01"
      					}
      				},
      				{
      					"cat": "COFINS",
      					"percent": "7.60%",
      					"ext": {
      						"br-nfe-cofins-cst": "01"
      					}
      				}
      			],
      			"total": "57.80"
      		}
      	],
      	"payment": {
      		"instructions": {
      			"key": "card",
      			"ext": {
      				"br-nfe-payment-means": "03"
      			}
      		}
      	},
      	"totals": {
      		"sum": "57.80",
      		"total": "57.80",
      		"taxes": {
      			"categories": [
      				{
      					"code": "ICMS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-icms-cst": "00",
      								"br-nfe-icms-origin": "0"
      							},
      							"base": "57.80",
      							"percent": "18.0%",
      							"amount": "10.40"
      						}
      					],
      					"amount": "10.40"
      				},
      				{
      					"code": "PIS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-pis-cst": "01"
      							},
      							"base": "57.80",
      							"percent": "1.65%",
      							"amount": "0.95"
      						}
      					],
      					"amount": "0.95"
      				},
      				{
      					"code": "COFINS",
      					"informative": true,
      					"rates": [
      						{
      							"ext": {
      								"br-nfe-cofins-cst": "01"
      							},
      							"base": "57.80",
      							"percent": "7.60%",
      							"amount": "4.39"
      						}
      					],
      					"amount": "4.39"
      				}
      			],
      			"sum": "0.00"
      		},
      		"tax": "0.00",
      		"total_with_tax": "57.80",
      		"payable": "57.80"
      	},
      	"notes": [
      		{
      			"key": "reason",
      			"text": "Venda de mercadoria"
      		}
      	]
      }
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

### Cancel an invoice

If you need to cancel a document that has already been sent to the tax authority, you can use the cancel workflows created during setup. Run the appropriate cancel workflow — NFS-e, NF-e, or NFC-e — over the silo entry you want to cancel. On success, the entry will be set to `Void`.

<Info>
  NFS-e cancellations are subject to the rules of each municipality. Some require a specific cancellation code. NFC-e cancellations must be requested within the cancellation window set by the originating state.
</Info>

#### Configuration

Both cancel actions accept optional parameters that control the cancellation request. They can be set as a default on the workflow step (via the step's configuration page in the Console) or overridden per job by passing them as arguments when [creating the job via the API](/api-ref/transform/jobs/create-a-job-put).

| Parameter           | Job argument           | Applies to             | Notes                                                                                                                                               |
| ------------------- | ---------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| Cancellation reason | `nfe-br-cancel-reason` | NFS-e, NF-e, and NFC-e | Free-text reason for the cancellation. For NF-e and NFC-e, must be at least 15 characters if provided. Defaults to the system default when omitted. |
| Cancellation code   | `nfe-br-cancel-code`   | NFS-e only             | Municipality-specific cancellation code, for example `9` for "Outros" in the National NFS-e system. Defaults to the system default when omitted.    |

Job arguments take precedence over the step configuration. To pass them when creating a job via the API:

```json theme={null}
{
  "workflow_id": "...",
  "silo_entry_id": "...",
  "args": {
    "nfe-br-cancel-reason": "Cancelamento a pedido do Prestador",
    "nfe-br-cancel-code": "9"
  }
}
```

## FAQ

<AccordionGroup>
  <Accordion title="What type of Documentos Fiscais does Invopop support?">
    Invopop supports NF-e, NFS-e and NFC-e documents. Transport documents (MDF-e and CT-e) are not currently supported.
  </Accordion>

  <Accordion title="Where can I find the mapping of GOBL fields to DF-e documents?">
    For further details on how GOBL prepares data for conversion, see:

    * The [Brazil Regime GOBL Reference](https://docs.gobl.org/regimes/br).
    * The [NFS-e Addon GOBL Reference](https://docs.gobl.org/addons/br-nfse-v1).
    * The [NF-e Addon GOBL Reference](https://docs.gobl.org/addons/br-nfe-v4).
  </Accordion>
</AccordionGroup>

More available in our [Brazil FAQ](/faq/brazil) section

***

<AccordionGroup>
  <Accordion title="🇧🇷 Invopop resources for Brazil">
    |            |                                                                                                                                                                                                                                                                                                                                                                            |
    | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Compliance | <Icon icon="https://assets.invopop.com/flags/br.svg" /> [Invoicing compliance in Brazil](/compliance/brazil)<br /> <Icon icon="timeline" /> [Compliance timeline](/timelines/brazil)                                                                                                                                                                                       |
    | Apps       | <Icon icon="https://assets.invopop.com/apps/notas-fiscais-eletronicas-brazil/icon.svg" /> [Documentos Fiscais Eletrônicos Brazil](/apps/documentos-fiscais-electronicos-brazil)                                                                                                                                                                                            |
    | Guides     | <Icon icon="book" /> [Supplier registration](/guides/br-dfe-supplier)<br /> <Icon icon="book" /> [Issuing invoices](/guides/br-dfe)                                                                                                                                                                                                                                        |
    | FAQ        | <Icon icon="square-question" /> [Brazil FAQ](/faq/brazil)                                                                                                                                                                                                                                                                                                                  |
    | GOBL       | <Icon icon="https://assets.invopop.com/icons/gobl.svg" />  [Brazil Tax Regime](https://docs.gobl.org/regimes/br)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [Brazil NF-e Addon](https://docs.gobl.org/addons/br-nfe-v4)<br /> <Icon icon="https://assets.invopop.com/icons/gobl.svg" /> [Brazil NFS-e Addon](https://docs.gobl.org/addons/br-nfse-v1) |
  </Accordion>
</AccordionGroup>

<Card title="Participate in our community" icon="forumbee" href="https://community.invopop.com" arrow="true" horizontal>
  Ask and answer questions about invoicing in Brazil →
</Card>
