# Document codes

Source: https://developer.avalara.com/vat-ecom/transactions/simple-transactions/document-codes/

For connector developers, the `code` value ties transactions in AvaTax to the transactions in your underlying software. For example, you can use the ID field of your sale as it is known in your accounting system, such as an invoice number generated by your ERP. This would be mapped to the AvaTax code. These code values must be unique within each company and within each document type. (For example, you can have both a `SalesOrder` and a `PurchaseOrder` with a doc `code` of `1234`.) Be careful not to use a duplicate code. AvaTax will return an error if you attempt to create two transactions with the same code for the same company and document type.

After you create the transaction, use this `code` value to identify it when calling [CommitTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CommitTransaction/), [AdjustTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/AdjustTransaction/), or [VoidTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/VoidTransaction/). Whatever value you provide, make sure to store it or link to it.

**Advice:**  

If you don't specify a document `code`, then AvaTax will assign one. This can make it difficult for you to reconcile your systems.