Regras tributárias
Base: https://api.nivesistemas.com.br · 7 endpoints
GET /tax-rules
Seção intitulada “GET /tax-rules”Listar regras tributárias (por NCM)
curl -X GET "https://api.nivesistemas.com.br/tax-rules" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/tax-rules", { method: "GET", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },});const data = await res.json();import requests
res = requests.request( "GET", "https://api.nivesistemas.com.br/tax-rules", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /tax-rules
Seção intitulada “POST /tax-rules”Criar regra
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
ncm |
string | sim | NCM (8 dígitos) |
description |
string | não | Descrição |
cfop |
string | não | CFOP (padrão 5102) |
icmsCsosn |
string | não | CSOSN (padrão 102) |
icmsCst |
string | não | CST ICMS |
pisCst |
string | não | CST PIS |
cofinsCst |
string | não | CST COFINS |
origin |
integer | não | Origem da mercadoria (0–8) |
cest |
string | não | CEST |
active |
boolean | não | Ativa |
curl -X POST "https://api.nivesistemas.com.br/tax-rules" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"ncm":"","description":"","cfop":"","icmsCsosn":"","icmsCst":"","pisCst":"","cofinsCst":"","origin":1,"cest":"","active":true}'const res = await fetch("https://api.nivesistemas.com.br/tax-rules", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "ncm": "", "description": "", "cfop": "", "icmsCsosn": "", "icmsCst": "", "pisCst": "", "cofinsCst": "", "origin": 1, "cest": "", "active": true }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/tax-rules", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "ncm": "", "description": "", "cfop": "", "icmsCsosn": "", "icmsCst": "", "pisCst": "", "cofinsCst": "", "origin": 1, "cest": "", "active": True },)print(res.json())PATCH /tax-rules/:id
Seção intitulada “PATCH /tax-rules/:id”Atualizar regra (NCM não pode ser alterado)
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
description |
string | não | Descrição |
cfop |
string | não | CFOP |
icmsCsosn |
string | não | CSOSN |
icmsCst |
string | não | CST ICMS |
pisCst |
string | não | CST PIS |
cofinsCst |
string | não | CST COFINS |
origin |
integer | não | Origem |
cest |
string | não | CEST |
active |
boolean | não | Ativa |
curl -X PATCH "https://api.nivesistemas.com.br/tax-rules/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"description":"","cfop":"","icmsCsosn":"","icmsCst":"","pisCst":"","cofinsCst":"","origin":1,"cest":"","active":true}'const res = await fetch("https://api.nivesistemas.com.br/tax-rules/{id}", { method: "PATCH", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "description": "", "cfop": "", "icmsCsosn": "", "icmsCst": "", "pisCst": "", "cofinsCst": "", "origin": 1, "cest": "", "active": true }),});const data = await res.json();import requests
res = requests.request( "PATCH", "https://api.nivesistemas.com.br/tax-rules/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "description": "", "cfop": "", "icmsCsosn": "", "icmsCst": "", "pisCst": "", "cofinsCst": "", "origin": 1, "cest": "", "active": True },)print(res.json())DELETE /tax-rules/:id
Seção intitulada “DELETE /tax-rules/:id”Excluir regra
Parâmetros de rota: id
Resposta: 204 No Content
curl -X DELETE "https://api.nivesistemas.com.br/tax-rules/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/tax-rules/{id}", { method: "DELETE", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },});const data = await res.json();import requests
res = requests.request( "DELETE", "https://api.nivesistemas.com.br/tax-rules/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /tax-rules/:id/apply
Seção intitulada “POST /tax-rules/:id/apply”Aplicar a regra a todos os produtos com o mesmo NCM
Parâmetros de rota: id
curl -X POST "https://api.nivesistemas.com.br/tax-rules/{id}/apply" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/tax-rules/{id}/apply", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/tax-rules/{id}/apply", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /tax-rules/seed-profiles
Seção intitulada “GET /tax-rules/seed-profiles”Ramos disponíveis para importar NCM
curl -X GET "https://api.nivesistemas.com.br/tax-rules/seed-profiles" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/tax-rules/seed-profiles", { method: "GET", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },});const data = await res.json();import requests
res = requests.request( "GET", "https://api.nivesistemas.com.br/tax-rules/seed-profiles", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /tax-rules/seed-defaults
Seção intitulada “POST /tax-rules/seed-defaults”Importar NCM e regras do ramo
curl -X POST "https://api.nivesistemas.com.br/tax-rules/seed-defaults" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/tax-rules/seed-defaults", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/tax-rules/seed-defaults", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())
