- Regras fiscais
- Criar regra fiscal
Regras fiscais
Criar regra fiscal
Criar regra fiscal
curl --request POST \
--url https://api.treeunfe.com.br/api/v1/tax-rules \
--header 'x-api-key: <api-key>' \
--header 'x-api-key: <x_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"tpNF": 123.45,
"finNFe": 123.45,
"natOp": "<string>",
"states": "<value>",
"ncmList": "<value>",
"CFOPIntra": 123.45,
"CFOPInter": 123.45,
"CFOPIntraNC": 123.45,
"CFOPInterNC": 123.45,
"CST": "<string>",
"CSTNC": "<string>",
"PICMS": 123.45,
"UseAliqICMS": true,
"PICMSST": 123.45,
"PMVAST": 123.45,
"IndFCP": true,
"IndIPIBCICMS": true,
"IndOutroBCICMS": true,
"CSTIPI": "<string>",
"CEnq": "<string>",
"PIPI": 123.45,
"CSTPIS": "<string>",
"PPIS": 123.45,
"CSTCOFINS": "<string>",
"PCOFINS": 123.45,
"isExcluirICMSFromPisCofinsBC": true,
"PCredSN": 123.45,
"IBSCBSCst": "<string>",
"IBSCBSCClassTrib": "<string>",
"PIBSUF": 123.45,
"PIBSMun": 123.45,
"PCBS": 123.45,
"AdRemICMS": 123.45,
"PRedAdRem": 123.45,
"MotRedAdRem": 123.45,
"VAliqProdCIDE": 123.45,
"IndEmailAuto": true
}'Cria uma regra fiscal da empresa. Ela define CFOP, CST e alíquotas que a emissão com cálculo vai usar para os NCMs e UFs informados. A regra da empresa tem prioridade sobre a regra padrão.
Autenticação
API Key da empresa.
Body
application/json
Tipo da operação: 0 = entrada, 1 = saída.
Finalidade: 1 = normal, 2 = complementar, 3 = ajuste, 4 = devolução.
Natureza da operação, por exemplo Venda.
UFs às quais a regra se aplica.
NCMs cobertos pela regra (8 dígitos).
CFOP para operação dentro do estado, com destinatário contribuinte.
CFOP para operação interestadual, com destinatário contribuinte.
CFOP para operação dentro do estado, com destinatário não contribuinte.
CFOP para operação interestadual, com destinatário não contribuinte.
CST (ou CSOSN) do ICMS para destinatário contribuinte.
CST (ou CSOSN) do ICMS para destinatário não contribuinte.
Alíquota do ICMS (%).
true para usar a alíquota de ICMS informada na regra.
Alíquota do ICMS-ST (%).
Margem de valor agregado da ST (%).
true para calcular o FCP.
true para incluir o IPI na base do ICMS.
true para incluir outras despesas na base do ICMS.
CST do IPI.
Código de enquadramento do IPI. Ex.: 999.
Alíquota do IPI (%).
CST do PIS.
Alíquota do PIS (%).
CST da COFINS.
Alíquota da COFINS (%).
true para excluir o ICMS da base de PIS e COFINS.
Alíquota de crédito do Simples Nacional (%).
CST do IBS/CBS.
Classificação tributária (cClassTrib) do IBS/CBS.
Alíquota do IBS estadual (%).
Alíquota do IBS municipal (%).
Alíquota da CBS (%).
Alíquota ad rem do ICMS monofásico (combustíveis).
Percentual de redução da alíquota ad rem.
Motivo da redução da alíquota ad rem.
Alíquota da CIDE por unidade.
true para enviar a nota por e-mail automaticamente.
Respostas
| Status | Descrição |
|---|---|
201 | Regra criada. |
400 | Body inválido. |
401 | x-api-key ausente ou inválida. |
curl -X POST "https://api.treeunfe.com.br/api/v1/tax-rules" \
-H "x-api-key: SUA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tpNF": 1,
"finNFe": 1,
"natOp": "Venda",
"states": [
"PR"
],
"ncmList": [
"85176241"
],
"CFOPIntra": 5102,
"CFOPInter": 6102,
"CFOPIntraNC": 5102,
"CFOPInterNC": 6102,
"CST": "00",
"CSTNC": "00",
"CSTIPI": "53",
"CEnq": "999",
"CSTPIS": "07",
"CSTCOFINS": "07",
"IndFCP": true,
"IndIPIBCICMS": false,
"IndOutroBCICMS": true,
"isExcluirICMSFromPisCofinsBC": false,
"IndEmailAuto": false
}'
curl -X POST "https://api.treeunfe.com.br/api/v1/tax-rules" \
-H "x-api-key: SUA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tpNF": 1,
"finNFe": 1,
"natOp": "Venda",
"states": [
"PR"
],
"ncmList": [
"85176241"
],
"CFOPIntra": 5102,
"CFOPInter": 6102,
"CFOPIntraNC": 5102,
"CFOPInterNC": 6102,
"CST": "00",
"CSTNC": "00",
"CSTIPI": "53",
"CEnq": "999",
"CSTPIS": "07",
"CSTCOFINS": "07",
"IndFCP": true,
"IndIPIBCICMS": false,
"IndOutroBCICMS": true,
"isExcluirICMSFromPisCofinsBC": false,
"IndEmailAuto": false
}'
curl --request POST \
--url https://api.treeunfe.com.br/api/v1/tax-rules \
--header 'x-api-key: <api-key>' \
--header 'x-api-key: <x_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"tpNF": 123.45,
"finNFe": 123.45,
"natOp": "<string>",
"states": "<value>",
"ncmList": "<value>",
"CFOPIntra": 123.45,
"CFOPInter": 123.45,
"CFOPIntraNC": 123.45,
"CFOPInterNC": 123.45,
"CST": "<string>",
"CSTNC": "<string>",
"PICMS": 123.45,
"UseAliqICMS": true,
"PICMSST": 123.45,
"PMVAST": 123.45,
"IndFCP": true,
"IndIPIBCICMS": true,
"IndOutroBCICMS": true,
"CSTIPI": "<string>",
"CEnq": "<string>",
"PIPI": 123.45,
"CSTPIS": "<string>",
"PPIS": 123.45,
"CSTCOFINS": "<string>",
"PCOFINS": 123.45,
"isExcluirICMSFromPisCofinsBC": true,
"PCredSN": 123.45,
"IBSCBSCst": "<string>",
"IBSCBSCClassTrib": "<string>",
"PIBSUF": 123.45,
"PIBSMun": 123.45,
"PCBS": 123.45,
"AdRemICMS": 123.45,
"PRedAdRem": 123.45,
"MotRedAdRem": 123.45,
"VAliqProdCIDE": 123.45,
"IndEmailAuto": true
}'