# Customer code

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

# Customer code

**Element type: Required**

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

Your UI 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. Codes are case sensitive and unique across your company. In addition, codes can be a maximum of 50 characters.

Some integrations have an internal GUID as a customer identifier along with a merchant or vendor facing customer identifier. So in the UI, you might see customer ID, but on the backend, there might be another string that identifies that particular merchant. So 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 this`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.

```
{    "lines": [        {            "number": "1",            "quantity": 1,            "amount": 100,            "taxCode": "PS081282",            "itemCode": "Y0001",            "description": "Yarn"        }    ],    "addresses": {        "singleLocation": {            "line1": "2000 Main Street",            "city": "Irvine",            "region": "CA",            "country": "US",            "postalCode": "92614"        }    },    "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/cert-document-codes)

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