/api/category/editEdit tax category
Edits an existing tax category. The body is identical to /api/category/create, the only difference being that category_id is required and must match an existing category. The upsert fully replaces the icms, ipi, pis, cofins, ibs_cbs, is arrays — send all updated scenarios (there is no per-scenario merge; omitting ibs_cbs deletes the IBS/CBS scenarios).
Reusing the get_detail JSON: it can be sent back unchanged. All fields returned by get_detail (including aliquota_reducao_st, motivo_desoneracao_st, aliquota_diferimento, aliquota_diferimento_fcp and is) are accepted, and no data is lost.
Required headers
tokenstring | string | Company token |
signstring | string | MD5 signature |
timestampstring | string | Unix timestamp in seconds |
Body
The full body structure is documented in /api/category/create. Only category_id is handled differently here:
category_*string | string | ID of the category to edit (must exist; otherwise returns an error). If the ID belongs to another company of the same user (uid), edit creates a copy in the authenticated company instead of changing it |
descricao*string | string | Description (the key is required; an empty value is accepted and saved) |
icms[]*array | array | ICMS scenarios (fully replaces) |
ipi[]*array | array | IPI scenarios |
pis[]*array | array | PIS scenarios |
cofins[]*array | array | COFINS scenarios |
ibs_array | array | IBS/CBS scenarios (optional) |
is[]array | array | IS scenarios (optional) — omitting it erases the IS scenarios |
disable_boolean | boolean | Zeroes the DIFAL (see /api/category/create).Default: false. In edit, omitting it resets it to false |
desconta_boolean | boolean | When true, the line's ICMS is deducted from the PIS/COFINS base and, in interstate sales to non-taxpayer final consumers, so is the destination-state DIFAL; the base becomes (base − ICMS − DIFAL), with a minimum of 0; applies only to percentage-based PIS/COFINS. Default false: the base does not deduct ICMS. In edit, omitting it resets it to false |
desconta_boolean | boolean | Computes the IBS/CBS base with the official RFB formula (unified base of the regular-regime calculator): item value (product + freight + insurance + other − discount) + II − ICMS − FCP − single-phase ICMS − DIFAL and destination-state FCP − ISSQN − PIS − COFINS, floor 0 (PIS and COFINS are only deducted in 2026); if desconta_icms_pis_cofins is also true, the already-reduced PIS/COFINS is used; default false. In edit, omitting it resets it to false |
* Required field. For the inner fields of each array (icms[].codigo_cfop etc.), see /api/category/create.
Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/category/edit" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"success": true,
"data": {
"category_id": "TF123"
}
}