# Purchase transactions

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

This section provides all mandatory purchase transactions to get the goods calculations badge.

**Advice:** The "taxCode" attribute may be necessary to resolve an ambiguity, as explained in the Calculation Rules section, according to the chosen NCM code and the applicability of Brazilian legislation.

## Import goods

Country From

CNH

State To

SP

hsCode

83011000

### Payload request

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

```
 {                    "header":                    {                    "transactionDate":"2021-02-21T10:52:45Z",                    "amountCalcType":"net",                    "documentCode":"0050569BC86C1ED",                    "goods":                    {                    "model":"55"                    },                    "messageType":"goods",                    "eDocCreatorType":"self",                    "eDocCreatorPerspective":true,                    "companyLocation":"123456789",                    "locations":                    {                    "establishment":                    {                    "activitySector":                    {                    "type":"activityLine",                    "code":"importer"                    },                    "taxesSettings":                    {                    "icmsTaxPayer":true,                    "pCredSN":0,                    "subjectToPayrollTaxRelief":true,                    "subjectWithholdingIss":true                    },                    "taxRegime":"realProfit",                    "entityType":"business",                    "stateTaxId":"",                    "type":"business",                    "address":                    {                    "zipcode":"04561-004",                    "state":"SP",                    "country":"BRA"                    },                    "federalTaxId":""                    },                    "entity":                    {                    "activitySector":                    {                    "type":"activityLine",                    "code":"industry"                    },                    "taxesSettings":                    {                    "icmsTaxPayer":true,                    "pCredSN":0,                    "subjectToPayrollTaxRelief":true,                    "subjectWithholdingIss":true                    },                    "taxRegime":"notApplicable",                    "address":                    {                    "country":"CHN"                    }                    }                    }                    },                    "lines":                    [                    {                    "id":"000010",                    "lineCode":"1",                    "operationType":"standardPurchase",                    "lineAmount":10.00,                    "useType":"notApplicable",                    "numberOfItems":1,                    "otherCostAmount":0.00,                    "freightAmount":0.00,                    "insuranceAmount":0.00,                    "lineTaxedDiscount":0.00,                    "itemDescriptor":                    {                    "hsCode":"83011000",                    "source":"8",                    "productType":"FOR MERCHANDISE",                    "manufacturerEquivalent":false,                    "appropriateIPIcreditWhenInGoing":false,                    "appropriateICMScreditWhenInGoing":false,                    "usuallyAppropriatePISCOFINSCredit":false,                    "isPisCofinsEstimatedCredit":false,                    "piscofinsRevenueType":"01",                    "unitIPIfactor":1,                    "unitIcmsfactor":1,                    "unitIcmsStfactor":1,                    "unitPisCofinsfactor":1,                    "comexTaxUnitFactor":1                    },                    "goods":                    {                    "subjectToIPIonInbound":false                    }                    }                    ]                    } 
```

### Payload response

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

```
 {                    "header": {                       "transactionDate": "2021-02-21T10:52:45Z",                       "amountCalcType": "net",                       "documentCode": "0050569BC86C1ED",                       "goods": {                           "model": "55",                           "idDest": 0,                           "tpEmis": "1",                           "class": "Compras para comercialização",                           "tpImp": "1"                       },                       "messageType": "goods",                       "eDocCreatorType": "self",                       "eDocCreatorPerspective": true,                       "companyLocation": "123456789",                       "locations": {                           "establishment": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "importer"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false                               },                               "taxRegime": "realProfit",                               "entityType": "business",                               "stateTaxId": "",                               "type": "business",                               "address": {                                   "zipcode": "04561-004",                                   "state": "SP",                                   "country": "BRA",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "cityName": "São Paulo"                               },                               "federalTaxId": ""                           },                           "entity": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "industry"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false                               },                               "taxRegime": "notApplicable",                               "address": {                                   "country": "CHN",                                   "cityCode": 0,                                   "countryCode": "0",                                   "state": ""                               },                               "federalTaxId": ""                           }                       },                       "accountId": "bdf71245-1288-4883-95a5-3a7530ea31af",                       "subscriptionId": "9fe9c37a-1da8-4b8e-9d1b-21207b21e9f9",                       "additionalInfo": {                           "complementaryInfo": "II Resolução CAMEX nº 125/2016, Artigo 1º, Anexo I\nIPI com alíquota zero conforme: \"Decreto nº 8950/2016\"\nPIS/COFINSIMPORT_ Lei nº 10.865/2004, Artigo 8º, inciso I, alínea a, alterada Lei nº 13.137/2015, Artigo 1º\nPIS/COFINSIMPORT_ Lei nº 10.865/2004, Artigo 8º, inciso I, alínea b, alterada Lei nº 13.137/2015, Artigo 1º\nICMS/SP_Decreto nº 45.490/2000, Artigo 52, Inciso I"                       }                    },                    "lines": [                       {                           "id": "000010",                           "lineCode": 1,                           "operationType": "standardPurchase",                           "lineAmount": 11.33,                           "useType": "notApplicable",                           "numberOfItems": 1,                           "otherCostAmount": 0,                           "freightAmount": 0,                           "insuranceAmount": 0,                           "lineTaxedDiscount": 0,                           "itemDescriptor": {                               "hsCode": "83011000",                               "source": "8",                               "productType": "FOR MERCHANDISE",                               "manufacturerEquivalent": false,                               "appropriateIPIcreditWhenInGoing": false,                               "appropriateICMScreditWhenInGoing": false,                               "usuallyAppropriatePISCOFINSCredit": false,                               "isPisCofinsEstimatedCredit": false,                               "piscofinsRevenueType": "01",                               "unitIPIfactor": 1,                               "unitIcmsfactor": 1,                               "unitIcmsStfactor": 1,                               "unitPisCofinsfactor": 1,                               "comexTaxUnitFactor": 1                           },                           "goods": {                               "subjectToIPIonInbound": false,                               "indTotType": true,                               "entityIcmsStSubstitute": "yes"                           },                           "overwrite": "no",                           "lineNetFigure": 10,                           "lineUnitPrice": 11.33,                           "taxDetails": [                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Add",                                       "impactOnNetAmount": "Add",                                       "accounting": "none"                                   },                                   "taxType": "cofins",                                   "citation": "PIS/COFINSIMPORT_ Lei nº 10.865/2004, Artigo 8º, inciso I, alínea b, alterada Lei nº 13.137/2015, Artigo 1º",                                   "citationId": "715f81e4-5c57-43cc-9b30-e42ae8c3cb2a",                                   "subtotalTaxable": 11.33,                                   "rate": 9.65,                                   "tax": 1.09,                                   "exemptionCode": "",                                   "cst": "70",                                   "calcMode": "rate",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "",                                   "jurisdictionType": "State",                                   "taxImpact": {                                       "impactOnFinalPrice": "Add",                                       "impactOnNetAmount": "Add",                                       "accounting": "none"                                   },                                   "taxType": "icms",                                   "citation": "ICMS/SP_Decreto nº 45.490/2000, Artigo 52, Inciso I",                                   "citationId": "65ee6515-b34c-4cf2-b569-c693b601569f",                                   "subtotalTaxable": 17.65,                                   "rate": 18,                                   "tax": 3.18,                                   "exemptionCode": "",                                   "source": "8",                                   "cst": "00",                                   "modBC": "3",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Add",                                       "impactOnNetAmount": "Add",                                       "accounting": "liability"                                   },                                   "taxType": "ii",                                   "citation": "II Resolução CAMEX nº 125/2016, Artigo 1º, Anexo I",                                   "citationId": "a007e4ec-66f1-4be3-84d0-479fbaf39f5d",                                   "subtotalTaxable": 11.33,                                   "rate": 16,                                   "tax": 1.81,                                   "exemptionCode": "",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Add",                                       "impactOnNetAmount": "Add",                                       "accounting": "liability"                                   },                                   "taxType": "iof",                                   "subtotalTaxable": 0,                                   "rate": 0,                                   "tax": 0,                                   "exemptionCode": ""                               },                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Informative",                                       "impactOnNetAmount": "Informative",                                       "accounting": "none"                                   },                                   "taxType": "ipi",                                   "citation": "IPI com alíquota zero conforme: \"Decreto nº 8950/2016\"",                                   "citationId": "18384774-ed65-4180-8f05-e822b155d99c",                                   "subtotalTaxable": 13.14,                                   "rate": 0,                                   "tax": 0,                                   "exemptionCode": "",                                   "cst": "01",                                   "legalTaxClass": 999,                                   "calcMode": "rate",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Add",                                       "impactOnNetAmount": "Add",                                       "accounting": "none"                                   },                                   "taxType": "pis",                                   "citation": "PIS/COFINSIMPORT_ Lei nº 10.865/2004, Artigo 8º, inciso I, alínea a, alterada Lei nº 13.137/2015, Artigo 1º",                                   "citationId": "71cc40d4-b6d0-48b1-804e-f311c091baa4",                                   "subtotalTaxable": 11.33,                                   "rate": 2.1,                                   "tax": 0.24,                                   "exemptionCode": "",                                   "cst": "70",                                   "calcMode": "rate",                                   "isCustomCitation": false                               }                           ],                           "cfop": 3102,                           "lineNetUnitPrice": 10,                           "lineAdditionalInfo": ""                       }                    ],                    "version": "3",                    "processingInfo": {                       "versionId": "21.3.5-rc.1",                       "duration": "16.624"                    },                    "summary": {                       "numberOfLines": 1,                       "totalLineAmounts": 11.33,                       "totalTaxedDiscounts": 0,                       "totalUntaxedDiscounts": 0,                       "totalInsurances": 0,                       "totalFreights": 0,                       "totalOtherCosts": 0,                       "totalUnTaxedOtherCosts": 0,                       "totalInvoice": 17.65,                       "taxByType": {                           "cofins": {                               "tax": 1.09,                               "subtotalTaxable": 11.33,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 1.09                                   }                               ]                           },                           "icms": {                               "tax": 3.18,                               "subtotalTaxable": 17.65,                               "jurisdictions": [                                   {                                       "jurisdictionName": "",                                       "jurisdictionType": "State",                                       "tax": 3.18                                   }                               ]                           },                           "ii": {                               "tax": 1.81,                               "subtotalTaxable": 11.33,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 1.81                                   }                               ]                           },                           "iof": {                               "tax": 0,                               "subtotalTaxable": 0,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 0                                   }                               ]                           },                           "ipi": {                               "tax": 0,                               "subtotalTaxable": 13.14,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 0                                   }                               ]                           },                           "pis": {                               "tax": 0.24,                               "subtotalTaxable": 11.33,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 0.24                                   }                               ]                           }                       }                    },                    "input": {                       "header": {                           "transactionDate": "2021-02-21T10:52:45Z",                           "amountCalcType": "net",                           "documentCode": "0050569BC86C1ED",                           "goods": {                               "model": "55",                               "idDest": 0,                               "tpEmis": "1"                           },                           "messageType": "goods",                           "eDocCreatorType": "self",                           "eDocCreatorPerspective": true,                           "companyLocation": "123456789",                           "locations": {                               "establishment": {                                   "activitySector": {                                       "type": "activityLine",                                       "code": "importer"                                   },                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "pCredSN": 0,                                       "subjectToPayrollTaxRelief": true,                                       "subjectWithholdingIss": true,                                       "enableCprb": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false                                   },                                   "taxRegime": "realProfit",                                   "entityType": "business",                                   "stateTaxId": "",                                   "type": "business",                                   "address": {                                       "zipcode": "04561-004",                                       "state": "SP",                                       "country": "BRA",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "cityName": "São Paulo"                                   },                                   "federalTaxId": ""                               },                               "entity": {                                   "activitySector": {                                       "type": "activityLine",                                       "code": "industry"                                   },                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "pCredSN": 0,                                       "subjectToPayrollTaxRelief": true,                                       "subjectWithholdingIss": true,                                       "enableCprb": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false                                   },                                   "taxRegime": "notApplicable",                                   "address": {                                       "country": "CHN",                                       "cityCode": 0,                                       "countryCode": "0",                                       "state": ""                                   },                                   "federalTaxId": ""                               }                           },                           "accountId": "",                           "subscriptionId": ""                       },                       "lines": [                           {                               "id": "000010",                               "lineCode": 1,                               "operationType": "standardPurchase",                               "lineAmount": 10,                               "useType": "notApplicable",                               "numberOfItems": 1,                               "otherCostAmount": 0,                               "freightAmount": 0,                               "insuranceAmount": 0,                               "lineTaxedDiscount": 0,                               "itemDescriptor": {                                   "hsCode": "83011000",                                   "source": "8",                                   "productType": "FOR MERCHANDISE",                                   "manufacturerEquivalent": false,                                   "appropriateIPIcreditWhenInGoing": false,                                   "appropriateICMScreditWhenInGoing": false,                                   "usuallyAppropriatePISCOFINSCredit": false,                                   "isPisCofinsEstimatedCredit": false,                                   "piscofinsRevenueType": "01",                                   "unitIPIfactor": 1,                                   "unitIcmsfactor": 1,                                   "unitIcmsStfactor": 1,                                   "unitPisCofinsfactor": 1,                                   "comexTaxUnitFactor": 1                               },                               "goods": {                                   "subjectToIPIonInbound": false,                                   "indTotType": true,                                   "entityIcmsStSubstitute": "default"                               },                               "overwrite": "no"                           }                       ],                       "version": "3"                    }                    } 
```

