# Simple transactions

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

# Simple transactions

Understand the minimum header and line information AvaTax Brazil needs to calculate tax for a simple transaction.

Transactions can be simple, complex, or anywhere in between. AvaTax Brazil supports many features and functions that help businesses of any size accurately calculate their taxes.

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

**View example**

```
{
                    "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

**View example**

```
 "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

A sequential number indicating the transaction line number

operationType

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

lineUnitPrice

Unit price of an 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