# Void/delete a document

Source: https://developer.avalara.com/avatax-for-vat/zvu4066009577453/

# Void/delete a document

Learn how to void or delete a document in AvaTax using the VoidTransaction API.

**Element type:** Conditional

**Endpoints/models used:** [VoidTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/VoidTransaction/)

If your source application supports voiding/deleting invoices, then the corresponding transaction in AvaTax must be updated with the current transaction status.

In AvaTax, you can call [VoidTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/VoidTransaction/) to recover from posting problems and canceled transactions. The effect of this API depends upon the current state of the document (uncommitted/saved, posted, or committed), and the `code` provided in the request body. Refer to the [VoidTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/VoidTransaction/) API for more information about codes. Examples are below.

Use the `DocVoided` code for saved and committed transactions:

**Example**

```
{
  "companyCode": 555,
  "transactionCode": "5555555aa-5aa5-5a55-a555-55a555a5555a",
  "code": "DocVoided",
  "commit": true
}
```

Use the `DocDeleted` code for saved but uncommitted transactions.

**Example**

```
{
  "companyCode": 555,
  "transactionCode": "5555555aa-5aa5-5a55-a555-55a555a5555a",
  "code": "DocDeleted",
  "commit": false
}
```