← HomeFleetPay / Schema

FiscalTaxRuleCreate

Structure preserved from the versioned API contract.

Technical descriptions are translated from the versioned contract. Original identifiers and JSON are preserved; data examples are omitted.

cfop and icms_variante are always required. aliquota is required for ICMS00, ICMS20, ICMS90 and ICMSOutraUF, and prohibited for other variants; p_red_bc is required for ICMS20, ICMS90 and ICMSOutraUF, and prohibited for other variants (sending a field outside its applicable variant returns 422). Other fields are optional and nullable. Validity is a filter: rules outside the valid_from/valid_until window are not considered during issuance.

The IBS/CBS fields form a block: supplying any of the three rates (ibs_uf_aliquota, ibs_mun_aliquota, cbs_aliquota) makes the rule govern all three, with omitted rates treated as zero — zero is also a tax decision. Rates accept 4 decimal places because reductions under LC 214/2025 produce percentages such as 0.8825.

origin_statestring | nullOptional

Origin state; null (or omitted) means any origin.

minLength2
maxLength2
destination_statestring | nullOptional

Destination state; null (or omitted) means any destination.

minLength2
maxLength2
tp_servinteger | nullOptional

Service type (ide/tpServ) to which the rule applies; null (or omitted) = any type. 0 normal, 1 subcontracting, 2 onward carriage, 3 intermediate onward carriage; 4 (multimodal) is not accepted. A rule matching the service type takes precedence over any route-only rule.

0 · 1 · 2 · 3 · null
cfopstring | nullRequired

Required. CFOP recorded by the engine for the service. For counter-CT-e documents using a rule without tp_serv, only the operation digit (5xxx/6xxx) is taken from it; the final code comes from the route (5360/6360 or 5932/6932). With a type-specific rule, its CFOP is retained when the service starts in the issuer's state (the mandatory 5932/6932 still applies when the service starts in another state).

pattern"^\\d{4}$"
cststring | nullOptional

Only for ICMS45, where it is required (40, 41 or 51). For other variants, this field is ignored — the server derives the CST from the variant (ICMS00→00, ICMS20→20, ICMS60→60, ICMS90/ICMSOutraUF/ICMSSN→90).

"40" · "41" · "51" · null
aliquotanumber | null · doubleOptional

ICMS rate. Required for ICMS00, ICMS20, ICMS90 and ICMSOutraUF; prohibited for ICMS45, ICMS60 and ICMSSN.

minimum0
maximum100
p_red_bcnumber | null · doubleOptional

ICMS tax-base reduction percentage. Required for ICMS20, ICMS90 and ICMSOutraUF; prohibited for other variants.

minimum0
maximum100
ibs_cbs_cststring | nullOptional

IBS/CBS CST with 3 digits, e.g. 000 for full taxation. Do not confuse it with the 2-digit ICMS cst: they use different vocabularies.

pattern"^\\d{3}$"
ibs_cbs_class_tribstring | nullOptional

IBS/CBS tax classification, with 6 digits — e.g. 000001.

pattern"^\\d{6}$"
ibs_uf_aliquotanumber | null · doubleOptional

State IBS tax rate, as a percentage, with up to 4 decimal places.

minimum0
maximum100
ibs_mun_aliquotanumber | null · doubleOptional

Municipal IBS tax rate, as a percentage, with up to 4 decimal places.

minimum0
maximum100
cbs_aliquotanumber | null · doubleOptional

CBS tax rate, as a percentage, with up to 4 decimal places.

minimum0
maximum100
ibs_cbs_p_red_bcnumber | null · doubleOptional

IBS/CBS tax-base reduction percentage, with up to 4 decimal places. Applied before tax rates.

minimum0
maximum100
valid_fromstring | null · dateOptional
valid_untilstring | null · dateOptional

Cannot be earlier than valid_from.