## Transport purchase

State From

SP

State To

SP

hsCode

00000000

### Payload request

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

```
 {                    "header":                    {                    "locations":                    {                    "entity":                    {                    "type":"business",                    "federalTaxId":"",                    "taxRegime":"realProfit",                    "taxesSettings":                    {                    "icmsTaxPayer":"true",                    "subjectToPayrollTaxRelief":"false",                    "cofinsSubjectTo":"T",                    "csllSubjectTo":"T",                    "pisSubjectTo":"T",                    "receiptsAreFullNoCumulativePisCofins":"false",                    "usesInssCprbToGrossValue":"false",                    "pisCofinsIcmsTaxRelief":"false"                    },                    "address":                    {                    "zipcode":"01452-000",                    "state":"SP",                    "country":"BRA"                    },                    "activitySector":                    {                    "type":"activityLine",                    "code":"transporter"                    }                    },                    "establishment":                    {                    "type":"business",                    "federalTaxId":"",                    "stateTaxId":"",                    "taxRegime":"realProfit",                    "taxesSettings":                    {                    "icmsTaxPayer":"true",                    "subjectToPayrollTaxRelief":"false",                    "cofinsSubjectTo":"T",                    "csllSubjectTo":"T",                    "pisSubjectTo":"T",                    "receiptsAreFullNoCumulativePisCofins":"false",                    "enableInssCprb":"false",                    "usesInssCprbToGrossValue":"false",                    "pisCofinsIcmsTaxRelief":"false"                    },                    "address":                    {                    "zipcode":"04561-004",                    "state":"SP",                    "country":"BRA"                    },                    "activitySector":                    {                    "type":"activityLine",                    "code":"industry"                    }                    },                    "delivery":                    {                    "type":"business",                    "federalTaxId":"",                    "taxRegime":"realProfit",                    "address":                    {                    "zipcode":"01452-000",                    "state":"SP",                    "country":"BRA"                    }                    },                    "pickup":                    {                    "federalTaxId":"",                    "stateTaxId":"",                    "taxRegime":"realProfit",                    "address":                    {                    "zipcode":"04561-004",                    "state":"SP",                    "country":"BRA"                    }                    }                    },                    "eDocCreatorType":"self",                    "eDocCreatorPerspective":"true",                    "operationType":"standardPurchase",                    "amountCalcType":"net",                    "companyLocation":"Teste",                    "transactionDate":"2021-02-21T11:03:12Z",                    "messageType":"goods",                    "documentCode":"0050569",                    "invoicesRefs":                    [                    {                    "type":"documentCode"                    }                    ],                    "shippingDate":"2021-02-21T11:03:12Z",                    "goods":                    {                    "model":"57"                    }                    },                    "lines":                    [                    {                    "lineCode":"1",                    "itemCode":"BR-AS110",                    "itemDescriptor":                    {                    "hsCode":"00000000",                    "isIcmsStSubstitute":"false",                    "productType":"SERVICE",                    "appropriateIPIcreditWhenInGoing":"false",                    "appropriateICMScreditWhenInGoing":"true",                    "appropriatePISCOFINScreditWhenInGoing":"true",                    "isPisCofinsEstimatedCredit":"true",                    "unitIPIfactor":"1",                    "unitIcmsfactor":"1",                    "unitIcmsStfactor":"1",                    "unitPisCofinsfactor":"1",                    "comexTaxUnitFactor":"1"                    },                    "numberOfItems":"1",                    "lineAmount":"1000.00 ",                    "useType":"use or consumption",                    "operationType":"standardPurchase",                    "overwrite":"no",                    "freightAmount":"0.00 ",                    "insuranceAmount":"0.00 ",                    "otherCostAmount":"0.00 ",                    "goods":                    {                    "returnedPercentageAmount":"0"                    }                    }                    ]                    } 
```

### Payload response

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

