# Customer code

Source: https://developer.avalara.com/ecommerce-integration-guide/transactions/certification-requirements/customer-code/

**Element type:** Required

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

Your integration must include a field that allows users to input the merchant-facing customer code (number, ID) that will be passed to the AvaTax service in the transaction. This can be done using the `customerCode` field in the [CreateTransactionModel](https://developer.avalara.com/api-reference/avatax/rest/v2/models/CreateTransactionModel/). Customer codes are case sensitive and unique across your company. In addition, customer codes can be a maximum of 50 characters.

Some integrations have an internal GUID as a customer identifier along with a merchant-facing or vendor facing-customer identifier. So in the UI, you might see a customer ID, but the back end contains another string that identifies that particular merchant or vendor. Because of this, the customer code should be a unique, customer-facing value that is shown to the merchant so that the merchant can easily identify their exempt customer IDs.

When a user enters a customer code in your UI, AvaTax will search for the `customerCode` value and identify any exemption records linked to this customer object. If an exemption applies to the transaction, AvaTax will record the appropriate elements of the transaction as exempt.

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

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