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

# Void an invoice

> POST /v1/invoices/{invoiceId}/void voids an invoice the business created and turns its pay link off.

```
POST /v1/invoices/{invoiceId}/void
```

**Scope:** `invoices:write`  ·  **Idempotency-Key:** optional

<ParamField path="invoiceId" type="string" required>The invoice.</ParamField>
<ParamField body="reason" type="string">Why it was voided, up to 500 characters. The customer sees it.</ParamField>

```bash theme={null}
curl -X POST https://api.stg.cleo-pay.com/v1/invoices/d7e8f9a0-b1c2-4d3e-8f4a-5b6c7d8e9f0a/void \
  --header "Authorization: Bearer $CLEO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{ "reason": "Issued in error" }'
```

## Response

`200` with the invoice, `status: "void"` and its link off. Voiding a void invoice turns its link off again and returns it.

## Errors

| Code | When |
| - | - |
| `validation_error` | Another business created the invoice, or it is paid, partly paid or scheduled for payment. |
| `payment_in_progress` | A payment on the invoice is in flight. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.