# Document code

Source: https://developer.avalara.com/vat-erp/transactions/certification-requirements/document-code/

**Element type:** Required

**Endpoints/models used:** [CreateTransactionModel](https://developer.avalara.com/api-reference/avatax/rest/v2/models/CreateTransactionModel/)

Your integration must provide a way for users to enter a document `code` to tie transactions in AvaTax to the transactions in your underlying software.

**Note**:   
This field is optional for users. If users don't specify a document `code`, then AvaTax will assign one. This can make it difficult for users to reconcile systems.

Document codes must be unique within each company, within each document type. For example, it's possible to have a Sales Order and a Purchase Order with the same document `code`.

Document codes are added to your application using the `code` field in the [CreateTransactionModel](https://developer.avalara.com/api-reference/avatax/rest/v2/models/CreateTransactionModel/).

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

```
{  "type": "SalesInvoice",  "companyCode": "DEFAULT",  "date": "2024-07-16",  "code": "MyDocumentCode",  "customerCode": "ABC",  "purchaseOrderNo": "123456789",  "commit": true,  "currencyCode": "USD",  "description": "Yarn",  ...,} 
```