Documentação Geral
TaaS – API Trace
API Trace
Por Carlos Cornejo
A API trace tem o objetivo de mostrar o fluxo completo do Tass, desde o envio, até o retorno do Motor para o Tass. Ela tem como principal característica devolver as informações da chamada e retorno do Tass, chamada e retorno do Motor de Cálculo, além da Determinação de Perfil que foi feita.
Como o próprio nome da API já diz, Trace significa percurso, e é exatamente isso que ela faz, mostra o percurso completo.
Acessos para a API
URL: https://wscockpit.systax.com.br/TaaSPD/api/Trace/List
Método: POST
Autenticação
Para utilizar a API é necessário autenticar pelo método Basic Auth e informar as mesmas credenciais utilizadas no Motor de Cálculo.
Chamada
Os parâmetros possíveis para preenchimento na chamada são:
"sessionId": consulta pelo ID da chamada no TaaS (não é obrigatório)
"year": informar sempre o ano da chamada (obrigatório)
"month": informar sempre o mês da chamada (obrigatório)
"pageSize": itens por página (não é obrigatório)
"page": número da página a ser consultada (não é obrigatório)
"ondemandFilter": informar 0 ou 1 (0 – sem ondemand /1 – com ondemand) (não é obrigatório)
"profileFilter": informar o número do ID da planilha de determinação de perfil (não é obrigatório)
Importante: com exceção dos campos obrigatórios, caso não queira informar um determinado parâmetro, basta não informar o campo na chamada.
Modelo da chamada
A chamada é feita na seguinte estrutura:
{
"sessionId": "string",
"year": 0,
"month": 0,
"pageSize": 0,
"page": 0,
"ondemandFilter": 0,
"profileFilter": 0
}
Retorno da chamada
O retorno da chamada será na seguinte estrutura:
- Chamada do Tass
- Retorno do Tass
- Determinação de Perfil
- Chamada do Motor
- Retorno do Motor
- Filtros da Determinação de Perfil
Exemplo de Retorno (com destaque para o início de parte)
[
{
"sessionId": "005056AB1BC71EDE9E8916260C04D7CA",
"user": "Teste1",
"requestedDate": "2023-10-31T23:53:47.08",
"taasRequest": {
"id": "005056AB1BC71EDE9E8916260C04D7CA",
"date": "2023-10-31T18:53:15Z",
"saleorPurchase": "s",
"operationNatureCode": "2GT",
"grossOrNet": "n",
"currency": "BRL",
"items": [
{
"id": "000010",
"itemCode": "81720663",
"itemType": "M",
"quantity": "210.000",
"unitPrice": "7.675480000000",
"itemClassifications": [
{
"itemStandardClassificationSystemCode": "ean",
"itemStandardClassificationCode": "17500435036754"
},
{
"itemStandardClassificationSystemCode": "ncm",
"itemStandardClassificationCode": "30045030"
}
],
"additionalItemInformation": [
{
"type": "commercialQuantity",
"information": "1.000"
},
{
"type": "materialOrigin",
"information": "2"
},
{
"type": "ownProduction",
"information": "N"
},
{
"type": "usage",
"information": "C"
},
{
"type": "CPRB",
"information": "N"
}
],
"costInformation": null
}
],
"locations": [
{
"type": "SHIP_FROM",
"addressLine1": "ROD PRESIDENTE DUTRA, KM 316,",
"zipCode": "27580-000",
"city": "ITATIAIA",
"state": "RJ",
"country": "BR"
},
{
"type": "SHIP_TO",
"addressLine1": "QUADRA 18, CASA 25 25, Setor E",
"zipCode": "64010-430",
"city": "TERESINA",
"state": "PI",
"country": "BR"
}
],
"party": [
{
"id": "1",
"role": "SHIP_FROM",
"taxRegistration": [
{
"locationType": "SHIP_FROM",
"taxNumber": "4646001",
"taxNumberTypeCode": "CNAE"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "01358874001311",
"taxNumberTypeCode": "CNPJ"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "Y",
"taxNumberTypeCode": "COFINSContributor"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "3302254",
"taxNumberTypeCode": "IBGECode"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "Y",
"taxNumberTypeCode": "ICMSContributor"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "Y",
"taxNumberTypeCode": "ICMSSTContributor"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "78863692",
"taxNumberTypeCode": "IE"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "N",
"taxNumberTypeCode": "IPIContributor"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "Y",
"taxNumberTypeCode": "ISSContributor"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "2062",
"taxNumberTypeCode": "legalNature"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "Y",
"taxNumberTypeCode": "PISContributor"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "3",
"taxNumberTypeCode": "taxRegimenCode"
},
{
"locationType": "SHIP_FROM",
"taxNumber": "Real Profit",
"taxNumberTypeCode": "taxDeclarationType"
}
]
},
{
"id": "2",
"role": "SHIP_TO",
"taxRegistration": [
{
"locationType": "SHIP_TO",
"taxNumber": "88925730391",
"taxNumberTypeCode": "CPF"
},
{
"locationType": "SHIP_TO",
"taxNumber": "N",
"taxNumberTypeCode": "COFINSContributor"
},
{
"locationType": "SHIP_TO",
"taxNumber": "2211001",
"taxNumberTypeCode": "IBGECode"
},
{
"locationType": "SHIP_TO",
"taxNumber": "N",
"taxNumberTypeCode": "ICMSContributor"
},
{
"locationType": "SHIP_TO",
"taxNumber": "N",
"taxNumberTypeCode": "ICMSSTContributor"
},
{
"locationType": "SHIP_TO",
"taxNumber": "N",
"taxNumberTypeCode": "IPIContributor"
},
{
"locationType": "SHIP_TO",
"taxNumber": "N",
"taxNumberTypeCode": "ISSContributor"
},
{
"locationType": "SHIP_TO",
"taxNumber": "N",
"taxNumberTypeCode": "PISContributor"
},
{
"locationType": "SHIP_TO",
"taxNumber": null,
"taxNumberTypeCode": "taxDeclarationType"
}
]
}
],
"debug": "0",
"chaveBanco": "481446_Homolog"
},
"taasResponse": {
"total": "2040.318000000000",
"subTotal": "2040.318000000000",
"totalTax": "9.715800000000",
"taxLines": [
{
"id": "000010",
"totalTax": "428.460000000000",
"taxcode": "6911",
"taxValues": [
{
"rate": "0.0000",
"taxable": "0.000000000000",
"name": "Imposto sobre Produtos Industrializados",
"value": "0.000000000000",
"exemptedBasePercent": "0.0000",
"exemptedBaseAmount": "2040.318000000000000",
"otherBaseAmount": "0.000000000000",
"taxTypeCode": "IPI",
"taxAttributes": [
{
"attributeType": "CENQ",
"attributeValue": "999"
},
{
"attributeType": "CST",
"attributeValue": "53"
},
{
"attributeType": "legalProvision1",
"attributeValue": "Art. 18, da Lei nº 13.097/2015 c.c. art. 7º da Lei 7.798/1989"
},
{
"attributeType": "legalPCode1",
"attributeValue": "220017"
}
]
},
{
"rate": "4.0000",
"taxable": "2040.317468354340",
"name": "Imposto sobre Comercialização de Mercadorias e Serviços",
"value": "81.610000000000",
"exemptedBasePercent": "0.0000",
"exemptedBaseAmount": "0.000000000000",
"otherBaseAmount": "0.000000000000",
"taxTypeCode": "ICMS",
"taxAttributes": [
{
"attributeType": "CST",
"attributeValue": "00"
},
{
"attributeType": "baseDetermination",
"attributeValue": "3"
},
{
"attributeType": "legalProvision2",
"attributeValue": "DispLeg=Art. 27, I, `a` do RICMS/PI, Art. 21, I, `c` do RICMS/PI"
},
{
"attributeType": "legalPCode2",
"attributeValue": "230210"
}
]
},
{
"rate": "21.0000",
"taxable": "2040.320000000000",
"name": "ICMS-DP",
"value": "346.850000000000",
"exemptedBasePercent": "0.0000",
"exemptedBaseAmount": "0.000000000000",
"otherBaseAmount": "0.000000000000",
"taxTypeCode": "ICMS-DP",
"taxAttributes": [
{
"attributeType": "legalProvision1",
"attributeValue": "Livro I, Art. 27, I e Apêndice I, Seção I, item XI do RICMS"
}
]
},
{
"rate": "0.0000",
"taxable": "0.000000000000",
"name": "Programa de Integração Social",
"value": "0.000000000000",
"exemptedBasePercent": "0.0000",
"exemptedBaseAmount": "0.000000000000",
"otherBaseAmount":"1611.850800000000000",
"taxTypeCode": "PIS",
"taxAttributes": [
{
"attributeType": "CST",
"attributeValue": "49"
},
{
"attributeType": "legalProvision1",
"attributeValue": "Art. 1º da Lei nº 10.637/2002"
},
{
"attributeType": "legalPCode1",
"attributeValue": "230278"
}
]
},
{
"rate": "0.0000",
"taxable": "0.000000000000",
"name": "Contribuição para o Financiamento da Seguridade Social",
"value": "0.000000000000",
"exemptedBasePercent": "0.0000",
"exemptedBaseAmount": "0.000000000000",
"otherBaseAmount": "1611.850800000000000",
"taxTypeCode": "COFINS",
"taxAttributes": [
{
"attributeType": "CST",
"attributeValue": "49"
},
{
"attributeType": "legalProvision1",
"attributeValue": "Art. 1º da Lei nº 10.833/2003"
},
{
"attributeType": "legalPCode1",
"attributeValue": "230279"
}
]
}
]
}
],
"date": "2023-10-31T20:39:17.4599094+00:00",
"genericInfo": "NvProdUniPC=7.675480000000|idCenario=2141379|UFO=rj|UFD=pi|natOp=771|perfilorig=2|perfildest=6|versao=6.16|",
"partnerName": "Systax versao=6.16"
},
"searchedProfile": {
"itemtype": "M",
"saleorPurchase": "S",
"operationnaturecode": "2GT",
"ownproduction": "N",
"usage": "C",
"usagePurpose": "",
"shipfromuf": "RJ",
"shiptouf": "PI",
"materialorigin": "2",
"shipfromcountry": "BR",
"shipfromipicontributor": "N",
"shiptoipicontributor": "N",
"shipfromtaxregimencode": "3",
"shiptotaxregimencode": null,
"shipfromibgecode": "3302254",
"shiptoibgecode": "2211001",
"shipfromie": "78863692",
"shipfromcnpj": "01358874001311",
"shiptocnpj": null,
"shipfromicmscontributor": "Y",
"shiptoicmscontributor": "N",
"shipfromicmsstcontributor": "Y",
"shiptoicmsstcontributor": "N",
"shipfromtaxdeclarationtype": "REAL PROFIT",
"shiptotaxdeclarationtype": null,
"shipfromcnae": "4646001",
"shiptocnae": null,
"shiptoisscontributor": "N"
},
"taxEngineRQ": {
"cabecalho": {
"usuario": "Teste1",
"senha": "*******",
"sessionID": "005056AB1BC71EDE9E8916260C04D7CA",
"sisOrig": "1",
"dtCalc": "2023-10-31",
"ufOrig": "RJ",
"ufDest": "PI",
"tpNF": "1",
"cnaeRem": null,
"cnaeDest": null,
"munOrig": "3302254",
"munDest": "2211001",
"impAtiv": "4",
"generico": null,
"chaveBanco": "481446_Homolog"
},
"itens": [
{
"id": "000010",
"natOp": "771",
"finalidade": "",
"perfilRem": "2",
"perfilDest": "6",
"cProd": "81720663",
"orig": "2",
"cEAN": "17500435036754",
"ncm": "30045030",
"extipi": "",
"vProdUni": "7.675480000000",
"qTrib": "210.000",
"vFrete": null,
"vSeg": null,
"vOutro": null,
"vDesc": null,
"pDesc": null,
"outrasDesp": null,
"pCredSN": "0",
"infCustoAquis": null,
"margemLucro": null,
"generico": null
}
]
},
"taxEngineRS": {
"itens": [
{
"id": "000010",
"cProd": "81720663",
"cest": "1300300",
"cfop": "6911",
"ncm": "30045030",
"extipi": null,
"pCredSN_resp": "0",
"custo_aquisicao": null,
"nvProdUni": "9.715800000000",
"cBenef": null,
"generico": "NvProdUniPC=7.675480000000|idCenario=2141379|UFO=rj|UFD=pi|natOp=771|perfilorig=2|perfildest=6|versao=6.16|",
"status": {
"cod": "0",
"msg": "Retornado com sucesso.",
"idIncidente": null
},
"nFe": {
"imposto": {
"icms": {
"icmS00": {
"orig": "2",
"cst": "00",
"modBC": "3",
"vBC": "2040.317468354340",
"pICMS": "4.0000",
"vICMS": "81.610000000000",
"pFCP": null,
"vFCP": null
},
"icmS10": null,
"icmS20": null,
"icmS30": null,
"icmS40": null,
"icmS51": null,
"icmS60": null,
"icmS70": null,
"icmS90": null,
"icmssN101": null,
"icmssN102": null,
"icmssN201": null,
"icmssN202": null,
"icmssN500": null,
"icmssN900": null,
"icmssN300": null,
"icmssN400": null
},
"ipi": {
"cEnq": "999",
"ipiTrib": null,
"ipint": {
"cst": "53"
}
},
"pis": {
"pisAliq": null,
"pisQtde": null,
"pisnt": null,
"pisOutr": {
"cst": "49",
"vBC": "0.000000000000",
"pPIS": "0.0000",
"qBCProd": null,
"vAliqProd": null,
"vPIS": "0.000000000000"
}
},
"pisst": null,
"cofins": {
"cofinsAliq": null,
"cofinsnt": null,
"cofinsOutr": {
"cst": "49",
"vBC": "0.000000000000",
"pCOFINS": "0.0000",
"qBCProd": null,
"vAliqProd": null,
"vCOFINS": "0.000000000000"
},
"cofinsQtde": null
},
"cofinsst": null,
"icmsufDest": {
"vBCUFDest": "2040.320000000000",
"vBCFCPUFDest": null,
"pFCPUFDest": null,
"pICMSUFDest": "21.0000",
"pICMSInter": "4.00",
"pICMSInterPart": "100.0000",
"vFCPUFDest": null,
"vICMSUFDest": "346.850000000000",
"vICMSUFRemet": "0.000000000000"
}
},
"infAdProd": "pFCP:0%;vFCP:R$0;valor_aproximado_tributos_estaduais=290.133144000000 valor_aproximado_tributos_federais=344.130145800000 vBCUFDest=2040.320000000000;pICMSUFDest=21.0000;pICMSInter=4.00;pICMSInterPart=100.0000;vICMSUFDest=346.850000000000;vICMSUFRemet=0.000000000000;IPI:Art;18, da Lei nº 13.097/2015 c.c;art;7º da Lei 7.798/1989;PIS:Art;1º da Lei nº 10.637/2002",
"infCpl": "DispLeg=Art. 27, I, `a` do RICMS/PI, Art. 21, I, `c` do RICMS/PI"
},
"conteudoAuxiliar": {
"cofinsCred": null,
"icmsCred": null,
"icmS_ANTECIPACAOCred": null,
"icmS_Antecipacao": null,
"ipiCred": null,
"pisCred": null,
"simulacaO_ICMS_ST": null,
"icmsDeson": null,
"icmsDifalContribuinte": null,
"funrural": null,
"icmsCombustiveis": null,
"dispositivoLegal": {
"dispositivoLegalICMS": "art. 4º, I do RICMS/RJ. Resolução do Senado Federal nº 13/2012",
"dispositivoLegalICMSST": null,
"dispositivoLegalIPI": "Art. 18, da Lei nº 13.097/2015 c.c. art. 7º da Lei 7.798/1989",
"dispositivoLegalPIS": "Art. 1º da Lei nº 10.637/2002",
"dispositivoLegalCOFINS": "Art. 1º da Lei nº 10.833/2003"
},
"creditoEspecial": null,
"precoTotalItem": null,
"cargaTributaria": null,
"creditoPresumido": null,
"margemLucro": null
},
"cTe": null
}
],
"icmsTot": {
"vBC": "2040.317468354340",
"vICMS": "81.610000000000",
"vICMSDeson": "0.000000000000",
"vFCPUFDest": "0.000000000000",
"vICMSUFDest": "346.850000000000",
"vICMSUFRemet": "0.000000000000",
"vFCP": "0.000000000000",
"vBCST": "0.000000000000",
"vST": "0.000000000000",
"vFCPST": "0.000000000000",
"vFCPSTRet": "0.000000000000",
"vProd": "2040.318000000000",
"vFrete": "0.000000000000",
"vSeg": "0.000000000000",
"vDesc": "0.000000000000",
"vII": "0.000000000000",
"vIPI": "0.000000000000",
"vIPIDevol": "0.000000000000",
"vPIS": "0.000000000000",
"vCOFINS": "0.000000000000",
"vOutro": "0.000000000000",
"vNF": "2040.318000000000",
"vServ": "0.000000000000",
"vTotTrib": "0.000000000000",
"vTeste": null
}
},
"ondemand": false,
"profileNotFound": false,
"usedProfile": {
"saleorPurchase": "S",
"operationnaturecode": "2GT",
"itemtype": "M",
"materialorigin": "0,2,3,4,5,7,8",
"ownproduction": "",
"usage": "C",
"usagePurpose": "",
"shipfromcountry": "",
"shipfromuf": "RJ",
"shiptouf": "",
"shipfromcnae": "",
"shipfromcnpj": "",
"shipfromie": "",
"shipfromibgecode": "",
"shipfromicmscontributor": "",
"shipfromicmsstcontributor": "",
"shipfromipicontributor": "",
"shipfromtaxdeclarationtype": "",
"shipfromtaxregimencode": "",
"shiptocnae": "",
"shiptocnpj": "",
"shiptoibgecode": "",
"shiptoicmscontributor": "N",
"shiptoicmsstcontributor": "",
"shiptoipicontributor": "",
"shiptoisscontributor": "",
"shiptotaxdeclarationtype": "",
"shiptotaxregimencode": "",
"natopicms": "771",
"finalidade": "",
"perfilrem": "2",
"perfildest": "6",
"chaveBanco": "481446_Homolog",
"tipoNF": "1",
"id": "7200",
"quantidadeNulos": 22
}
}
]
Conclusão
A API Trace é extremamente útil para a visualização completa do fluxo que envolve o Tass, pois através dela é possível verificar numa única chamada e retorno o processo completo com a chamada e retorno do Tass, a chamada e retorno do Motor e a Determinação de Perfil e isso facilita muito a análise do usuário.
Versão do documento: 48 | Publicação: 11/17/2023 |