# Entity use codes

Source: https://developer.avalara.com/marketplace-integration-guide/transactions/exemptions/entity-use-codes/

In AvaTax transactions, the `entityUseCode` field indicates the exempt reason for exempt customers. For example, if the US federal government makes a purchase designated for government use, that purchase would be, in most cases, exempt or nontaxable for that specific use.

You can specify [entity use codes](https://knowledge.avalara.com/bundle/dqa1657870670369_dqa1657870670369/page/Exempt_reason_matrix_for_the_U.S._and_Canada_entity_use_code_list.html) at the document level or the line level. When entering transactions with an entity use code, AvaTax will exempt the transaction as long as the code is valid for the customer and the region where the transaction takes place.

In your CRM component, include a field that can identify an exempt customer. Then, when a customer is identified by one of the entity use code exempt reasons, and that customer makes a purchase, include that reason in the [CreateTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/models/CreateTransactionModel/) model.

Display entity use codes in your UI as a dropdown, combo box, or selection element. This element uses the [ListEntityUseCodes API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListEntityUseCodes/) to retrieve the list of available choices to display. Also allow for a default value of NULL, which indicates that, by default, a transaction doesn’t have a custom entity use code.

Here’s how to find the values and put them into your transaction. First, call the [ListEntityUseCodes API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListEntityUseCodes/). The `code` field is the value that you'll use, and the field `name` is the description to display to the customer. You can either show "code - name" like "A - FEDERAL GOV," or you can just show the name field.

[![Closed](https://avalara-devdocs-prod.mcoutput.com/avatax-for-marketplaces/Content/Skins/Default/Stylesheets/Images/transparent.gif)Example](javascript:void\(0\);)

```
 {                        "@recordsetCount": 17,                        "value": [                        {                        "code": "A",                        "name": "FEDERAL GOV",                        "description": "",                        "validCountries": [                        "US"                        ]                        },                        {                        "code": "B",                        "name": "STATE GOV",                        "decription": "",                        "validCountries": [                        "US"                        ]                        },                        ]                    } 
```

If an exempt customer makes a purchase, put that value in the `entityUseCode` field on the [CreateTransactionModel](https://developer.avalara.com/api-reference/avatax/rest/v2/models/CreateTransactionModel/) element:

[![Closed](https://avalara-devdocs-prod.mcoutput.com/avatax-for-marketplaces/Content/Skins/Default/Stylesheets/Images/transparent.gif)Example](javascript:void\(0\);)

```
{                        "type": "SalesInvoice",                        "companyCode": "DEFAULT",                        "date": "2024-07-16",                        ...                        "entityUseCode": "A",                        ...                    }
```

If the customer isn't exempt, omit the `entityUseCode` element entirely, or set its value to NULL.