# Document codes

Source: https://developer.avalara.com/avatax-dm-combined-erp/sales-tax-badge/transactions/simple-transactions/document-codes/

# 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 doc `type`. (For example, you can have both a Sales Order and a Purchase Order with a doc `code` of 1234.) Be careful not to use a duplicate code. AvaTax will report an error if you attempt to create two transactions with the same `code` for the same company and document `type`.

After you have created the transaction, you will 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 do not specify a document code, then AvaTax will assign one. This can make it difficult for you to reconcile systems.

[Previous](/avatax-dm-combined-erp/sales-tax-badge/transactions/simple-transactions/customer-codes)

[Next](/avatax-dm-combined-erp/sales-tax-badge/transactions/simple-transactions/document-dates)