# Simple transactions

Source: https://developer.avalara.com/goods-calculation-en/transactions_model/simple_transactions/

Transactions can be very simple, very complex, or anywhere in between. AvaTax Brazil supports a wide variety of features and functionality that enables businesses of any size to accurately reflect their tax calculation.

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

## Header

[![Closed](https://avalara-devdocs-prod.mcoutput.com/goods-calculation-en/Skins/Default/Stylesheets/Images/transparent.gif)View example](javascript:void\(0\);)

```
 {                    "header": {                    "transactionDate": "2021-10-08",                    "amountCalcType": "gross",                    "documentCode": "Cenario1",                    "messageType": "goods",                    "companyLocation": "04335835000749",                    "operationType": "",                    "locations": {                     "establishment": {                       "activitySector": {                         "type": "activityLine",                         "code": "industry"                       },                       "taxesSettings": {                         "icmsTaxPayer": true                       },                       "taxRegime": "realProfit",                       "address": {                         "zipcode": "04709111"                       },                      "type": "business"                     },                     "entity": {                       "activitySector": {                       "type": "activityLine",                       "code": "retail"                       },                       "taxesSettings": {                       "icmsTaxPayer": true                       },                       "taxRegime": "estimatedProfit",                       "address": {                         "zipcode": "04710010"                       },                       "type": "business"                     }                    }                    }, 
```

Attribute

Functional description

transactionDate

Transaction date

amountCalcType

Which model calculation is used

documentCode

Code maintained by the client to uniquely identify a transaction (invoice number, sales order, receipt number, RMA) in their systems. When present, the transaction will be saved.

messageType

Specifies whether this is a service or goods transaction.

establishment

Company information

activitySector

Specifies the company activity sector according to the list shown on the Swagger.

icmsTaxPayer

Specifies whether the establishment is an ICMS taxpayer.

taxRegime

Specifies the establishment tax regime according to the list shown on the Swagger.

zipcode

Specifies the establishment zip code.

type

Specifies the establishment type according to the list shown on the Swagger.

entity

Customer/vendor information

activitySector

Specifies the entity activity sector according to the list shown on the Swagger.

icmsTaxPayer

Specifies whether the entity is an ICMS taxpayer.

taxRegime

Specifies the entity tax regime according to the list shown on the Swagger.

zipcode

Specifies the establishment zip code.

type

Specifies the entity type according to the list shown on the Swagger.

## Lines

[![Closed](https://avalara-devdocs-prod.mcoutput.com/goods-calculation-en/Skins/Default/Stylesheets/Images/transparent.gif)View example](javascript:void\(0\);)

```
  "lines": [                    {                     "lineCode": 0,                     "operationType": "standardSales",                     "lineUnitPrice": "200",                     "itemCode": 0,                     "useType": "resale",                     "numberOfItems": 1000,                     "otherCostAmount": 0,                     "freightAmount": 0,                     "insuranceAmount": 0,                     "lineTaxedDiscount": 0,                     "subjectToIPIonInbound": false,                     "itemDescriptor": {                       "hsCode": "61091000",                       "source": "0",                       "productType": "FOR PRODUCT"                     }                    }                    ]                    } 
```

Attribute

Functional description

lineCode

Sequential number indicating the transaction line number

operationType

Inform what is the operation type for this transaction (Sale, Purchase, Transfer)

lineUnitPrice

Unite price of item

itemCode

Item code used to identify the item inside the system source

numberOfItems

Numbers the item

hsCode

NCM code

source

Inform the origin of this item

productType

Fiscal product type according to SPED list table