```
 {                    "header": {                       "locations": {                           "entity": {                               "type": "business",                               "federalTaxId": "",                               "taxRegime": "realProfit",                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "subjectToPayrollTaxRelief": false,                                   "cofinsSubjectTo": "T",                                   "csllSubjectTo": "T",                                   "pisSubjectTo": "T",                                   "receiptsAreFullNoCumulativePisCofins": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false,                                   "enableCprb": false                               },                               "address": {                                   "zipcode": "01452-000",                                   "state": "SP",                                   "country": "BRA",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "cityName": "São Paulo"                               },                               "activitySector": {                                   "type": "activityLine",                                   "code": "transporter"                               }                           },                           "establishment": {                               "type": "business",                               "federalTaxId": "",                               "stateTaxId": "",                               "taxRegime": "realProfit",                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "subjectToPayrollTaxRelief": false,                                   "cofinsSubjectTo": "T",                                   "csllSubjectTo": "T",                                   "pisSubjectTo": "T",                                   "receiptsAreFullNoCumulativePisCofins": false,                                   "enableInssCprb": "false",                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false,                                   "enableCprb": false                               },                               "address": {                                   "zipcode": "04561-004",                                   "state": "SP",                                   "country": "BRA",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "cityName": "São Paulo"                               },                               "activitySector": {                                   "type": "activityLine",                                   "code": "industry"                               }                           },                           "delivery": {                               "type": "business",                               "federalTaxId": "",                               "taxRegime": "realProfit",                               "address": {                                   "zipcode": "01452-000",                                   "state": "SP",                                   "country": "BRA",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "cityName": "São Paulo"                               }                           },                           "pickup": {                               "federalTaxId": "",                               "stateTaxId": "",                               "taxRegime": "realProfit",                               "address": {                                   "zipcode": "04561-004",                                   "state": "SP",                                   "country": "BRA",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "cityName": "São Paulo"                               }                           }                       },                       "eDocCreatorType": "self",                       "eDocCreatorPerspective": true,                       "operationType": "standardPurchase",                       "amountCalcType": "net",                       "companyLocation": "Teste",                       "transactionDate": "2021-02-21T11:03:12Z",                       "messageType": "goods",                       "documentCode": "0050569",                       "invoicesRefs": [                           {                               "type": "documentCode"                           }                       ],                       "shippingDate": "2021-02-21T11:03:12Z",                       "goods": {                           "model": "57",                           "idDest": 0,                           "tpEmis": "1",                           "class": "Aquisição de serviço de transporte por estabelecimento comercial",                           "tpImp": "1"                       },                       "accountId": "",                       "subscriptionId": "",                       "additionalInfo": {                           "complementaryInfo": "PIS/COFINS Lei nº 10.637/2002, Artigo 2º_Serviço de Transporte\nPIS/COFINS Lei nº 10.833/2003, Artigo 2º_Serviço de Transporte\nICMS/SP_Decreto nº 45.490/2000, Artigo 54, Inciso I"                       }                    },                    "lines": [                       {                           "lineCode": 1,                           "itemCode": "BR-AS110",                           "itemDescriptor": {                               "hsCode": "00000000",                               "isIcmsStSubstitute": false,                               "productType": "SERVICE",                               "appropriateIPIcreditWhenInGoing": false,                               "appropriateICMScreditWhenInGoing": true,                               "appropriatePISCOFINScreditWhenInGoing": true,                               "isPisCofinsEstimatedCredit": true,                               "unitIPIfactor": 1,                               "unitIcmsfactor": 1,                               "unitIcmsStfactor": 1,                               "unitPisCofinsfactor": 1,                               "comexTaxUnitFactor": 1,                               "description": "BR-AS110"                           },                           "numberOfItems": 1,                           "lineAmount": 1269.84,                           "useType": "use or consumption",                           "operationType": "standardPurchase",                           "overwrite": "no",                           "freightAmount": 0,                           "insuranceAmount": 0,                           "otherCostAmount": 0,                           "goods": {                               "returnedPercentageAmount": 0,                               "indTotType": true,                               "entityIcmsStSubstitute": "no",                               "subjectToIPIonInbound": false                           },                           "lineNetFigure": 1000,                           "lineUnitPrice": 1269.84,                           "taxDetails": [                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "cofins",                                   "citation": "PIS/COFINS Lei nº 10.833/2003, Artigo 2º_Serviço de Transporte",                                   "citationId": "bb075ada-9e37-4765-83ff-c31ed672fae4",                                   "subtotalTaxable": 1269.84,                                   "rate": 7.6,                                   "tax": 96.51,                                   "exemptionCode": "",                                   "cst": "70",                                   "calcMode": "rate",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "São Paulo",                                   "jurisdictionType": "State",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "asset"                                   },                                   "taxType": "icms",                                   "citation": "ICMS/SP_Decreto nº 45.490/2000, Artigo 54, Inciso I",                                   "citationId": "fd026966-0477-47f8-b292-e7ed5adebffc",                                   "subtotalTaxable": 1269.84,                                   "rate": 12,                                   "tax": 152.38,                                   "exemptionCode": "",                                   "source": "0",                                   "cst": "00",                                   "modBC": "3",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "pis",                                   "citation": "PIS/COFINS Lei nº 10.637/2002, Artigo 2º_Serviço de Transporte",                                   "citationId": "13921210-1cb5-44a9-8705-462b23c0d4e3",                                   "subtotalTaxable": 1269.84,                                   "rate": 1.65,                                   "tax": 20.95,                                   "exemptionCode": "",                                   "cst": "70",                                   "calcMode": "rate",                                   "isCustomCitation": false                               }                           ],                           "cfop": 1353,                           "lineNetUnitPrice": 1000,                           "lineAdditionalInfo": ""                       }                    ],                    "version": "3",                    "processingInfo": {                       "versionId": "21.3.5-rc.1",                       "duration": "16.999"                    },                    "summary": {                       "numberOfLines": 1,                       "totalLineAmounts": 1269.84,                       "totalTaxedDiscounts": 0,                       "totalUntaxedDiscounts": 0,                       "totalInsurances": 0,                       "totalFreights": 0,                       "totalOtherCosts": 0,                       "totalUnTaxedOtherCosts": 0,                       "totalInvoice": 1269.84,                       "taxByType": {                           "cofins": {                               "tax": 96.51,                               "subtotalTaxable": 1269.84,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 96.51                                   }                               ]                           },                           "icms": {                               "tax": 152.38,                               "subtotalTaxable": 1269.84,                               "jurisdictions": [                                   {                                       "jurisdictionName": "São Paulo",                                       "jurisdictionType": "State",                                       "tax": 152.38                                   }                               ]                           },                           "pis": {                               "tax": 20.95,                               "subtotalTaxable": 1269.84,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 20.95                                   }                               ]                           }                       }                    },                    "input": {                       "header": {                           "locations": {                               "entity": {                                   "type": "business",                                   "federalTaxId": "",                                   "taxRegime": "realProfit",                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "subjectToPayrollTaxRelief": false,                                       "cofinsSubjectTo": "T",                                       "csllSubjectTo": "T",                                       "pisSubjectTo": "T",                                       "receiptsAreFullNoCumulativePisCofins": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false,                                       "enableCprb": false                                   },                                   "address": {                                       "zipcode": "01452-000",                                       "state": "SP",                                       "country": "BRA",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "cityName": "São Paulo"                                   },                                   "activitySector": {                                       "type": "activityLine",                                       "code": "transporter"                                   }                               },                               "establishment": {                                   "type": "business",                                   "federalTaxId": "",                                   "stateTaxId": "",                                   "taxRegime": "realProfit",                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "subjectToPayrollTaxRelief": false,                                       "cofinsSubjectTo": "T",                                       "csllSubjectTo": "T",                                       "pisSubjectTo": "T",                                       "receiptsAreFullNoCumulativePisCofins": false,                                       "enableInssCprb": "false",                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false,                                       "enableCprb": false                                   },                                   "address": {                                       "zipcode": "04561-004",                                       "state": "SP",                                       "country": "BRA",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "cityName": "São Paulo"                                   },                                   "activitySector": {                                       "type": "activityLine",                                       "code": "industry"                                   }                               },                               "delivery": {                                   "type": "business",                                   "federalTaxId": "",                                   "taxRegime": "realProfit",                                   "address": {                                       "zipcode": "01452-000",                                       "state": "SP",                                       "country": "BRA",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "cityName": "São Paulo"                                   }                               },                               "pickup": {                                   "federalTaxId": "",                                   "stateTaxId": "",                                   "taxRegime": "realProfit",                                   "address": {                                       "zipcode": "04561-004",                                       "state": "SP",                                       "country": "BRA",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "cityName": "São Paulo"                                   }                               }                           },                           "eDocCreatorType": "self",                           "eDocCreatorPerspective": true,                           "operationType": "standardPurchase",                           "amountCalcType": "net",                           "companyLocation": "Teste",                           "transactionDate": "2021-02-21T11:03:12Z",                           "messageType": "goods",                           "documentCode": "0050569",                           "invoicesRefs": [                               {                                   "type": "documentCode"                               }                           ],                           "shippingDate": "2021-02-21T11:03:12Z",                           "goods": {                               "model": "57",                               "idDest": 0,                               "tpEmis": "1"                           },                           "accountId": ",                           "subscriptionId": ""                       },                       "lines": [                           {                               "lineCode": 1,                               "itemCode": "BR-AS110",                               "itemDescriptor": {                                   "hsCode": "00000000",                                   "isIcmsStSubstitute": false,                                   "productType": "SERVICE",                                   "appropriateIPIcreditWhenInGoing": false,                                   "appropriateICMScreditWhenInGoing": true,                                   "appropriatePISCOFINScreditWhenInGoing": true,                                   "isPisCofinsEstimatedCredit": true,                                   "unitIPIfactor": 1,                                   "unitIcmsfactor": 1,                                   "unitIcmsStfactor": 1,                                   "unitPisCofinsfactor": 1,                                   "comexTaxUnitFactor": 1                               },                               "numberOfItems": 1,                               "lineAmount": 1000,                               "useType": "use or consumption",                               "operationType": "standardPurchase",                               "overwrite": "no",                               "freightAmount": 0,                               "insuranceAmount": 0,                               "otherCostAmount": 0,                               "goods": {                                   "returnedPercentageAmount": 0,                                   "indTotType": true,                                   "entityIcmsStSubstitute": "default"                               }                           }                       ],                       "version": "3"                    }                    } 
```

## Interstate purchase

State From

SP

State To

ES

hsCode

33030010

### Payload request

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