notesstring | nullOptional
maxLength255
Original JSON Definition (Portuguese Descriptions)
{
  "type": "object",
  "required": [
    "cfop",
    "icms_variante"
  ],
  "description": "`cfop` e `icms_variante` são sempre obrigatórios. `aliquota` é obrigatória em `ICMS00`,\n`ICMS20`, `ICMS90` e `ICMSOutraUF` e proibida nas demais; `p_red_bc` é obrigatória em\n`ICMS20`, `ICMS90` e `ICMSOutraUF` e proibida nas demais (enviar fora da variante\nresponde `422`). Os outros campos são opcionais e anuláveis. A vigência é filtro:\nregra fora da janela `valid_from`/`valid_until` não é considerada na emissão.\n\nOs campos de IBS/CBS formam um bloco: informar qualquer uma das três alíquotas\n(`ibs_uf_aliquota`, `ibs_mun_aliquota`, `cbs_aliquota`) faz a regra responder pelas\ntrês, e as deixadas em branco valem zero — zero também é decisão tributária. As\nalíquotas aceitam 4 casas decimais porque as reduções da LC 214/2025 produzem\npercentuais como `0.8825`.\n",
  "properties": {
    "origin_state": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 2,
      "maxLength": 2,
      "description": "UF de origem; `null` (ou omitido) = qualquer origem."
    },
    "destination_state": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 2,
      "maxLength": 2,
      "description": "UF de destino; `null` (ou omitido) = qualquer destino."
    },
    "tp_serv": {
      "type": [
        "integer",
        "null"
      ],
      "enum": [
        0,
        1,
        2,
        3,
        null
      ],
      "description": "Tipo de serviço (`ide/tpServ`) a que a regra se aplica; `null` (ou omitido) =\nqualquer tipo. `0` normal, `1` subcontratação, `2` redespacho, `3` redespacho\nintermediário; o `4` (multimodal) não é aceito. Regra com tipo casado vence\nqualquer regra só de rota.\n"
    },
    "cfop": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{4}$",
      "description": "Obrigatório. CFOP que o motor grava na prestação. Nos contra-CT-e com regra sem\n`tp_serv` só empresta o dígito de operação (5xxx/6xxx) e o código final vem da rota\n(`5360`/`6360` ou `5932`/`6932`); com regra do tipo, o CFOP dela é mantido quando a\nprestação começa na UF do emitente (o `5932`/`6932` de prestação iniciada em outra UF\ncontinua imposto).\n"
    },
    "icms_variante": {
      "$ref": "#/components/schemas/FiscalTaxRuleIcmsVariant"
    },
    "cst": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "40",
        "41",
        "51",
        null
      ],
      "description": "Só para `ICMS45`, e nela é obrigatório (`40`, `41` ou `51`). Nas demais variantes o\ncampo é ignorado — o CST é derivado da variante no servidor (`ICMS00`→`00`,\n`ICMS20`→`20`, `ICMS60`→`60`, `ICMS90`/`ICMSOutraUF`/`ICMSSN`→`90`).\n"
    },
    "aliquota": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "minimum": 0,
      "maximum": 100,
      "description": "Percentual do ICMS. Obrigatório em `ICMS00`, `ICMS20`, `ICMS90` e `ICMSOutraUF`;\nproibido em `ICMS45`, `ICMS60` e `ICMSSN`.\n"
    },
    "p_red_bc": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "minimum": 0,
      "maximum": 100,
      "description": "Redução da base de cálculo do ICMS, em percentual. Obrigatória em `ICMS20`,\n`ICMS90` e `ICMSOutraUF`; proibida nas demais variantes.\n"
    },
    "ibs_cbs_cst": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{3}$",
      "description": "CST de IBS/CBS, com 3 dígitos — ex.: `000`, tributação integral. Não confundir com o\n`cst` do ICMS, de 2 dígitos: são vocabulários diferentes.\n"
    },
    "ibs_cbs_class_trib": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{6}$",
      "description": "Classificação tributária de IBS/CBS, com 6 dígitos — ex.: `000001`.\n"
    },
    "ibs_uf_aliquota": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "minimum": 0,
      "maximum": 100,
      "description": "Alíquota do IBS estadual, em percentual, com até 4 casas decimais."
    },
    "ibs_mun_aliquota": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "minimum": 0,
      "maximum": 100,
      "description": "Alíquota do IBS municipal, em percentual, com até 4 casas decimais."
    },
    "cbs_aliquota": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "minimum": 0,
      "maximum": 100,
      "description": "Alíquota da CBS, em percentual, com até 4 casas decimais."
    },
    "ibs_cbs_p_red_bc": {
      "type": [
        "number",
        "null"
      ],
      "format": "double",
      "minimum": 0,
      "maximum": 100,
      "description": "Redução da base de cálculo de IBS/CBS, em percentual, com até 4 casas decimais.\nAplicada antes das alíquotas.\n"
    },
    "valid_from": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "valid_until": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "Não pode ser anterior a `valid_from`."
    },
    "notes": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 255
    }
  }
}