# Customer code

Source: https://developer.avalara.com/vat-erp/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.

When used in transactions, if the `transactiontype` is `SalesInvoice`, the transaction is deemed to be a sale to a buyer identified by the `customerCode`. In this case, use the ID of the customer for the `customerCode`. Similarly, if the `transactiontype` is `PurchaseInvoice`, the transaction is deemed to be a purchase from a vendor identified by the `customerCode`. In this case, use the vendor ID for the `customerCode`.

[![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",  ...,} 
```