Comercial B2B — pedidos e orçamentos
Módulo comercial da indústria (segmentos de fábrica; nos demais responde 404). Pedidos e orçamentos B2B com preço por tabela, perfil e região, aprovação e faturamento parcial. Representante com carteira restrita só enxerga os próprios clientes.
Base: https://api.nivesistemas.com.br · 24 endpoints
GET /commercial/me
Seção intitulada “GET /commercial/me”O que o usuário pode fazer no comercial (carteira, aprovar, ver custo) e os perfis de cliente
curl -X GET "https://api.nivesistemas.com.br/commercial/me" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/me", { 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/commercial/me", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /commercial/industry-checklist
Seção intitulada “GET /commercial/industry-checklist”Checklist de implantação do módulo industrial
curl -X GET "https://api.nivesistemas.com.br/commercial/industry-checklist" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/industry-checklist", { 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/commercial/industry-checklist", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /commercial/settings
Seção intitulada “GET /commercial/settings”Configuração comercial (comissão, margem mínima, validade do orçamento, prazos)
curl -X GET "https://api.nivesistemas.com.br/commercial/settings" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/settings", { 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/commercial/settings", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())PUT /commercial/settings
Seção intitulada “PUT /commercial/settings”Alterar a configuração comercial
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
commissionBasis |
string | sim | RECEIVED (sobre o recebido) ou INVOICED (sobre o faturado) |
deductReturns |
boolean | sim | Descontar devoluções da comissão |
minMarginPercent |
number | não | Margem mínima em %; nulo desliga o aviso |
discountApprovalPercent |
number | não | Desconto a partir do qual o pedido exige aprovação |
quoteValidityDays |
number | sim | Validade padrão do orçamento em dias |
defaultDeliveryDays |
number | não | Prazo de entrega padrão |
defaultPaymentTerms |
string | não | Prazo padrão, ex.: “30/60/90” |
commissionStartsAt |
string | não | Data a partir da qual a comissão é apurada |
purchaseApprovalAmount |
number | não | Valor de cotação de compra que exige aprovação |
pisCofinsRegime |
string | sim | CUMULATIVE ou NON_CUMULATIVE (créditos de PIS/COFINS) |
curl -X PUT "https://api.nivesistemas.com.br/commercial/settings" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"commissionBasis":"","deductReturns":true,"minMarginPercent":0,"discountApprovalPercent":0,"quoteValidityDays":0,"defaultDeliveryDays":0,"defaultPaymentTerms":"","commissionStartsAt":"","purchaseApprovalAmount":0,"pisCofinsRegime":""}'const res = await fetch("https://api.nivesistemas.com.br/commercial/settings", { method: "PUT", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "commissionBasis": "", "deductReturns": true, "minMarginPercent": 0, "discountApprovalPercent": 0, "quoteValidityDays": 0, "defaultDeliveryDays": 0, "defaultPaymentTerms": "", "commissionStartsAt": "", "purchaseApprovalAmount": 0, "pisCofinsRegime": "" }),});const data = await res.json();import requests
res = requests.request( "PUT", "https://api.nivesistemas.com.br/commercial/settings", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "commissionBasis": "", "deductReturns": True, "minMarginPercent": 0, "discountApprovalPercent": 0, "quoteValidityDays": 0, "defaultDeliveryDays": 0, "defaultPaymentTerms": "", "commissionStartsAt": "", "purchaseApprovalAmount": 0, "pisCofinsRegime": "" },)print(res.json())GET /commercial/customers/search
Seção intitulada “GET /commercial/customers/search”Buscar clientes para o pedido (respeita a carteira do representante)
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
q |
string | não | Nome, apelido ou CPF/CNPJ |
curl -X GET "https://api.nivesistemas.com.br/commercial/customers/search" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/customers/search", { 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/commercial/customers/search", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /commercial/products/search
Seção intitulada “GET /commercial/products/search”Buscar produtos com o preço já resolvido para o cliente
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
q |
string | sim | Descrição, código interno ou GTIN (mín. 2 caracteres) |
customerId |
string | não | Cliente, para aplicar a tabela e o perfil dele |
curl -X GET "https://api.nivesistemas.com.br/commercial/products/search" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/products/search", { 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/commercial/products/search", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /commercial/lookups
Seção intitulada “GET /commercial/lookups”Formas de pagamento, transportadoras, tabelas comerciais e representantes
curl -X GET "https://api.nivesistemas.com.br/commercial/lookups" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/lookups", { 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/commercial/lookups", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /commercial/orders
Seção intitulada “GET /commercial/orders”Listar pedidos e orçamentos B2B
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
page |
number | não | Página (padrão 1) |
pageSize |
number | não | Itens por página (padrão 25, máx. 100) |
q |
string | não | Número do pedido ou cliente |
status |
string | não | DRAFT, QUOTE_SENT, APPROVED, PARTIALLY_INVOICED e os demais status do pedido |
kind |
string | não | SALE, BONUS, SAMPLE ou CONSIGNMENT |
customerId |
string | não | Filtrar por cliente |
representativeId |
string | não | Filtrar por representante |
curl -X GET "https://api.nivesistemas.com.br/commercial/orders" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/orders", { 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/commercial/orders", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /commercial/orders/preview-prices
Seção intitulada “POST /commercial/orders/preview-prices”Simular os preços dos itens antes de gravar (não grava nada)
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
items |
array | sim | { variantId, quantity } |
customerId |
string | não | Cliente |
priceListId |
string | não | Tabela de preço |
curl -X POST "https://api.nivesistemas.com.br/commercial/orders/preview-prices" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"items":[],"customerId":"","priceListId":""}'const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/preview-prices", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "items": [], "customerId": "", "priceListId": "" }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/commercial/orders/preview-prices", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "items": [], "customerId": "", "priceListId": "" },)print(res.json())POST /commercial/orders
Seção intitulada “POST /commercial/orders”Criar pedido ou orçamento B2B
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
customerId |
string | sim | Cliente do pedido |
items |
array | sim | 1 a 300 itens: { variantId, quantity, discountPercent?, notes? } |
kind |
string | não | SALE (padrão), BONUS (bonificação), SAMPLE (amostra) ou CONSIGNMENT (consignação) |
representativeId |
string | não | Representante (padrão: o da carteira do cliente) |
priceListId |
string | não | Tabela de preço comercial; sem ela o preço é resolvido por cliente, perfil e região |
paymentTerms |
string | não | Prazo em dias separados por barra, ex.: “30/60/90” |
paymentMethodId |
string | não | Forma de pagamento |
deliveryDays |
number | não | Prazo de entrega em dias |
deliveryDate |
string | não | Data de entrega prevista (ISO) |
validUntil |
string | não | Validade do orçamento (ISO) |
carrierId |
string | não | Transportadora |
shippingAmount |
number | não | Frete em reais |
discountPercent |
number | não | Desconto geral em % (acima do limite configurado exige aprovação) |
notes |
string | não | Observação que sai no orçamento |
internalNotes |
string | não | Observação interna |
Resposta: 201 Created
curl -X POST "https://api.nivesistemas.com.br/commercial/orders" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"customerId":"","items":[],"kind":"","representativeId":"","priceListId":"","paymentTerms":"","paymentMethodId":"","deliveryDays":0,"deliveryDate":"","validUntil":"","carrierId":"","shippingAmount":0,"discountPercent":0,"notes":"","internalNotes":""}'const res = await fetch("https://api.nivesistemas.com.br/commercial/orders", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "customerId": "", "items": [], "kind": "", "representativeId": "", "priceListId": "", "paymentTerms": "", "paymentMethodId": "", "deliveryDays": 0, "deliveryDate": "", "validUntil": "", "carrierId": "", "shippingAmount": 0, "discountPercent": 0, "notes": "", "internalNotes": "" }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/commercial/orders", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "customerId": "", "items": [], "kind": "", "representativeId": "", "priceListId": "", "paymentTerms": "", "paymentMethodId": "", "deliveryDays": 0, "deliveryDate": "", "validUntil": "", "carrierId": "", "shippingAmount": 0, "discountPercent": 0, "notes": "", "internalNotes": "" },)print(res.json())GET /commercial/orders/:id
Seção intitulada “GET /commercial/orders/:id”Detalhe do pedido (itens, faturamentos, saldo)
Parâmetros de rota: id
curl -X GET "https://api.nivesistemas.com.br/commercial/orders/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{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/commercial/orders/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())PUT /commercial/orders/:id
Seção intitulada “PUT /commercial/orders/:id”Alterar pedido ainda não faturado
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
customerId |
string | sim | Cliente do pedido |
items |
array | sim | 1 a 300 itens: { variantId, quantity, discountPercent?, notes? } |
kind |
string | não | SALE (padrão), BONUS (bonificação), SAMPLE (amostra) ou CONSIGNMENT (consignação) |
representativeId |
string | não | Representante (padrão: o da carteira do cliente) |
priceListId |
string | não | Tabela de preço comercial; sem ela o preço é resolvido por cliente, perfil e região |
paymentTerms |
string | não | Prazo em dias separados por barra, ex.: “30/60/90” |
paymentMethodId |
string | não | Forma de pagamento |
deliveryDays |
number | não | Prazo de entrega em dias |
deliveryDate |
string | não | Data de entrega prevista (ISO) |
validUntil |
string | não | Validade do orçamento (ISO) |
carrierId |
string | não | Transportadora |
shippingAmount |
number | não | Frete em reais |
discountPercent |
number | não | Desconto geral em % (acima do limite configurado exige aprovação) |
notes |
string | não | Observação que sai no orçamento |
internalNotes |
string | não | Observação interna |
curl -X PUT "https://api.nivesistemas.com.br/commercial/orders/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"customerId":"","items":[],"kind":"","representativeId":"","priceListId":"","paymentTerms":"","paymentMethodId":"","deliveryDays":0,"deliveryDate":"","validUntil":"","carrierId":"","shippingAmount":0,"discountPercent":0,"notes":"","internalNotes":""}'const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{id}", { method: "PUT", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "customerId": "", "items": [], "kind": "", "representativeId": "", "priceListId": "", "paymentTerms": "", "paymentMethodId": "", "deliveryDays": 0, "deliveryDate": "", "validUntil": "", "carrierId": "", "shippingAmount": 0, "discountPercent": 0, "notes": "", "internalNotes": "" }),});const data = await res.json();import requests
res = requests.request( "PUT", "https://api.nivesistemas.com.br/commercial/orders/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "customerId": "", "items": [], "kind": "", "representativeId": "", "priceListId": "", "paymentTerms": "", "paymentMethodId": "", "deliveryDays": 0, "deliveryDate": "", "validUntil": "", "carrierId": "", "shippingAmount": 0, "discountPercent": 0, "notes": "", "internalNotes": "" },)print(res.json())DELETE /commercial/orders/:id
Seção intitulada “DELETE /commercial/orders/:id”Excluir pedido em rascunho
Parâmetros de rota: id
Resposta: 204 No Content
curl -X DELETE "https://api.nivesistemas.com.br/commercial/orders/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{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/commercial/orders/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /commercial/orders/:id/stock-check
Seção intitulada “GET /commercial/orders/:id/stock-check”Conferir se há estoque para atender o pedido
Parâmetros de rota: id
curl -X GET "https://api.nivesistemas.com.br/commercial/orders/{id}/stock-check" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{id}/stock-check", { 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/commercial/orders/{id}/stock-check", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /commercial/orders/:id/approve
Seção intitulada “POST /commercial/orders/:id/approve”Aprovar o pedido
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
allowShortage |
boolean | não | Aprovar mesmo faltando estoque |
curl -X POST "https://api.nivesistemas.com.br/commercial/orders/{id}/approve" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"allowShortage":true}'const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{id}/approve", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "allowShortage": true }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/commercial/orders/{id}/approve", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "allowShortage": True },)print(res.json())POST /commercial/orders/:id/reopen
Seção intitulada “POST /commercial/orders/:id/reopen”Reabrir pedido aprovado para edição
Parâmetros de rota: id
curl -X POST "https://api.nivesistemas.com.br/commercial/orders/{id}/reopen" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{id}/reopen", { 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/commercial/orders/{id}/reopen", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /commercial/orders/:id/cancel
Seção intitulada “POST /commercial/orders/:id/cancel”Cancelar o pedido
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
reason |
string | sim | Motivo (5 a 300 caracteres) |
curl -X POST "https://api.nivesistemas.com.br/commercial/orders/{id}/cancel" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"reason":""}'const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{id}/cancel", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "reason": "" }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/commercial/orders/{id}/cancel", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "reason": "" },)print(res.json())POST /commercial/orders/:id/close-balance
Seção intitulada “POST /commercial/orders/:id/close-balance”Encerrar o saldo que não será mais faturado
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
reason |
string | sim | Motivo (5 a 300 caracteres) |
curl -X POST "https://api.nivesistemas.com.br/commercial/orders/{id}/close-balance" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"reason":""}'const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{id}/close-balance", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "reason": "" }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/commercial/orders/{id}/close-balance", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "reason": "" },)print(res.json())POST /commercial/orders/:id/send
Seção intitulada “POST /commercial/orders/:id/send”Enviar o orçamento ao cliente
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
via |
string | sim | EMAIL, WHATSAPP ou MANUAL (só marca como enviado) |
email |
string | não | E-mail de destino (padrão: o do cadastro) |
phone |
string | não | Celular de destino (padrão: o do cadastro) |
curl -X POST "https://api.nivesistemas.com.br/commercial/orders/{id}/send" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"via":"","email":"","phone":""}'const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{id}/send", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "via": "", "email": "", "phone": "" }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/commercial/orders/{id}/send", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "via": "", "email": "", "phone": "" },)print(res.json())GET /commercial/orders/:id/pdf
Seção intitulada “GET /commercial/orders/:id/pdf”PDF do orçamento ou pedido
Parâmetros de rota: id
Resposta: application/pdf
curl -X GET "https://api.nivesistemas.com.br/commercial/orders/{id}/pdf" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{id}/pdf", { 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/commercial/orders/{id}/pdf", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /commercial/orders/:id/invoice
Seção intitulada “POST /commercial/orders/:id/invoice”Faturar o pedido, inteiro ou em parte (gera a venda e a NF-e)
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
lines |
array | sim | { itemId, quantity } do que entra neste faturamento |
emitNow |
boolean | não | Transmitir a NF-e agora (padrão true) |
paymentMethodId |
string | não | Forma de pagamento (padrão: a do pedido) |
nfeExtras |
object | não | Dados de transporte da NF-e (frete, veículo, volumes) |
notes |
string | não | Observação |
Resposta: 201 Created. Exige commercial.manage.
curl -X POST "https://api.nivesistemas.com.br/commercial/orders/{id}/invoice" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"lines":[],"emitNow":true,"paymentMethodId":"","nfeExtras":null,"notes":""}'const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{id}/invoice", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "lines": [], "emitNow": true, "paymentMethodId": "", "nfeExtras": null, "notes": "" }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/commercial/orders/{id}/invoice", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "lines": [], "emitNow": True, "paymentMethodId": "", "nfeExtras": None, "notes": "" },)print(res.json())GET /commercial/orders/:id/receivables
Seção intitulada “GET /commercial/orders/:id/receivables”Títulos a receber gerados pelo pedido
Parâmetros de rota: id
curl -X GET "https://api.nivesistemas.com.br/commercial/orders/{id}/receivables" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/orders/{id}/receivables", { 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/commercial/orders/{id}/receivables", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /commercial/commission/mine
Seção intitulada “GET /commercial/commission/mine”Extrato de comissão do representante logado
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
competence |
string | não | Mês AAAA-MM (padrão: o atual) |
curl -X GET "https://api.nivesistemas.com.br/commercial/commission/mine" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/commission/mine", { 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/commercial/commission/mine", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /commercial/commission/sync
Seção intitulada “POST /commercial/commission/sync”Recalcular o livro de comissões (exige commissions.manage)
curl -X POST "https://api.nivesistemas.com.br/commercial/commission/sync" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/commercial/commission/sync", { 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/commercial/commission/sync", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())