```
 {                    "header":                    {                    "transactionDate":"2021-02-23T18:08:52Z",                    "amountCalcType":"net",                    "documentCode":"0050569BC86C1EDB9DC582F6C593F2B1",                    "goods":                    {                    "model":"55"                    },                    "messageType":"goods",                    "eDocCreatorType":"self",                    "eDocCreatorPerspective":true,                    "companyLocation":"12345678",                    "locations":                    {                    "establishment":                    {                    "activitySector":                    {                    "type":"activityLine",                    "code":"wholesle"                    },                    "taxesSettings":                    {                    "icmsTaxPayer":true,                    "pCredSN":0,                    "subjectToPayrollTaxRelief":true,                    "subjectWithholdingIss":true                    },                    "taxRegime":"realProfit",                    "entityType":"business",                    "stateTaxId":"",                    "type":"business",                    "address":                    {                    "zipcode":"04561-004",                    "state":"SP",                    "country":"BRA"                    },                    "federalTaxId":""                    },                    "entity":                    {                    "activitySector":                    {                    "type":"activityLine",                    "code":"industry"                    },                    "taxesSettings":                    {                    "icmsTaxPayer":true,                    "pCredSN":0,                    "subjectToPayrollTaxRelief":true,                    "subjectWithholdingIss":true                    },                    "taxRegime":"estimatedProfit",                    "address":                    {                    "zipcode":"29024-047",                    "state":"ES",                    "country":"BRA"                    },                    "federalTaxId":""                    }                    }                    },                    "lines":                    [                    {                    "id":"000010",                    "lineCode":"1",                    "operationType":"standardPurchase",                    "lineAmount":10.00,                    "useType":"notApplicable",                    "numberOfItems":1,                    "otherCostAmount":0.00,                    "freightAmount":0.00,                    "insuranceAmount":0.00,                    "lineTaxedDiscount":0.00,                    "itemDescriptor":                    {                    "hsCode":"33030010",                    "cest":"28.001.00",                    "source":"0",                    "productType":"FOR MERCHANDISE",                    "manufacturerEquivalent":false,                    "appropriateIPIcreditWhenInGoing":false,                    "appropriateICMScreditWhenInGoing":false,                    "usuallyAppropriatePISCOFINSCredit":false,                    "isPisCofinsEstimatedCredit":false,                    "piscofinsRevenueType":"01",                    "unitIPIfactor":1,                    "unitIcmsfactor":1,                    "unitIcmsStfactor":1,                    "unitPisCofinsfactor":1,                    "comexTaxUnitFactor":1                    },                    "goods":                    {                    "subjectToIPIonInbound":false                    }                    }                    ]                    } 
```

### Payload response

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

```
 {                    "header": {                       "transactionDate": "2021-02-23T18:08:52Z",                       "amountCalcType": "net",                       "documentCode": "0050569BC86C1EDB9DC582F6C593F2B1",                       "goods": {                           "model": "55",                           "idDest": 0,                           "tpEmis": "1",                           "class": "Compras para comercialização",                           "tpImp": "1"                       },                       "messageType": "goods",                       "eDocCreatorType": "self",                       "eDocCreatorPerspective": true,                       "companyLocation": "12345678",                       "locations": {                           "establishment": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "wholesle"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false                               },                               "taxRegime": "realProfit",                               "entityType": "business",                               "stateTaxId": "",                               "type": "business",                               "address": {                                   "zipcode": "04561-004",                                   "state": "SP",                                   "country": "BRA",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "cityName": "São Paulo"                               },                               "federalTaxId": ""                           },                           "entity": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "industry"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false                               },                               "taxRegime": "estimatedProfit",                               "address": {                                   "zipcode": "29024-047",                                   "state": "ES",                                   "country": "BRA",                                   "cityCode": 3205309,                                   "countryCode": "0",                                   "cityName": "Vitória"                               },                               "federalTaxId": ""                           }                       },                       "accountId": "",                       "subscriptionId": "",                       "additionalInfo": {                           "complementaryInfo": "IPI Decreto nº 8950/2016\nPIS/COFINS Lei nº 10.147/2000, artigo 1º, inciso I, alínea b\nICMS/ES_Decreto nº 1.090-R/2002, Artigo 71, Inciso II, Alínea a"                       }                    },                    "lines": [                       {                           "id": "000010",                           "lineCode": 1,                           "operationType": "standardPurchase",                           "lineAmount": 13.24,                           "useType": "notApplicable",                           "numberOfItems": 1,                           "otherCostAmount": 0,                           "freightAmount": 0,                           "insuranceAmount": 0,                           "lineTaxedDiscount": 0,                           "itemDescriptor": {                               "hsCode": "33030010",                               "cest": "28.001.00",                               "source": "0",                               "productType": "FOR MERCHANDISE",                               "manufacturerEquivalent": false,                               "appropriateIPIcreditWhenInGoing": false,                               "appropriateICMScreditWhenInGoing": false,                               "usuallyAppropriatePISCOFINSCredit": false,                               "isPisCofinsEstimatedCredit": false,                               "piscofinsRevenueType": "01",                               "unitIPIfactor": 1,                               "unitIcmsfactor": 1,                               "unitIcmsStfactor": 1,                               "unitPisCofinsfactor": 1,                               "comexTaxUnitFactor": 1                           },                           "goods": {                               "subjectToIPIonInbound": false,                               "indTotType": true,                               "entityIcmsStSubstitute": "yes"                           },                           "overwrite": "no",                           "warnings": [                               {                                   "id": "302a07e2-5e27-448b-a0bb-cf37e3118d8a",                                   "code": "WC002",                                   "citation": "Subject to ICMS_Inter_Reduction Benefits: \"ICMS/SP_Decreto nº 45.490/2000, Anexo II, Artigo 22, Parágrafo 1º, Item 2, Alínea a\"",                                   "description": "Para aplicação do citado benefício fiscal é necessário observar as condições determinadas pelo Artigo 51 e Anexo II, Artigo 22, RICMS/SP.",                                   "isCustomCitation": false                               },                               {                                   "id": "9382c321-b755-4acb-a6f0-0a9fa9f2cde5",                                   "code": "WC002",                                   "citation": "Subject to ICMS_Inter_Reduction Benefits: \"ICMS/SP_Decreto nº 45.490/2000, Anexo II, Artigo 22, Parágrafo 1º, Item 2, Alínea b\"",                                   "description": "Para aplicação do citado benefício fiscal é necessário observar as condições determinadas pelo Artigo 51 e Anexo II, Artigo 22, RICMS/SP.",                                   "isCustomCitation": false                               }                           ],                           "lineNetFigure": 10,                           "lineUnitPrice": 13.24,                           "taxDetails": [                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "cofins",                                   "citation": "PIS/COFINS Lei nº 10.147/2000, artigo 1º, inciso I, alínea b",                                   "citationId": "f6b40493-574b-45fa-a470-17f0d4949c8e",                                   "subtotalTaxable": 18.8,                                   "rate": 10.3,                                   "tax": 1.94,                                   "exemptionCode": "",                                   "cst": "70",                                   "calcMode": "rate",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "Espírito Santo",                                   "jurisdictionType": "State",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "icms",                                   "citation": "ICMS/ES_Decreto nº 1.090-R/2002, Artigo 71, Inciso II, Alínea a",                                   "citationId": "782869d9-5546-412c-888a-b31e10420df9",                                   "subtotalTaxable": 13.24,                                   "rate": 12,                                   "tax": 1.59,                                   "exemptionCode": "",                                   "source": "0",                                   "cst": "90",                                   "modBC": "3",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Add",                                       "impactOnNetAmount": "Add",                                       "accounting": "none"                                   },                                   "taxType": "ipi",                                   "citation": "IPI Decreto nº 8950/2016",                                   "citationId": "20dede6a-d1f5-4808-b9ca-9885d2e7cf1e",                                   "subtotalTaxable": 13.24,                                   "rate": 42,                                   "tax": 5.56,                                   "exemptionCode": "",                                   "cst": "49",                                   "legalTaxClass": 999,                                   "calcMode": "rate",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "pis",                                   "citation": "PIS/COFINS Lei nº 10.147/2000, artigo 1º, inciso I, alínea b",                                   "citationId": "db6001a6-6c7d-4f5a-9218-5c2657d3703e",                                   "subtotalTaxable": 18.8,                                   "rate": 2.2,                                   "tax": 0.41,                                   "exemptionCode": "",                                   "cst": "70",                                   "calcMode": "rate",                                   "isCustomCitation": false                               }                           ],                           "cfop": 2102,                           "lineNetUnitPrice": 10,                           "lineAdditionalInfo": ""                       }                    ],                    "version": "3",                    "processingInfo": {                       "versionId": "21.5.1",                       "duration": "17.479"                    },                    "summary": {                       "numberOfLines": 1,                       "totalLineAmounts": 13.24,                       "totalTaxedDiscounts": 0,                       "totalUntaxedDiscounts": 0,                       "totalInsurances": 0,                       "totalFreights": 0,                       "totalOtherCosts": 0,                       "totalUnTaxedOtherCosts": 0,                       "totalInvoice": 18.8,                       "taxByType": {                           "cofins": {                               "tax": 1.94,                               "subtotalTaxable": 18.8,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 1.94                                   }                               ]                           },                           "icms": {                               "tax": 1.59,                               "subtotalTaxable": 13.24,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Espírito Santo",                                       "jurisdictionType": "State",                                       "tax": 1.59                                   }                               ]                           },                           "ipi": {                               "tax": 5.56,                               "subtotalTaxable": 13.24,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 5.56                                   }                               ]                           },                           "pis": {                               "tax": 0.41,                               "subtotalTaxable": 18.8,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 0.41                                   }                               ]                           }                       }                    },                    "input": {                       "header": {                           "transactionDate": "2021-02-23T18:08:52Z",                           "amountCalcType": "net",                           "documentCode": "0050569BC86C1EDB9DC582F6C593F2B1",                           "goods": {                               "model": "55",                               "idDest": 0,                               "tpEmis": "1"                           },                           "messageType": "goods",                           "eDocCreatorType": "self",                           "eDocCreatorPerspective": true,                           "companyLocation": "12345678",                           "locations": {                               "establishment": {                                   "activitySector": {                                       "type": "activityLine",                                       "code": "wholesle"                                   },                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "pCredSN": 0,                                       "subjectToPayrollTaxRelief": true,                                       "subjectWithholdingIss": true,                                       "enableCprb": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false                                   },                                   "taxRegime": "realProfit",                                   "entityType": "business",                                   "stateTaxId": "",                                   "type": "business",                                   "address": {                                       "zipcode": "04561-004",                                       "state": "SP",                                       "country": "BRA",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "cityName": "São Paulo"                                   },                                   "federalTaxId": ""                               },                               "entity": {                                   "activitySector": {                                       "type": "activityLine",                                       "code": "industry"                                   },                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "pCredSN": 0,                                       "subjectToPayrollTaxRelief": true,                                       "subjectWithholdingIss": true,                                       "enableCprb": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false                                   },                                   "taxRegime": "estimatedProfit",                                   "address": {                                       "zipcode": "29024-047",                                       "state": "ES",                                       "country": "BRA",                                       "cityCode": 3205309,                                       "countryCode": "0",                                       "cityName": "Vitória"                                   },                                   "federalTaxId": ""                               }                           },                           "accountId": "",                           "subscriptionId": ""                       },                       "lines": [                           {                               "id": "000010",                               "lineCode": 1,                               "operationType": "standardPurchase",                               "lineAmount": 10,                               "useType": "notApplicable",                               "numberOfItems": 1,                               "otherCostAmount": 0,                               "freightAmount": 0,                               "insuranceAmount": 0,                               "lineTaxedDiscount": 0,                               "itemDescriptor": {                                   "hsCode": "33030010",                                   "cest": "28.001.00",                                   "source": "0",                                   "productType": "FOR MERCHANDISE",                                   "manufacturerEquivalent": false,                                   "appropriateIPIcreditWhenInGoing": false,                                   "appropriateICMScreditWhenInGoing": false,                                   "usuallyAppropriatePISCOFINSCredit": false,                                   "isPisCofinsEstimatedCredit": false,                                   "piscofinsRevenueType": "01",                                   "unitIPIfactor": 1,                                   "unitIcmsfactor": 1,                                   "unitIcmsStfactor": 1,                                   "unitPisCofinsfactor": 1,                                   "comexTaxUnitFactor": 1                               },                               "goods": {                                   "subjectToIPIonInbound": false,                                   "indTotType": true,                                   "entityIcmsStSubstitute": "default"                               },                               "overwrite": "no",                               "warnings": [                                   {                                       "id": "302a07e2-5e27-448b-a0bb-cf37e3118d8a",                                       "code": "WC002",                                       "citation": "Subject to ICMS_Inter_Reduction Benefits: \"ICMS/SP_Decreto nº 45.490/2000, Anexo II, Artigo 22, Parágrafo 1º, Item 2, Alínea a\"",                                       "description": "Para aplicação do citado benefício fiscal é necessário observar as condições determinadas pelo Artigo 51 e Anexo II, Artigo 22, RICMS/SP.",                                       "isCustomCitation": false                                   },                                   {                                       "id": "9382c321-b755-4acb-a6f0-0a9fa9f2cde5",                                       "code": "WC002",                                       "citation": "Subject to ICMS_Inter_Reduction Benefits: \"ICMS/SP_Decreto nº 45.490/2000, Anexo II, Artigo 22, Parágrafo 1º, Item 2, Alínea b\"",                                       "description": "Para aplicação do citado benefício fiscal é necessário observar as condições determinadas pelo Artigo 51 e Anexo II, Artigo 22, RICMS/SP.",                                       "isCustomCitation": false                                   }                               ]                           }                       ],                       "version": "3"                    }                    } 
```

