# When to commit

Source: https://developer.avalara.com/products/communications/integration-guides/communications-integration/mks4382772816860/

Guide: Communications

# When to commit

In the Avalara system, transactions (“line items”) can be associated with Document Codes. A Document Code (`doc`) is a unique identifier. Each Document Code has a status of committed (“true”) or uncommitted (“false”).

You can think of a Document Code’s commit status as a simple flag that determines if a transaction should appear on your compliance reports for remittance to the Department of Revenue at the end of your filing period.

Managing Document Codes in your application is critical to a successful implementation. Good Document Code management also makes the compliance reporting experience easier for your downstream users.

-   The Commit API is often used when not all calculated taxes are deemed final for compliance reporting.
-   When a transaction is deemed final, you can commit the Document Code associated with the transactions via the Commit API.
-   You can commit an entire invoice by committing the Document Code associated with that invoice rather than recalculating the taxes.
-   You don’t need to commit or uncommit transactions in real time - you only need to ensure that your Document Codes have the correct commit status _before_ reconciliation or report generation begins, usually at the end of a filing period.
-   Committed Document Codes are locked (they can’t be uncommitted) on the 1st day of the subsequent calendar month in which they’re sent. For example, if you commit a Document Code on November 15th, that Document Code will be locked on December 1st.

Note

Committing or uncommiting a Document Code affects all transactions associated with that Document Code. It’s important to use unique identifiers for Document Codes to give you the flexibility to commit and uncommit specific transactions later.

For example, let’s say you have a bill run that consists of 1,000 invoices, each with 10 line items per invoice, and you use the same Document Code for each invoice. When the bill run is complete, one of your Tax Analysts determines there’s an error in one of the invoices. Because the same Document Code was used for each invoice, you can’t simply uncommit the Document Code associated with the bad invoice and remove it from your data set. Uncommit the entire bill run, or send an adjustment for that specific invoice and send a new, corrected invoice. The Commit API makes it easy to correct mistakes like this.