# Compreendendo uma transação simples

Source: https://developer.avalara.com/services-calculation-pt/transacoes/transacoes_simples/

# Compreendendo uma transação simples

As transações podem ser muito simples, muito complexas ou qualquer coisa no meio entre simples e complexas. _AvaTax Brasil_ oferece suporte a uma ampla variedade de recursos e funcionalidades que permitem que empresas de qualquer tamanho reflitam com precisão seus cálculos de impostos.

Para entender _AvaTax_, é melhor começar devagar - então, vamos examinar as informações mínimas necessárias para calcular uma transação e por que essas informações são necessárias:

#### Header

```
{"header": {"messageType": "services","transactionDate": "2021-05-26","amountCalcType": "gross","documentCode": "SampleCashMode","companyLocation": "14528925000114","operationType": "Sale","locations": {"establishment": {"activitySector": {"type": "activityLine","code": "service"},"taxesSettings": {"issRfRate": "","pCredSN": 0,"subjectToPayrollTaxRelief": true,"subjectWithholdingIss": true,"subjectWithholdingPis": true,"subjectWithholdingCofins": true,"subjectWithholdingCsll": true,"cofinsSubjectTo": "T","pisSubjectTo": "T","csllSubjectTo": "T"},"taxRegime": "realProfit","type": "business","address": {"neighborhood": "Centro","zipcode": "20020-030","cityName": "Rio de Janeiro"}},"entity": {"activitySector": {"type": "activityLine","code": "publicAgency"},"taxesSettings": {"issRfRate": "","pCredSN": 0,"subjectToPayrollTaxRelief": true,"subjectWithholdingIss": true,"subjectWithholdingPis": true,"subjectWithholdingCofins": true,"subjectWithholdingCsll": true,"cofinsSubjectTo": "T","pisSubjectTo": "T","csllSubjectTo": "T"},"taxRegime": "realProfit","type": "federalGovernment","address": {"neighborhood": "Centro","zipcode": "20020-030","cityName": "Rio de Janeiro"}},"rendered": {"address": {"neighborhood": "Centro","zipcode": "20020-030","cityName": "Rio de Janeiro"}}},"payment": {"installmentTerms": 0,"bill": {"nFat": "123456789","vOrig": 10000,"vDiscount": 0,"vNet": 10000}},"additionalInfo": {"complementaryInfo": "Marketing and publicity services to TV"}},
```

**Attribute**

**Functional Description**

transactionDate

Transaction date 

amountCalcType

Which model calculation will be used

documentCode

CODE MAINTAINED BY THE CLIENT TO UNIQUELY IDENTIFY A TRANSACTION (INVOICE NUMBER, SALES ORDER, RECEIPT NUMBER, RMA) IN THE THEIR SYSTEMS. WHEN PRESENT, THE TRANSACTION WILL BE SAVED.

messageType

INFORM IF IT´S A SERVICE OR GOOD TRANSACTION

establishment

Company information

activitySector

Inform the company activity sector according to the list shown on the swagger

taxesSettings

In this object, details related to the establishment's taxation characteristics must be informed.

taxRegime

Inform the establishment tax regime according to the list shown on the swagger

zipcode

Inform the establishment zip code

type

Establishment type according to the list shown on the swagger

entity

CUSTOMER/VENDOR INFORMATION

activitySector

Inform the entity activity sector according to the list shown on the swagger

taxesSettings

In this object, details related to the establishment's taxation characteristics must be informed, if available.

taxRegime

Inform the entity tax regime according to the list shown on the swagger

zipcode

Inform the establishment zip code

type

Entity type according to the list shown on the swagger

rendered

The address where the service will be performed must be informed in this object

payment

Designated object for information related to payment for this service. It can be on cash or in installments.

complementaryInfo

Designated field for additional or relevant information that needs to be provided.

#### Lines

```
"lines": [{"lineCode": 1,"itemCode": 1,"numberOfItems": 1,"lineAmount": 10000,"lineUnitPrice": 10000,"itemDescriptor": {"hsCode": "10.08","serviceCode": "100801","serviceCodeOrigin": "100801"},"services": {"hasCpom": false,"withLaborAssignment": false}}]}
```

**Attribute**

**Functional Description**

lineCode

Sequential number indicating the transaction line number.

itemCode

Item code used to identify the item inside the system source.

numberOfItems

Numbers the item

lineAmount

Total line amount

lineUnitPrice

Unite price of the item

hsCode

Service code number according to LC116 (Brazilian Legislation).

serviceCode

City service code where the service will be executed

serviceCodeOrigin

Service code of the city where the company that will provide the service is registered.

hasCpom

Indicator if there is a CEPOM ID

withLaborAssignment

Indicator of the services that will be provided has a labor assignment.

[Anterior](/for-review-only/en/leila-paul/services-calculation-pt/transacoes)

[Próxima](/for-review-only/en/leila-paul/services-calculation-pt/transacoes/vendas)