## Purchase within the state

State From

SP

State To

SP

hsCode

33030010

### Payload request

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

```
{                    "header": {                       "transactionDate": "2020-08-14",                       "amountCalcType": "gross",                       "documentCode": "Inbound2",                       "messageType": "goods",                       "eDocCreatorType": "self",                       "eDocCreatorPerspective": true,                       "companyLocation": "1234",                       "operationType": "",                       "locations": {                           "establishment": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "industry"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false                               },                               "taxRegime": "realProfit",                               "type": "business",                               "stateTaxId": "",                               "address": {                                   "zipcode": "04710010"                               },                               "federalTaxId": "999999999"                           },                           "entity": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "wholesale"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false                               },                               "taxRegime": "estimatedProfit",                               "entityType": "business",                               "stateTaxId": "",                               "suframa": "000000000",                               "address": {                                   "zipcode": "04710010"                               },                               "federalTaxId": "999999999"                           }                       }                                           },                    "lines": [                       {                           "lineCode": "1",                           "operationType": "standardPurchase",                           "itemCode": "Item0",                           "useType": "notApplicable",                           "usagePurpose": "inbound01",                           "numberOfItems": "1000",                           "lineUnitPrice": "100",                           "subjectToIPIonInbound": false,                           "itemDescriptor": {                               "hsCode": "33030010",                               "cest": "28.001.00",                               "isIcmsStSubstitute": false,                               "source": "0",                               "productType": "FEEDSTOCK",                               "manufacturerEquivalent": false,                               "appropriateIPIcreditWhenInGoing": false,                               "appropriateICMScreditWhenInGoing": true,                               "usuallyAppropriatePISCOFINSCredit": false,                               "isPisCofinsEstimatedCredit": false,                               "piscofinsRevenueType": "01",                               "unitIPIfactor": 1,                               "unitIcmsfactor": 1,                               "unitIcmsStfactor": 1,                               "unitPisCofinsfactor": 1,                               "comexTaxUnitFactor": 1,                               "cnae": "0",                               "notSubjectToInssWhenPerson": false                           },                           "customProperties": [],                           "goods": {                               "subjectToIPIonInbound": false,                               "indTotType": true                           },                           "overwrite": "no",                           "benefitsAbroad": false                       }                    ],                    "version": "3"                    } 
```

### Payload response

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

