# Document code

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

# 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.

**Advice:** This field is optional for users. If you do not specify a document code, then AvaTax will assign one. This can make it difficult for you to reconcile systems.

Document codes must be unique within each company, within each doc`type`. (For example, it is possible to have a Sales Order and a Purchase Order with the same doc`code`.)

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

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

[Previous](/avatax-dm-combined-erp/sales-tax-badge/transactions/refunds-with-create-transactions)

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