# Void/delete a document

Source: https://developer.avalara.com/vat-ecom/transactions/certification-requirements/void-delete-document/

**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 cancelled 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:

[![Closed](https://avalara-devdocs-prod.mcoutput.com/vat-ecom/Skins/Default/Stylesheets/Images/transparent.gif)View example](javascript:void\(0\);)

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

Use the DocDeleted code for saved but uncommitted transactions.

[![Closed](https://avalara-devdocs-prod.mcoutput.com/vat-ecom/Skins/Default/Stylesheets/Images/transparent.gif)View example](javascript:void\(0\);)

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