```
 {                    "header": {                       "transactionDate": "2020-08-14",                       "amountCalcType": "gross",                       "documentCode": "Inbound2",                       "messageType": "goods",                       "eDocCreatorType": "self",                       "eDocCreatorPerspective": true,                       "companyLocation": "1234",                       "operationType": "",                       "locations": {                           "establishment": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "industry"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false,                                   "enableCprb": false                               },                               "taxRegime": "realProfit",                               "type": "business",                               "stateTaxId": "",                               "address": {                                   "zipcode": "04710010",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "country": "BRA",                                   "state": "SP",                                   "cityName": "São Paulo"                               },                               "federalTaxId": "999999999"                           },                           "entity": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "wholesale"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false,                                   "enableCprb": false                               },                               "taxRegime": "estimatedProfit",                               "entityType": "business",                               "stateTaxId": "",                               "suframa": "000000000",                               "address": {                                   "zipcode": "04710010",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "country": "BRA",                                   "state": "SP",                                   "cityName": "São Paulo"                               },                               "federalTaxId": "999999999"                           }                       },                       "accountId": "",                       "subscriptionId": "",                       "goods": {                           "class": "Compras para industrialização",                           "tpImp": "1"                       },                       "additionalInfo": {                           "complementaryInfo": "PIS/COFINS Lei nº 10.147/2000, artigo 1º, inciso I, alínea b\nICMS/SP_Decreto nº 45.490/2000, Artigo 55, Inciso IV"                       }                    },                    "lines": [                       {                           "lineCode": 1,                           "operationType": "standardPurchase",                           "itemCode": "Item0",                           "useType": "notApplicable",                           "usagePurpose": "inbound01",                           "numberOfItems": 1000,                           "lineUnitPrice": 100,                           "subjectToIPIonInbound": false,                           "itemDescriptor": {                               "hsCode": "33030010",                               "cest": "28.001.00",                               "isIcmsStSubstitute": false,                               "source": "0",                               "productType": "FEEDSTOCK",                               "manufacturerEquivalent": false,                               "appropriateIPIcreditWhenInGoing": false,                               "appropriateICMScreditWhenInGoing": true,                               "usuallyAppropriatePISCOFINSCredit": false,                               "isPisCofinsEstimatedCredit": false,                               "piscofinsRevenueType": "01",                               "unitIPIfactor": 1,                               "unitIcmsfactor": 1,                               "unitIcmsStfactor": 1,                               "unitPisCofinsfactor": 1,                               "comexTaxUnitFactor": 1,                               "cnae": "0",                               "notSubjectToInssWhenPerson": false,                               "description": "Item0"                           },                           "customProperties": [],                           "goods": {                               "subjectToIPIonInbound": false,                               "indTotType": true,                               "entityIcmsStSubstitute": "no"                           },                           "overwrite": "no",                           "benefitsAbroad": false,                           "lineAmount": 100000,                           "taxDetails": [                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "cofins",                                   "citation": "PIS/COFINS Lei nº 10.147/2000, artigo 1º, inciso I, alínea b",                                   "citationId": "f6b40493-574b-45fa-a470-17f0d4949c8e",                                   "subtotalTaxable": 100000,                                   "rate": 10.3,                                   "tax": 10300,                                   "exemptionCode": "",                                   "cst": "70",                                   "calcMode": "rate",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "São Paulo",                                   "jurisdictionType": "State",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "asset"                                   },                                   "taxType": "icms",                                   "citation": "ICMS/SP_Decreto nº 45.490/2000, Artigo 55, Inciso IV",                                   "citationId": "f7976d95-440a-4af4-91b1-9a6c23749ede",                                   "subtotalTaxable": 100000,                                   "rate": 25,                                   "tax": 25000,                                   "exemptionCode": "",                                   "source": "0",                                   "cst": "00",                                   "modBC": "3",                                   "isCustomCitation": false                               },                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "pis",                                   "citation": "PIS/COFINS Lei nº 10.147/2000, artigo 1º, inciso I, alínea b",                                   "citationId": "db6001a6-6c7d-4f5a-9218-5c2657d3703e",                                   "subtotalTaxable": 100000,                                   "rate": 2.2,                                   "tax": 2200,                                   "exemptionCode": "",                                   "cst": "70",                                   "calcMode": "rate",                                   "isCustomCitation": false                               }                           ],                           "cfop": 1101,                           "lineAdditionalInfo": "",                           "lineNetFigure": 62500                       }                    ],                    "version": "3",                    "processingInfo": {                       "versionId": "21.5.1",                       "duration": "4.989"                    },                    "summary": {                       "numberOfLines": 1,                       "totalLineAmounts": 100000,                       "totalTaxedDiscounts": 0,                       "totalUntaxedDiscounts": 0,                       "totalInsurances": 0,                       "totalFreights": 0,                       "totalOtherCosts": 0,                       "totalUnTaxedOtherCosts": 0,                       "totalInvoice": 100000,                       "taxByType": {                           "cofins": {                               "tax": 10300,                               "subtotalTaxable": 100000,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 10300                                   }                               ]                           },                           "icms": {                               "tax": 25000,                               "subtotalTaxable": 100000,                               "jurisdictions": [                                   {                                       "jurisdictionName": "São Paulo",                                       "jurisdictionType": "State",                                       "tax": 25000                                   }                               ]                           },                           "pis": {                               "tax": 2200,                               "subtotalTaxable": 100000,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 2200                                   }                               ]                           }                       }                    },                    "input": {                       "header": {                           "transactionDate": "2020-08-14",                           "amountCalcType": "gross",                           "documentCode": "Inbound2",                           "messageType": "goods",                           "eDocCreatorType": "self",                           "eDocCreatorPerspective": true,                           "companyLocation": "1234",                           "operationType": "",                           "locations": {                               "establishment": {                                   "activitySector": {                                       "type": "activityLine",                                       "code": "industry"                                   },                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "issRfRate": "",                                       "pCredSN": 0,                                       "subjectToPayrollTaxRelief": true,                                       "subjectWithholdingIss": true,                                       "enableInssCprb": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false,                                       "enableCprb": false                                   },                                   "taxRegime": "realProfit",                                   "type": "business",                                   "stateTaxId": "",                                   "address": {                                       "zipcode": "04710010",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "country": "BRA",                                       "state": "SP",                                       "cityName": "São Paulo"                                   },                                   "federalTaxId": "999999999"                               },                               "entity": {                                   "activitySector": {                                       "type": "activityLine",                                       "code": "wholesale"                                   },                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "issRfRate": "",                                       "pCredSN": 0,                                       "subjectToPayrollTaxRelief": true,                                       "subjectWithholdingIss": true,                                       "enableInssCprb": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false,                                       "enableCprb": false                                   },                                   "taxRegime": "estimatedProfit",                                   "entityType": "business",                                   "stateTaxId": "",                                   "suframa": "000000000",                                   "address": {                                       "zipcode": "04710010",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "country": "BRA",                                       "state": "SP",                                       "cityName": "São Paulo"                                   },                                   "federalTaxId": "999999999"                               }                           },                           "accountId": "",                           "subscriptionId": "",                           "goods": {}                       },                       "lines": [                           {                               "lineCode": 1,                               "operationType": "standardPurchase",                               "itemCode": "Item0",                               "useType": "notApplicable",                               "usagePurpose": "inbound01",                               "numberOfItems": 1000,                               "lineUnitPrice": 100,                               "subjectToIPIonInbound": false,                               "itemDescriptor": {                                   "hsCode": "33030010",                                   "cest": "28.001.00",                                   "isIcmsStSubstitute": false,                                   "source": "0",                                   "productType": "FEEDSTOCK",                                   "manufacturerEquivalent": false,                                   "appropriateIPIcreditWhenInGoing": false,                                   "appropriateICMScreditWhenInGoing": true,                                   "usuallyAppropriatePISCOFINSCredit": false,                                   "isPisCofinsEstimatedCredit": false,                                   "piscofinsRevenueType": "01",                                   "unitIPIfactor": 1,                                   "unitIcmsfactor": 1,                                   "unitIcmsStfactor": 1,                                   "unitPisCofinsfactor": 1,                                   "comexTaxUnitFactor": 1,                                   "cnae": "0",                                   "notSubjectToInssWhenPerson": false                               },                               "customProperties": [],                               "goods": {                                   "subjectToIPIonInbound": false,                                   "indTotType": true,                                   "entityIcmsStSubstitute": "default"                               },                               "overwrite": "no",                               "benefitsAbroad": false                           }                       ],                       "version": "3"                    }                    } 
```

## Total outbound goods return

State From

SP

State To

SP

hsCode

33030010

### Payload request

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

```
 {                    "header": {                       "transactionDate": "2020-08-14",                       "amountCalcType": "gross",                       "documentCode": "ReturnInbound",                          "invoicesRefs":                    [                    {                    "type":"documentCode",                    "documentCode":"Inbound2"                    }                    ],                       "messageType": "goods",                       "eDocCreatorType": "self",                       "eDocCreatorPerspective": true,                       "companyLocation": "42886918000715",                       "operationType": "",                       "locations": {                           "establishment": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "industry"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false                               },                               "taxRegime": "realProfit",                               "type": "business",                               "stateTaxId": "",                               "address": {                                   "zipcode": "04710010"                               },                               "federalTaxId": "999999999"                           },                           "entity": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "wholesale"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false                               },                               "taxRegime": "estimatedProfit",                               "entityType": "business",                               "stateTaxId": "",                               "suframa": "000000000",                               "address": {                                   "zipcode": "04710010"                               },                               "federalTaxId": "999999999"                           }                       },                       "accountId": "35212aa8-3023-40b4-8c8a-c982c5014b3a",                       "subscriptionId": "9fe9c37a-1da8-4b8e-9d1b-21207b21e9f9"                    },                    "lines": [                       {                           "lineCode": "1",                           "operationType": "standardPurchaseReturnShippingOutbound",                           "itemCode": "Item0",                           "useType": "notApplicable",                           "usagePurpose": "inbound01",                           "numberOfItems": "1000",                           "lineUnitPrice": "100",                           "subjectToIPIonInbound": false,                           "itemDescriptor": {                               "hsCode": "33030010",                               "cest": "28.001.00",                               "isIcmsStSubstitute": false,                               "source": "0",                               "productType": "FEEDSTOCK",                               "manufacturerEquivalent": false,                               "appropriateIPIcreditWhenInGoing": false,                               "appropriateICMScreditWhenInGoing": true,                               "usuallyAppropriatePISCOFINSCredit": false,                               "isPisCofinsEstimatedCredit": false,                               "piscofinsRevenueType": "01",                               "unitIPIfactor": 1,                               "unitIcmsfactor": 1,                               "unitIcmsStfactor": 1,                               "unitPisCofinsfactor": 1,                               "comexTaxUnitFactor": 1,                               "cnae": "0",                               "notSubjectToInssWhenPerson": false                           },                           "id": 1597423940072,                           "customProperties": [],                           "goods": {                               "subjectToIPIonInbound": false,                               "indTotType": true                           },                           "overwrite": "no",                           "benefitsAbroad": false                       }                    ],                    "version": "3"                    } 
```

### Payload response

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

