# Voiding/deleting invoices

Source: https://developer.avalara.com/avatax-dm-combined-erp/sales-tax-badge/transactions/cert-void-doc/

# Voiding/deleting invoices

**Element type: Conditional**

**Endpoints/models used:** [VoidTransactionModel](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/VoidTransactionModel%20%3E%20code/)

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`POST /api/v2/companies/{companyCode}/transactions/{transactionCode}/void` to recover from posting problems and cancelled transactions. The effect of the void endpoint depends upon the current state of the document (uncommitted/saved, posted, or committed), and the parameter`code` made in the request body. Refer to [VoidTransactionModel > code](https://developer.avalara.com/api-reference/avatax/rest/v2/models/enums/VoidTransactionModel%20%3E%20code/) for available codes. Examples are below.

Use`DocVoided` for Saved and Committed transactions:

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

Use`DocDeleted` for Saved but Uncommitted transactions:

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

[Previous](/avatax-dm-combined-erp/sales-tax-badge/transactions/cert-post-commit-tax)

[Next](/avatax-dm-combined-erp/sales-tax-badge/transactions/cert-discount-transactions)