Produção (receitas e ordens)
Ficha técnica e ordens de produção (padaria, confeitaria, cozinha): a ordem baixa os insumos e dá entrada no produto acabado.
Base: https://api.nivesistemas.com.br · 26 endpoints
GET /bakery-production/status
Seção intitulada “GET /bakery-production/status”Módulos ligados na loja (produção, código de balança, encomendas)
curl -X GET "https://api.nivesistemas.com.br/bakery-production/status" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/status", { 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/bakery-production/status", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /bakery-production/recipes
Seção intitulada “GET /bakery-production/recipes”Listar receitas
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
active |
boolean | não | Somente ativas (1/true) |
curl -X GET "https://api.nivesistemas.com.br/bakery-production/recipes" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes", { 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/bakery-production/recipes", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /bakery-production/recipes
Seção intitulada “POST /bakery-production/recipes”Criar receita
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name |
string | sim | Nome |
finishedVariantId |
uuid | sim | Produto acabado (variante) |
yieldQty |
number | não | Rendimento por lote (padrão 1) |
notes |
string | não | Observações |
items |
array | sim | Insumos: [{ componentVariantId, quantity }] |
densityKgPerL |
number | não | Densidade do acabado (kg/L) |
expectedLossPercent |
number | não | Perda esperada do processo, de 0 a 99,99 (%) |
stages |
array | não | Etapas-modelo: [“Pesagem”, “Dispersão”, …] |
Resposta: 201 Created
curl -X POST "https://api.nivesistemas.com.br/bakery-production/recipes" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"name":"Exemplo","finishedVariantId":"00000000-0000-0000-0000-000000000000","yieldQty":0,"notes":"","items":[],"densityKgPerL":0,"expectedLossPercent":0,"stages":[]}'const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "name": "Exemplo", "finishedVariantId": "00000000-0000-0000-0000-000000000000", "yieldQty": 0, "notes": "", "items": [], "densityKgPerL": 0, "expectedLossPercent": 0, "stages": [] }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/bakery-production/recipes", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "name": "Exemplo", "finishedVariantId": "00000000-0000-0000-0000-000000000000", "yieldQty": 0, "notes": "", "items": [], "densityKgPerL": 0, "expectedLossPercent": 0, "stages": [] },)print(res.json())PATCH /bakery-production/recipes/:id
Seção intitulada “PATCH /bakery-production/recipes/:id”Editar receita (items e stages substituem a lista inteira)
Parâmetros de rota: id
curl -X PATCH "https://api.nivesistemas.com.br/bakery-production/recipes/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes/{id}", { method: "PATCH", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },});const data = await res.json();import requests
res = requests.request( "PATCH", "https://api.nivesistemas.com.br/bakery-production/recipes/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /bakery-production/recipes/:id/preview
Seção intitulada “GET /bakery-production/recipes/:id/preview”Necessidade de insumos, saldo, custo estimado e lotes máximos
Parâmetros de rota: id
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
batches |
number | não | Lotes a produzir |
locationId |
uuid | não | Local |
curl -X GET "https://api.nivesistemas.com.br/bakery-production/recipes/{id}/preview" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes/{id}/preview", { 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/bakery-production/recipes/{id}/preview", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /bakery-production/orders
Seção intitulada “GET /bakery-production/orders”Listar ordens de produção
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
limit |
integer | não | Padrão 50 |
curl -X GET "https://api.nivesistemas.com.br/bakery-production/orders" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/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/bakery-production/orders", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /bakery-production/orders
Seção intitulada “POST /bakery-production/orders”Registrar produção
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
recipeId |
uuid | sim | Receita |
batches |
number | sim | Quantidade de lotes |
outputLotCode |
string | não | Lote do produto acabado |
outputExpiresAt |
string | não | Validade (ISO ou AAAA-MM-DD) |
locationId |
uuid | não | Depósito de onde os insumos saem (omitido = padrão da produção) |
outputLocationId |
uuid | não | Depósito onde o acabado entra (omitido = padrão da produção ou o mesmo dos insumos) |
allowNegativeStock |
boolean | não | Permitir insumo com estoque negativo |
notes |
string | não | Observações |
actualOutputQty |
number | não | Quantidade realmente obtida (apura a perda) |
Resposta: 201 Created. Devolve também nominalQty, lossQty, materialCost e unitCost.
curl -X POST "https://api.nivesistemas.com.br/bakery-production/orders" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"recipeId":"00000000-0000-0000-0000-000000000000","batches":0,"outputLotCode":"","outputExpiresAt":"","locationId":"00000000-0000-0000-0000-000000000000","outputLocationId":"00000000-0000-0000-0000-000000000000","allowNegativeStock":true,"notes":"","actualOutputQty":0}'const res = await fetch("https://api.nivesistemas.com.br/bakery-production/orders", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "recipeId": "00000000-0000-0000-0000-000000000000", "batches": 0, "outputLotCode": "", "outputExpiresAt": "", "locationId": "00000000-0000-0000-0000-000000000000", "outputLocationId": "00000000-0000-0000-0000-000000000000", "allowNegativeStock": true, "notes": "", "actualOutputQty": 0 }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/bakery-production/orders", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "recipeId": "00000000-0000-0000-0000-000000000000", "batches": 0, "outputLotCode": "", "outputExpiresAt": "", "locationId": "00000000-0000-0000-0000-000000000000", "outputLocationId": "00000000-0000-0000-0000-000000000000", "allowNegativeStock": True, "notes": "", "actualOutputQty": 0 },)print(res.json())POST /bakery-production/orders/plan
Seção intitulada “POST /bakery-production/orders/plan”Planejar ordem (PLANNED) com data prevista; copia as etapas da receita
curl -X POST "https://api.nivesistemas.com.br/bakery-production/orders/plan" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/orders/plan", { 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/bakery-production/orders/plan", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /bakery-production/orders/:id
Seção intitulada “GET /bakery-production/orders/:id”Detalhe: etapas, consumo por lote, custo e perda
Parâmetros de rota: id
curl -X GET "https://api.nivesistemas.com.br/bakery-production/orders/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/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/bakery-production/orders/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /bakery-production/orders/:id/start
Seção intitulada “POST /bakery-production/orders/:id/start”Iniciar ordem planejada
Parâmetros de rota: id
curl -X POST "https://api.nivesistemas.com.br/bakery-production/orders/{id}/start" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/orders/{id}/start", { 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/bakery-production/orders/{id}/start", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /bakery-production/orders/:id/stages/:stageId
Seção intitulada “POST /bakery-production/orders/:id/stages/:stageId”Marcar ou desmarcar etapa
Parâmetros de rota: id, stageId
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
done |
boolean | não | Concluída |
notes |
string | não | Observações |
curl -X POST "https://api.nivesistemas.com.br/bakery-production/orders/{id}/stages/{stageId}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"done":true,"notes":""}'const res = await fetch("https://api.nivesistemas.com.br/bakery-production/orders/{id}/stages/{stageId}", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "done": true, "notes": "" }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/bakery-production/orders/{id}/stages/{stageId}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "done": True, "notes": "" },)print(res.json())POST /bakery-production/orders/:id/complete
Seção intitulada “POST /bakery-production/orders/:id/complete”Concluir ordem: baixa insumos (FIFO por lote), dá entrada no acabado e apura custo
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
actualOutputQty |
number | não | Quantidade obtida |
outputLotCode |
string | não | Lote do acabado |
outputExpiresAt |
string | não | Validade |
allowNegativeStock |
boolean | não | Permitir estoque negativo |
curl -X POST "https://api.nivesistemas.com.br/bakery-production/orders/{id}/complete" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"actualOutputQty":0,"outputLotCode":"","outputExpiresAt":"","allowNegativeStock":true}'const res = await fetch("https://api.nivesistemas.com.br/bakery-production/orders/{id}/complete", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "actualOutputQty": 0, "outputLotCode": "", "outputExpiresAt": "", "allowNegativeStock": true }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/bakery-production/orders/{id}/complete", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "actualOutputQty": 0, "outputLotCode": "", "outputExpiresAt": "", "allowNegativeStock": True },)print(res.json())POST /bakery-production/orders/:id/cancel
Seção intitulada “POST /bakery-production/orders/:id/cancel”Cancelar ordem não concluída
Parâmetros de rota: id
curl -X POST "https://api.nivesistemas.com.br/bakery-production/orders/{id}/cancel" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/orders/{id}/cancel", { 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/bakery-production/orders/{id}/cancel", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /bakery-production/traceability
Seção intitulada “GET /bakery-production/traceability”Rastreio por lote
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
lotCode |
string | sim | Lote |
direction |
string | não | backward (acabado → insumos) | forward (insumo → acabados) |
page |
integer | não | Página (forward; ordens paginadas, com total real na resposta) |
pageSize |
integer | não | Ordens por página (padrão 50, máximo 200) |
curl -X GET "https://api.nivesistemas.com.br/bakery-production/traceability" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/traceability", { 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/bakery-production/traceability", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /bakery-production/recall
Seção intitulada “GET /bakery-production/recall”Recall: quem recebeu um lote e em quais notas (exige permissão de relatórios)
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
lotCode |
string | sim | Lote de produto acabado ou de insumo |
page |
integer | não | Página |
pageSize |
integer | não | Registros por página (padrão 50, máximo 500) |
format |
string | não | json (padrão) | csv (todas as páginas, separador ; e BOM para Excel) |
Resposta: Lote de insumo alcança também as vendas dos lotes de acabado produzidos com ele. Devolve resumo (vendas, clientes, notas, quantidade líquida), estoque ainda existente dos lotes e as vendas com cliente e documento fiscal (NFC-e/NF-e). Só vendas concluídas feitas depois que o produto passou a controlar lote
curl -X GET "https://api.nivesistemas.com.br/bakery-production/recall" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recall", { 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/bakery-production/recall", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /bakery-production/planning/suggestions
Seção intitulada “GET /bakery-production/planning/suggestions”Sugestão de lotes pela cobertura de estoque e venda média
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
days |
integer | não | Dias de cobertura (padrão 15) |
curl -X GET "https://api.nivesistemas.com.br/bakery-production/planning/suggestions" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/planning/suggestions", { 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/bakery-production/planning/suggestions", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())PUT /bakery-production/recipes/:id
Seção intitulada “PUT /bakery-production/recipes/:id”Editar receita (mesmo comportamento do PATCH; todos os campos são opcionais)
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name |
string | não | Nome (até 200 caracteres) |
finishedVariantId |
uuid | não | Produto acabado (variante) |
yieldQty |
number | não | Rendimento por lote |
notes |
string | não | Observações (até 2000 caracteres) |
densityKgPerL |
number | não | Densidade do acabado (kg/L) |
expectedLossPercent |
number | não | Perda esperada do processo, de 0 a 99,99 (%) |
formulaMode |
string | não | ABSOLUTE (quantidades) | PERCENT (percentual de cada insumo) |
percentBasis |
string | não | MASS | VOLUME (base do percentual) |
standardUnitCost |
number | não | Custo padrão unitário |
stages |
array | não | Etapas: texto ou { name, required, workCenter, standardMinutes, laborRatePerHour }; substitui a lista inteira |
byproducts |
array | não | Subprodutos: [{ variantId, quantityPerBatch, costSharePercent }]; substitui a lista inteira |
items |
array | não | Insumos: [{ componentVariantId, quantity, percent, densityKgPerL, lossPercent, costKind (MATERIAL | PACKAGING) }]; substitui a lista inteira |
active |
boolean | não | Receita ativa |
changeReason |
string | não | Motivo da alteração (até 500 caracteres; obrigatório no segmento industrial quando a fórmula muda) |
saveAsDraft |
boolean | não | Salva como rascunho: a receita atual continua valendo até ativar a versão |
Resposta: A receita atualizada. Com saveAsDraft a nova versão fica em rascunho (ver /versions e /versions/:version/activate).
curl -X PUT "https://api.nivesistemas.com.br/bakery-production/recipes/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"name":"Exemplo","finishedVariantId":"00000000-0000-0000-0000-000000000000","yieldQty":0,"notes":"","densityKgPerL":0,"expectedLossPercent":0,"formulaMode":"","percentBasis":"","standardUnitCost":0,"stages":[],"byproducts":[],"items":[],"active":true,"changeReason":"","saveAsDraft":true}'const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes/{id}", { method: "PUT", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "name": "Exemplo", "finishedVariantId": "00000000-0000-0000-0000-000000000000", "yieldQty": 0, "notes": "", "densityKgPerL": 0, "expectedLossPercent": 0, "formulaMode": "", "percentBasis": "", "standardUnitCost": 0, "stages": [], "byproducts": [], "items": [], "active": true, "changeReason": "", "saveAsDraft": true }),});const data = await res.json();import requests
res = requests.request( "PUT", "https://api.nivesistemas.com.br/bakery-production/recipes/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "name": "Exemplo", "finishedVariantId": "00000000-0000-0000-0000-000000000000", "yieldQty": 0, "notes": "", "densityKgPerL": 0, "expectedLossPercent": 0, "formulaMode": "", "percentBasis": "", "standardUnitCost": 0, "stages": [], "byproducts": [], "items": [], "active": True, "changeReason": "", "saveAsDraft": True },)print(res.json())GET /bakery-production/recipes/:id/versions
Seção intitulada “GET /bakery-production/recipes/:id/versions”Histórico de versões da receita (ativa, obsoletas e rascunhos), com as diferenças entre versões
Parâmetros de rota: id
Resposta: { currentVersion, versions: [{ version, status, snapshot, changeReason, …, changes }] } da mais nova para a mais antiga. 404 se a receita não existe.
curl -X GET "https://api.nivesistemas.com.br/bakery-production/recipes/{id}/versions" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes/{id}/versions", { 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/bakery-production/recipes/{id}/versions", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /bakery-production/recipes/:id/versions/:version/activate
Seção intitulada “POST /bakery-production/recipes/:id/versions/:version/activate”Ativar um rascunho de versão: a ativa atual vira obsoleta e o rascunho passa a valer (ganha novo número de versão)
Parâmetros de rota: id, version
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
changeReason |
string | não | Motivo (até 500 caracteres; vazio usa o do rascunho) |
Resposta: A receita atualizada. 404 se a versão não existe; 409 se a versão não é um rascunho ou está corrompida.
curl -X POST "https://api.nivesistemas.com.br/bakery-production/recipes/{id}/versions/{version}/activate" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"changeReason":""}'const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes/{id}/versions/{version}/activate", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "changeReason": "" }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/bakery-production/recipes/{id}/versions/{version}/activate", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "changeReason": "" },)print(res.json())DELETE /bakery-production/recipes/:id/versions/:version
Seção intitulada “DELETE /bakery-production/recipes/:id/versions/:version”Descartar um rascunho de versão (só rascunhos; versões ativas e obsoletas não podem ser removidas)
Parâmetros de rota: id, version
Resposta: 204 No Content. 404 se o rascunho não existe.
curl -X DELETE "https://api.nivesistemas.com.br/bakery-production/recipes/{id}/versions/{version}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes/{id}/versions/{version}", { 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/bakery-production/recipes/{id}/versions/{version}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /bakery-production/recipes/:id/standard-cost
Seção intitulada “POST /bakery-production/recipes/:id/standard-cost”Recalcular o custo padrão da receita a partir do custo estimado de 1 lote e gravá-lo (exige a permissão de custos de produção)
Parâmetros de rota: id
Resposta: { recipeId, standardUnitCost }
curl -X POST "https://api.nivesistemas.com.br/bakery-production/recipes/{id}/standard-cost" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes/{id}/standard-cost", { 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/bakery-production/recipes/{id}/standard-cost", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /bakery-production/recipes/:id/tributary-suggestion
Seção intitulada “GET /bakery-production/recipes/:id/tributary-suggestion”Sugestão do fator da unidade tributável (uTrib/uCom) do acabado para a NF-e, a partir da densidade da receita e do volume da embalagem
Parâmetros de rota: id
Resposta: { recipeId, variantId, productDescription, saleUnit, tributaryUnit, densityKgPerL, unitVolumeLiters, currentFactor, litersPerUnit, kgPerUnit, … }. Só sugere: a unidade tributável correta é decisão fiscal (NCM/TIPI); confirme com o contador.
curl -X GET "https://api.nivesistemas.com.br/bakery-production/recipes/{id}/tributary-suggestion" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes/{id}/tributary-suggestion", { 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/bakery-production/recipes/{id}/tributary-suggestion", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /bakery-production/recipes/:id/apply-tributary-factor
Seção intitulada “POST /bakery-production/recipes/:id/apply-tributary-factor”Gravar na variante do acabado o fator tributável sugerido (exige a permissão de gerenciar produtos)
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
basis |
string | sim | L (litros por unidade) | KG (quilos por unidade) |
Resposta: A sugestão com currentFactor já aplicado e appliedBasis. 409 se não há como calcular (falta densidade da receita ou volume da embalagem).
curl -X POST "https://api.nivesistemas.com.br/bakery-production/recipes/{id}/apply-tributary-factor" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"basis":""}'const res = await fetch("https://api.nivesistemas.com.br/bakery-production/recipes/{id}/apply-tributary-factor", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "basis": "" }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/bakery-production/recipes/{id}/apply-tributary-factor", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "basis": "" },)print(res.json())POST /bakery-production/orders/:id/refresh-recipe
Seção intitulada “POST /bakery-production/orders/:id/refresh-recipe”Atualizar a fórmula de uma ordem planejada para a versão atual da receita (recria as etapas a partir da receita)
Parâmetros de rota: id
Resposta: A ordem atualizada. 409 se a ordem não está PLANNED; 404 se a receita não existe ou está inativa.
curl -X POST "https://api.nivesistemas.com.br/bakery-production/orders/{id}/refresh-recipe" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/orders/{id}/refresh-recipe", { 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/bakery-production/orders/{id}/refresh-recipe", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /bakery-production/orders/:id/reversal-preview
Seção intitulada “GET /bakery-production/orders/:id/reversal-preview”Prévia do estorno de uma ordem concluída: quanto do acabado ainda existe em estoque e o efeito no custo médio (exige a permissão de estornar produção)
Parâmetros de rota: id
Resposta: { orderId, outputLotCode, obtainedQty, remainingQty, availableQty, soldOrConsumedQty, reversibleFraction, full, costReversal }. Nada é gravado. 409 se a ordem não está concluída.
curl -X GET "https://api.nivesistemas.com.br/bakery-production/orders/{id}/reversal-preview" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/bakery-production/orders/{id}/reversal-preview", { 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/bakery-production/orders/{id}/reversal-preview", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /bakery-production/orders/:id/reverse
Seção intitulada “POST /bakery-production/orders/:id/reverse”Estornar ordem concluída: retira o acabado do lote, devolve os insumos aos mesmos lotes e bloqueia o lote estornado (exige a permissão de estornar produção)
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
reason |
string | sim | Motivo do estorno (5 a 500 caracteres) |
partial |
boolean | não | Estorno parcial, só do que ainda está em estoque (obrigatório quando o acabado já foi vendido ou consumido em parte) |
Resposta: A ordem, mais costReversal e coproductCostReversals (se o custo médio foi refeito ou o motivo de não ter sido). 409 se a ordem não está concluída, já foi totalmente estornada ou o estorno total está bloqueado (code REVERSAL_BLOCKED, com partialPossible).
curl -X POST "https://api.nivesistemas.com.br/bakery-production/orders/{id}/reverse" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"reason":"","partial":true}'const res = await fetch("https://api.nivesistemas.com.br/bakery-production/orders/{id}/reverse", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "reason": "", "partial": true }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/bakery-production/orders/{id}/reverse", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "reason": "", "partial": True },)print(res.json())