```
 {                    "header": {                       "transactionDate": "2020-08-14",                       "amountCalcType": "gross",                       "documentCode": "ReturnInbound",                       "invoicesRefs": [                           {                               "type": "documentCode",                               "documentCode": "Inbound2",                               "found": true                           }                       ],                       "messageType": "goods",                       "eDocCreatorType": "self",                       "eDocCreatorPerspective": true,                       "companyLocation": "42886918000715",                       "operationType": "",                       "locations": {                           "establishment": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "industry"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false,                                   "enableCprb": false                               },                               "taxRegime": "realProfit",                               "type": "business",                               "stateTaxId": "",                               "address": {                                   "zipcode": "04710010",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "country": "BRA",                                   "state": "SP",                                   "cityName": "São Paulo"                               },                               "federalTaxId": "999999999"                           },                           "entity": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "wholesale"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false,                                   "enableCprb": false                               },                               "taxRegime": "estimatedProfit",                               "entityType": "business",                               "stateTaxId": "",                               "suframa": "000000000",                               "address": {                                   "zipcode": "04710010",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "country": "BRA",                                   "state": "SP",                                   "cityName": "São Paulo"                               },                               "federalTaxId": "999999999"                           }                       },                       "accounted": "",                       "subscriptionId": "",                       "goods": {                           "idDest": 1,                           "class": "DEVOLUCAO DE COMPRA",                           "tpImp": "1"                       },                       "additionalInfo": {}                    },                    "lines": [                       {                           "lineCode": 1,                           "operationType": "standardPurchaseReturnShippingOutbound",                           "itemCode": "Item0",                           "useType": "notApplicable",                           "usagePurpose": "inbound01",                           "numberOfItems": 1000,                           "lineUnitPrice": 100,                           "subjectToIPIonInbound": false,                           "itemDescriptor": {                               "hsCode": "33030010",                               "cest": "28.001.00",                               "isIcmsStSubstitute": false,                               "source": "0",                               "productType": "FEEDSTOCK",                               "manufacturerEquivalent": false,                               "appropriateIPIcreditWhenInGoing": false,                               "appropriateICMScreditWhenInGoing": true,                               "usuallyAppropriatePISCOFINSCredit": false,                               "isPisCofinsEstimatedCredit": false,                               "piscofinsRevenueType": "01",                               "unitIPIfactor": 1,                               "unitIcmsfactor": 1,                               "unitIcmsStfactor": 1,                               "unitPisCofinsfactor": 1,                               "comexTaxUnitFactor": 1,                               "cnae": "0",                               "notSubjectToInssWhenPerson": false,                               "description": "Item0"                           },                           "id": 1597423940072,                           "customProperties": [],                           "goods": {                               "subjectToIPIonInbound": false,                               "indTotType": true,                               "entityIcmsStSubstitute": "no"                           },                           "overwrite": "proportional",                           "benefitsAbroad": false,                           "referencedItem": {                               "documentCode": "Inbound2",                               "lineCode": 1                           },                           "lineAmount": 100000,                           "taxDetails": [                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "cofins",                                   "citation": "PIS/COFINS Lei nº 10.147/2000, artigo 1º, inciso I, alínea b",                                   "subtotalTaxable": 100000,                                   "rate": 10.3,                                   "tax": 10300,                                   "exemptionCode": "",                                   "cst": "49",                                   "pRedBC": null,                                   "calcMode": "rate"                               },                               {                                   "jurisdictionName": "São Paulo",                                   "jurisdictionType": "State",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "liability"                                   },                                   "taxType": "icms",                                   "citation": "ICMS/SP_Decreto nº 45.490/2000, Artigo 55, Inciso IV",                                   "subtotalTaxable": 100000,                                   "rate": 25,                                   "tax": 25000,                                   "exemptionCode": "",                                   "source": "0",                                   "cst": "00",                                   "modBC": "3"                               },                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "pis",                                   "citation": "PIS/COFINS Lei nº 10.147/2000, artigo 1º, inciso I, alínea b",                                   "subtotalTaxable": 100000,                                   "rate": 2.2,                                   "tax": 2200,                                   "exemptionCode": "",                                   "cst": "49",                                   "pRedBC": null,                                   "calcMode": "rate"                               }                           ],                           "cfop": 5556,                           "lineAdditionalInfo": "",                           "lineNetFigure": 62500                       }                    ],                    "version": "3",                    "processingInfo": {                       "versionId": "21.5.1",                       "duration": "4.362"                    },                    "summary": {                       "numberOfLines": 1,                       "totalLineAmounts": 100000,                       "totalTaxedDiscounts": 0,                       "totalUntaxedDiscounts": 0,                       "totalInsurances": 0,                       "totalFreights": 0,                       "totalOtherCosts": 0,                       "totalUnTaxedOtherCosts": 0,                       "totalInvoice": 100000,                       "taxByType": {                           "cofins": {                               "tax": 10300,                               "subtotalTaxable": 100000,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 10300                                   }                               ]                           },                           "icms": {                               "tax": 25000,                               "subtotalTaxable": 100000,                               "jurisdictions": [                                   {                                       "jurisdictionName": "São Paulo",                                       "jurisdictionType": "State",                                       "tax": 25000                                   }                               ]                           },                           "pis": {                               "tax": 2200,                               "subtotalTaxable": 100000,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 2200                                   }                               ]                           }                       }                    },                    "input": {                       "header": {                           "transactionDate": "2020-08-14",                           "amountCalcType": "gross",                           "documentCode": "ReturnInbound",                           "invoicesRefs": [                               {                                   "type": "documentCode",                                   "documentCode": "Inbound2",                                   "found": true                               }                           ],                           "messageType": "goods",                           "eDocCreatorType": "self",                           "eDocCreatorPerspective": true,                           "companyLocation": "42886918000715",                           "operationType": "",                           "locations": {                               "establishment": {                                   "activitySector": {                                       "type": "activityLine",                                       "code": "industry"                                   },                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "issRfRate": "",                                       "pCredSN": 0,                                       "subjectToPayrollTaxRelief": true,                                       "subjectWithholdingIss": true,                                       "enableInssCprb": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false,                                       "enableCprb": false                                   },                                   "taxRegime": "realProfit",                                   "type": "business",                                   "stateTaxId": "",                                   "address": {                                       "zipcode": "04710010",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "country": "BRA",                                       "state": "SP",                                       "cityName": "São Paulo"                                   },                                   "federalTaxId": "999999999"                               },                               "entity": {                                   "activitySector": {                                       "type": "activityLine",                                       "code": "wholesale"                                   },                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "issRfRate": "",                                       "pCredSN": 0,                                       "subjectToPayrollTaxRelief": true,                                       "subjectWithholdingIss": true,                                       "enableInssCprb": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false,                                       "enableCprb": false                                   },                                   "taxRegime": "estimatedProfit",                                   "entityType": "business",                                   "stateTaxId": "",                                   "suframa": "000000000",                                   "address": {                                       "zipcode": "04710010",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "country": "BRA",                                       "state": "SP",                                       "cityName": "São Paulo"                                   },                                   "federalTaxId": "999999999"                               }                           },                           "accountId": "b",                           "subscriptionId": "",                           "goods": {}                       },                       "lines": [                           {                               "lineCode": 1,                               "operationType": "standardPurchaseReturnShippingOutbound",                               "itemCode": "Item0",                               "useType": "notApplicable",                               "usagePurpose": "inbound01",                               "numberOfItems": 1000,                               "lineUnitPrice": 100,                               "subjectToIPIonInbound": false,                               "itemDescriptor": {                                   "hsCode": "33030010",                                   "cest": "28.001.00",                                   "isIcmsStSubstitute": false,                                   "source": "0",                                   "productType": "FEEDSTOCK",                                   "manufacturerEquivalent": false,                                   "appropriateIPIcreditWhenInGoing": false,                                   "appropriateICMScreditWhenInGoing": true,                                   "usuallyAppropriatePISCOFINSCredit": false,                                   "isPisCofinsEstimatedCredit": false,                                   "piscofinsRevenueType": "01",                                   "unitIPIfactor": 1,                                   "unitIcmsfactor": 1,                                   "unitIcmsStfactor": 1,                                   "unitPisCofinsfactor": 1,                                   "comexTaxUnitFactor": 1,                                   "cnae": "0",                                   "notSubjectToInssWhenPerson": false                               },                               "id": 1597423940072,                               "customProperties": [],                               "goods": {                                   "subjectToIPIonInbound": false,                                   "indTotType": true,                                   "entityIcmsStSubstitute": "default"                               },                               "overwrite": "no",                               "benefitsAbroad": false,                               "referencedItem": {                                   "documentCode": "Inbound2",                                   "lineCode": 1                               }                           }                       ],                       "version": "3"                    }                    } 
```

## Partial inbound goods return

State From

SP

State To

SP

hsCode

33030010

### Payload request

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

```
 {                    "header": {                       "transactionDate": "2020-08-14",                       "amountCalcType": "gross",                       "documentCode": "ReturnInbound",                          "invoicesRefs":                    [                    {                    "type":"documentCode",                    "documentCode":"Inbound2"                    }                    ],                       "messageType": "goods",                       "eDocCreatorType": "self",                       "eDocCreatorPerspective": true,                       "companyLocation": "1234",                       "operationType": "",                       "locations": {                           "establishment": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "industry"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false                               },                               "taxRegime": "realProfit",                               "type": "business",                               "stateTaxId": "",                               "address": {                                   "zipcode": "04710010"                               },                               "federalTaxId": "999999999"                           },                           "entity": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "wholesale"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false                               },                               "taxRegime": "estimatedProfit",                               "entityType": "business",                               "stateTaxId": "",                               "suframa": "000000000",                               "address": {                                   "zipcode": "04710010"                               },                               "federalTaxId": "999999999"                           }                       }                    },                    "lines": [                       {                           "lineCode": "1",                           "operationType": "standardPurchaseReturnShippingOutbound",                           "itemCode": "Item0",                           "useType": "notApplicable",                           "usagePurpose": "inbound01",                           "numberOfItems": "500",                           "lineUnitPrice": "100",                           "subjectToIPIonInbound": false,                           "itemDescriptor": {                               "hsCode": "33030010",                               "cest": "28.001.00",                               "isIcmsStSubstitute": false,                               "source": "0",                               "productType": "FEEDSTOCK",                               "manufacturerEquivalent": false,                               "appropriateIPIcreditWhenInGoing": false,                               "appropriateICMScreditWhenInGoing": true,                               "usuallyAppropriatePISCOFINSCredit": false,                               "isPisCofinsEstimatedCredit": false,                               "piscofinsRevenueType": "01",                               "unitIPIfactor": 1,                               "unitIcmsfactor": 1,                               "unitIcmsStfactor": 1,                               "unitPisCofinsfactor": 1,                               "comexTaxUnitFactor": 1,                               "cnae": "0",                               "notSubjectToInssWhenPerson": false                           },                                                      "customProperties": [],                           "goods": {                               "subjectToIPIonInbound": false,                               "indTotType": true                           },                           "overwrite": "no",                           "benefitsAbroad": false                       }                    ],                    "version": "3"                    } 
```

### Payload response

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

