> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shakesco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Void Invoice

> Cancel an unpaid invoice so it can no longer be paid

<span style={{display:"none"}}>For the complete documentation index, see [llms.txt](/llms.txt).</span>

Cancels a pending invoice. Once voided, the invoice cannot be paid. Already-paid invoices return `422`.

<Info>
  Treat this as a transaction. If the response times out, fetch [`GET /invoices/{invoice_number}`](/api-reference/payment-links/invoices/get) to confirm the current status before retrying.
</Info>

### Path Parameters

<ParamField path="invoice_number" type="string" required>
  The invoice to void
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  `true` once the invoice is marked void
</ResponseField>

```javascript theme={null}
await fetch("https://payments.shakesco.com/invoices/INV-2026-a1b2c3d4/void", {
  method: "POST",
  headers: { Authorization: `Bearer ${API_KEY}` },
});
```

<ResponseExample>
  ```json 200 OK theme={null}
  { "success": true }
  ```

  ```json 404 Not Found theme={null}
  { "message": "Transaction not found." }
  ```

  ```json 422 Already Terminal theme={null}
  { "message": "Invoice is already paid or void." }
  ```
</ResponseExample>
