# Simple transactions in AvaTax

Source: https://developer.avalara.com/erp-integration-guide/transactions/simple-transactions/simple-transactions-in-avatax/

Transactions can be simple, complex, or anywhere in between. The [CreateTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/) API supports a wide variety of features and functionality that enables businesses of any size to accurately reflect their tax liability.

To understand AvaTax, it’s best to start small. Let’s look at the minimum information required to calculate a transaction and why that information is required:

-   `companyCode`: This represents the company that recorded the transaction. If you have multiple companies within your account, you need to specify the one creating this transaction.

-   `code`: Also called "Document Code," this refers to a unique reference to a transaction. For example, you would map an invoice number generated by your ERP to `code`. A `code` must be unique within each company and within each document type. (For example, you can have both a Sales Order and a Purchase Order with a document `code` of `1234`.) Be careful not to use a duplicate code. If you attempt to create two transactions with the same `code`, the same company, and the same document `type`, AvaTax will assume you want to modify the existing transaction and report an error.

-   `type`: This represents the type of the transaction. For example, AvaTax records sales as a `SalesInvoice`, which is a permanent transaction that you can report to a tax authority.

-   `date`: This specifies when the transaction took place and the AvaTax uses for tax calculation.

-   `customerCode`: This indicates the customer requesting the transaction. This feature is necessary to allow customers who have exemption certificates to be exempted from sales tax correctly. If you're creating a sales order for a customer that doesn't yet exist in your system, you can send a dummy `customerCode` because AvaTax doesn't record sales orders.

-   `addresses`: This specifies the addresses involved in the transaction.

-   `amount`: This indicates the total amount (extended) of a line item. For each of the lines in a transaction, AvaTax needs to know the total amount.

Here’s what the smallest possible transaction looks like:

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

```
{  "companyCode": "DEVGUIDE",  "code": "1001",  "type": "SalesOrder",  "date": "2024-10-15",  "customerCode": "EXAMPLECUSTOMER",  "addresses": {    "singleLocation": {      "line1": "100 Ravine Lane NE",      "city": "Bainbridge Island",      "region": "WA",      "country": "US",      "postalCode": "98110"    }  },  "lines": [    {      "amount": 100    }  ]} 
```

Now, let's understand why AvaTax requires these key fields.