```
 {                    "header": {                       "transactionDate": "2020-08-14",                       "amountCalcType": "gross",                       "documentCode": "ReturnInbound",                       "invoicesRefs": [                           {                               "type": "documentCode",                               "documentCode": "Inbound2",                               "found": true                           }                       ],                       "messageType": "goods",                       "eDocCreatorType": "self",                       "eDocCreatorPerspective": true,                       "companyLocation": "1234",                       "operationType": "",                       "locations": {                           "establishment": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "industry"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false,                                   "enableCprb": false                               },                               "taxRegime": "realProfit",                               "type": "business",                               "stateTaxId": "",                               "address": {                                   "zipcode": "04710010",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "country": "BRA",                                   "state": "SP",                                   "cityName": "São Paulo"                               },                               "federalTaxId": "999999999"                           },                           "entity": {                               "activitySector": {                                   "type": "activityLine",                                   "code": "wholesale"                               },                               "taxesSettings": {                                   "icmsTaxPayer": true,                                   "issRfRate": "",                                   "pCredSN": 0,                                   "subjectToPayrollTaxRelief": true,                                   "subjectWithholdingIss": true,                                   "enableInssCprb": false,                                   "usesInssCprbToGrossValue": false,                                   "pisCofinsIcmsTaxRelief": false,                                   "enableCprb": false                               },                               "taxRegime": "estimatedProfit",                               "entityType": "business",                               "stateTaxId": "",                               "suframa": "000000000",                               "address": {                                   "zipcode": "04710010",                                   "cityCode": 3550308,                                   "countryCode": "0",                                   "country": "BRA",                                   "state": "SP",                                   "cityName": "São Paulo"                               },                               "federalTaxId": "999999999"                           }                       },                       "accountId": "",                       "subscriptionId": "",                       "goods": {                           "idDest": 1,                           "class": "DEVOLUCAO DE COMPRA",                           "tpImp": "1"                       },                       "additionalInfo": {}                    },                    "lines": [                       {                           "lineCode": 1,                           "operationType": "standardPurchaseReturnShippingOutbound",                           "itemCode": "Item0",                           "useType": "notApplicable",                           "usagePurpose": "inbound01",                           "numberOfItems": 500,                           "lineUnitPrice": 100,                           "subjectToIPIonInbound": false,                           "itemDescriptor": {                               "hsCode": "33030010",                               "cest": "28.001.00",                               "isIcmsStSubstitute": false,                               "source": "0",                               "productType": "FEEDSTOCK",                               "manufacturerEquivalent": false,                               "appropriateIPIcreditWhenInGoing": false,                               "appropriateICMScreditWhenInGoing": true,                               "usuallyAppropriatePISCOFINSCredit": false,                               "isPisCofinsEstimatedCredit": false,                               "piscofinsRevenueType": "01",                               "unitIPIfactor": 1,                               "unitIcmsfactor": 1,                               "unitIcmsStfactor": 1,                               "unitPisCofinsfactor": 1,                               "comexTaxUnitFactor": 1,                               "cnae": "0",                               "notSubjectToInssWhenPerson": false,                               "description": "Item0"                           },                           "customProperties": [],                           "goods": {                               "subjectToIPIonInbound": false,                               "indTotType": true,                               "entityIcmsStSubstitute": "no"                           },                           "overwrite": "proportional",                           "benefitsAbroad": false,                           "referencedItem": {                               "documentCode": "Inbound2",                               "lineCode": 1                           },                           "lineAmount": 50000,                           "taxDetails": [                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "cofins",                                   "citation": "PIS/COFINS Lei nº 10.147/2000, artigo 1º, inciso I, alínea b",                                   "subtotalTaxable": 50000,                                   "rate": 10.3,                                   "tax": 5150,                                   "exemptionCode": "",                                   "cst": "49",                                   "pRedBC": null,                                   "calcMode": "rate"                               },                               {                                   "jurisdictionName": "São Paulo",                                   "jurisdictionType": "State",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "liability"                                   },                                   "taxType": "icms",                                   "citation": "ICMS/SP_Decreto nº 45.490/2000, Artigo 55, Inciso IV",                                   "subtotalTaxable": 50000,                                   "rate": 25,                                   "tax": 12500,                                   "exemptionCode": "",                                   "source": "0",                                   "cst": "00",                                   "modBC": "3"                               },                               {                                   "jurisdictionName": "Brazil",                                   "jurisdictionType": "Country",                                   "taxImpact": {                                       "impactOnFinalPrice": "Included",                                       "impactOnNetAmount": "Included",                                       "accounting": "none"                                   },                                   "taxType": "pis",                                   "citation": "PIS/COFINS Lei nº 10.147/2000, artigo 1º, inciso I, alínea b",                                   "subtotalTaxable": 50000,                                   "rate": 2.2,                                   "tax": 1100,                                   "exemptionCode": "",                                   "cst": "49",                                   "pRedBC": null,                                   "calcMode": "rate"                               }                           ],                           "cfop": 5556,                           "lineAdditionalInfo": "",                           "lineNetFigure": 31250                       }                    ],                    "version": "3",                    "processingInfo": {                       "versionId": "21.5.1",                       "duration": "2.933"                    },                    "summary": {                       "numberOfLines": 1,                       "totalLineAmounts": 50000,                       "totalTaxedDiscounts": 0,                       "totalUntaxedDiscounts": 0,                       "totalInsurances": 0,                       "totalFreights": 0,                       "totalOtherCosts": 0,                       "totalUnTaxedOtherCosts": 0,                       "totalInvoice": 50000,                       "taxByType": {                           "cofins": {                               "tax": 5150,                               "subtotalTaxable": 50000,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 5150                                   }                               ]                           },                           "icms": {                               "tax": 12500,                               "subtotalTaxable": 50000,                               "jurisdictions": [                                   {                                       "jurisdictionName": "São Paulo",                                       "jurisdictionType": "State",                                       "tax": 12500                                   }                               ]                           },                           "pis": {                               "tax": 1100,                               "subtotalTaxable": 50000,                               "jurisdictions": [                                   {                                       "jurisdictionName": "Brazil",                                       "jurisdictionType": "Country",                                       "tax": 1100                                   }                               ]                           }                       }                    },                    "input": {                       "header": {                           "transactionDate": "2020-08-14",                           "amountCalcType": "gross",                           "documentCode": "ReturnInbound",                           "invoicesRefs": [                               {                                   "type": "documentCode",                                   "documentCode": "Inbound2",                                   "found": true                               }                           ],                           "messageType": "goods",                           "eDocCreatorType": "self",                           "eDocCreatorPerspective": true,                           "companyLocation": "1234",                           "operationType": "",                           "locations": {                               "establishment": {                                   "activitySector": {                                       "type": "activityLine",                                       "code": "industry"                                   },                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "issRfRate": "",                                       "pCredSN": 0,                                       "subjectToPayrollTaxRelief": true,                                       "subjectWithholdingIss": true,                                       "enableInssCprb": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false,                                       "enableCprb": false                                   },                                   "taxRegime": "realProfit",                                   "type": "business",                                   "stateTaxId": "",                                   "address": {                                       "zipcode": "04710010",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "country": "BRA",                                       "state": "SP",                                       "cityName": "São Paulo"                                   },                                   "federalTaxId": "999999999"                               },                               "entity": {                                   "activitySector": {                                       "type": "activityLine",                                       "code": "wholesale"                                   },                                   "taxesSettings": {                                       "icmsTaxPayer": true,                                       "issRfRate": "",                                       "pCredSN": 0,                                       "subjectToPayrollTaxRelief": true,                                       "subjectWithholdingIss": true,                                       "enableInssCprb": false,                                       "usesInssCprbToGrossValue": false,                                       "pisCofinsIcmsTaxRelief": false,                                       "enableCprb": false                                   },                                   "taxRegime": "estimatedProfit",                                   "entityType": "business",                                   "stateTaxId": "",                                   "suframa": "000000000",                                   "address": {                                       "zipcode": "04710010",                                       "cityCode": 3550308,                                       "countryCode": "0",                                       "country": "BRA",                                       "state": "SP",                                       "cityName": "São Paulo"                                   },                                   "federalTaxId": "999999999"                               }                           },                           "accountId": "",                           "subscriptionId": "",                           "goods": {}                       },                       "lines": [                           {                               "lineCode": 1,                               "operationType": "standardPurchaseReturnShippingOutbound",                               "itemCode": "Item0",                               "useType": "notApplicable",                               "usagePurpose": "inbound01",                               "numberOfItems": 500,                               "lineUnitPrice": 100,                               "subjectToIPIonInbound": false,                               "itemDescriptor": {                                   "hsCode": "33030010",                                   "cest": "28.001.00",                                   "isIcmsStSubstitute": false,                                   "source": "0",                                   "productType": "FEEDSTOCK",                                   "manufacturerEquivalent": false,                                   "appropriateIPIcreditWhenInGoing": false,                                   "appropriateICMScreditWhenInGoing": true,                                   "usuallyAppropriatePISCOFINSCredit": false,                                   "isPisCofinsEstimatedCredit": false,                                   "piscofinsRevenueType": "01",                                   "unitIPIfactor": 1,                                   "unitIcmsfactor": 1,                                   "unitIcmsStfactor": 1,                                   "unitPisCofinsfactor": 1,                                   "comexTaxUnitFactor": 1,                                   "cnae": "0",                                   "notSubjectToInssWhenPerson": false                               },                               "customProperties": [],                               "goods": {                                   "subjectToIPIonInbound": false,                                   "indTotType": true,                                   "entityIcmsStSubstitute": "default"                               },                               "overwrite": "no",                               "benefitsAbroad": false,                               "referencedItem": {                                   "documentCode": "Inbound2",                                   "lineCode": 1                               }                           }                       ],                       "version": "3"                    }                    } 
```