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

# Void invoices

Voiding an invoice is akin to deleting or canceling it in principle.
Yet, voiding preserves a paper trail, enabling you to locate the invoice by its number.
Voided invoices are considered as having zero value for reporting and are not payable.
Importantly, this status is final, meaning the invoice's status remains unalterable.

Once you void an invoice, it remains accessible through the UI views and shows a status `voided` indicating it has been voided.
You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`.

<Tabs>
  <Tab title="Dashboard">
    To void an invoice using the user interface:

    1. Go to the **"Invoices"** list;
    2. Click the **ellipsis icon** on the right, on the line corresponding to the invoice;
    3. Select **"Void invoice"**; and
    4. Confirm to void the invoice.
  </Tab>

  <Tab title="API">
    <CodeGroup>
      ```bash Void an existing invoice
        LAGO_URL="https://api.getlago.com"
        API_KEY="__YOUR_API_KEY__"
        INVOICE_ID="__YOUR_INVOICE_ID__"

        curl --location --request POST "$LAGO_URL/api/v1/invoices/$INVOICE_ID/void" \
          --header "Authorization: Bearer $API_KEY"

      ```
    </CodeGroup>
  </Tab>
</Tabs>

## Restrictions on voiding invoices

You cannot void an invoice when:

* The invoice is in `draft` status, as it hasn't been finalized yet; or
* The payment status of the invoice is `succeeded`, indicating that the payment has been successfully processed; or
* There is still credit available for one of the credit notes linked to the invoice; or
* The invoice has already been voided.

## Voiding invoices with applied discounts

* Coupons applied to an invoice marked as void are lost;
* Prepaid credits deducted from an invoice marked as void are refunded, provided the wallet is still active; and
* Credit notes applied to an invoice marked as void are refunded to the credit note wallet.
