Locais (filiais e depósitos)
Locais de estoque da rede: lojas (STORE) e depósitos (WAREHOUSE). Escrita exige o recurso de multi-loja no plano e a permissão de configurações do sistema. Usuários sem acesso a todos os locais só enxergam os locais liberados para eles.
Base: https://api.nivesistemas.com.br · 6 endpoints
GET /locations
Seção intitulada “GET /locations”Listar locais
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
includeInactive |
boolean | não | Incluir locais inativos (1/true) |
curl -X GET "https://api.nivesistemas.com.br/locations" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/locations", { 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/locations", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /locations/transfer-destinations
Seção intitulada “GET /locations/transfer-destinations”Locais que podem receber transferência de estoque
curl -X GET "https://api.nivesistemas.com.br/locations/transfer-destinations" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/locations/transfer-destinations", { 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/locations/transfer-destinations", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /locations/:id
Seção intitulada “GET /locations/:id”Detalhe do local
Parâmetros de rota: id
curl -X GET "https://api.nivesistemas.com.br/locations/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/locations/{id}", { 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/locations/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /locations
Seção intitulada “POST /locations”Criar local
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name |
string | sim | Nome (até 200) |
code |
string | não | Código interno (até 40) |
type |
string | não | STORE ou WAREHOUSE |
active |
boolean | não | Ativo |
addressLine1 |
string | não | Endereço |
addressLine2 |
string | não | Complemento |
city |
string | não | Cidade |
state |
string | não | UF (2 letras) |
zipCode |
string | não | CEP |
Resposta: 201 Created
curl -X POST "https://api.nivesistemas.com.br/locations" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"name":"Exemplo","code":"","type":"","active":true,"addressLine1":"","addressLine2":"","city":"","state":"","zipCode":""}'const res = await fetch("https://api.nivesistemas.com.br/locations", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "name": "Exemplo", "code": "", "type": "", "active": true, "addressLine1": "", "addressLine2": "", "city": "", "state": "", "zipCode": "" }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/locations", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "name": "Exemplo", "code": "", "type": "", "active": True, "addressLine1": "", "addressLine2": "", "city": "", "state": "", "zipCode": "" },)print(res.json())PATCH /locations/:id
Seção intitulada “PATCH /locations/:id”Atualizar local (campos da criação, todos opcionais)
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
isDefault |
boolean | não | Tornar o local padrão |
curl -X PATCH "https://api.nivesistemas.com.br/locations/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"isDefault":true}'const res = await fetch("https://api.nivesistemas.com.br/locations/{id}", { method: "PATCH", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "isDefault": true }),});const data = await res.json();import requests
res = requests.request( "PATCH", "https://api.nivesistemas.com.br/locations/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "isDefault": True },)print(res.json())PUT /locations/:id/fiscal
Seção intitulada “PUT /locations/:id/fiscal”Perfil fiscal da filial (CNPJ próprio, IE, série NFC-e, CSC)
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
fiscalCnpj |
string | não | CNPJ da filial |
fiscalStateRegistration |
string | não | Inscrição estadual |
fiscalMunicipalRegistration |
string | não | Inscrição municipal |
fiscalLegalName |
string | não | Razão social |
fiscalTradeName |
string | não | Nome fantasia |
fiscalAddressNumber |
string | não | Número do endereço |
fiscalAddressDistrict |
string | não | Bairro |
fiscalIbgeCityCode |
string | não | Código IBGE do município |
fiscalPhone |
string | não | Telefone |
fiscalNfceSeries |
integer | não | Série da NFC-e (1–889) |
fiscalNfceNextNumber |
integer | não | Próximo número da NFC-e |
fiscalCscId |
string | não | ID do CSC (produção) |
fiscalCscToken |
string | não | Token do CSC (produção) |
fiscalCscIdHomolog |
string | não | ID do CSC (homologação) |
fiscalCscTokenHomolog |
string | não | Token do CSC (homologação) |
curl -X PUT "https://api.nivesistemas.com.br/locations/{id}/fiscal" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"fiscalCnpj":"","fiscalStateRegistration":"","fiscalMunicipalRegistration":"","fiscalLegalName":"","fiscalTradeName":"","fiscalAddressNumber":"","fiscalAddressDistrict":"","fiscalIbgeCityCode":"","fiscalPhone":"","fiscalNfceSeries":1,"fiscalNfceNextNumber":1,"fiscalCscId":"","fiscalCscToken":"","fiscalCscIdHomolog":"","fiscalCscTokenHomolog":""}'const res = await fetch("https://api.nivesistemas.com.br/locations/{id}/fiscal", { method: "PUT", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "fiscalCnpj": "", "fiscalStateRegistration": "", "fiscalMunicipalRegistration": "", "fiscalLegalName": "", "fiscalTradeName": "", "fiscalAddressNumber": "", "fiscalAddressDistrict": "", "fiscalIbgeCityCode": "", "fiscalPhone": "", "fiscalNfceSeries": 1, "fiscalNfceNextNumber": 1, "fiscalCscId": "", "fiscalCscToken": "", "fiscalCscIdHomolog": "", "fiscalCscTokenHomolog": "" }),});const data = await res.json();import requests
res = requests.request( "PUT", "https://api.nivesistemas.com.br/locations/{id}/fiscal", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "fiscalCnpj": "", "fiscalStateRegistration": "", "fiscalMunicipalRegistration": "", "fiscalLegalName": "", "fiscalTradeName": "", "fiscalAddressNumber": "", "fiscalAddressDistrict": "", "fiscalIbgeCityCode": "", "fiscalPhone": "", "fiscalNfceSeries": 1, "fiscalNfceNextNumber": 1, "fiscalCscId": "", "fiscalCscToken": "", "fiscalCscIdHomolog": "", "fiscalCscTokenHomolog": "" },)print(res.json())
