Promoções com brinde
Promoções do tipo valor mínimo com brinde (VALOR_MINIMO_COM_BRINDE): a venda que atinge o valor mínimo nas formas de pagamento escolhidas ganha os produtos brinde.
Base: https://api.nivesistemas.com.br · 6 endpoints
GET /promotions
Seção intitulada “GET /promotions”Listar promoções
Query params
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
q |
string | não | Busca por nome |
active |
boolean | não | true / false |
type |
string | não | VALOR_MINIMO_COM_BRINDE |
from |
string | não | Vigência a partir de (AAAA-MM-DD) |
to |
string | não | Vigência até (AAAA-MM-DD) |
curl -X GET "https://api.nivesistemas.com.br/promotions" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/promotions", { 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/promotions", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())GET /promotions/:id
Seção intitulada “GET /promotions/:id”Detalhe da promoção
Parâmetros de rota: id
curl -X GET "https://api.nivesistemas.com.br/promotions/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/promotions/{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/promotions/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /promotions
Seção intitulada “POST /promotions”Criar promoção
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name |
string | sim | Nome |
description |
string | não | Descrição |
minValue |
number | sim | Valor mínimo da venda |
valueCriterion |
string | sim | PRODUCT_GROSS, NET_AFTER_DISCOUNTS ou CASH_VALUE |
startsAt |
string | sim | Início (ISO ou AAAA-MM-DD) |
endsAt |
string | não | Fim (opcional) |
active |
boolean | não | Padrão true |
paymentMethodIds |
string[] | sim | Formas de pagamento válidas |
gifts |
array | sim | [{ productId, quantityPerSale, campaignLimit }] |
Resposta: 201 Created
curl -X POST "https://api.nivesistemas.com.br/promotions" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"name":"Exemplo","description":"","minValue":0,"valueCriterion":"","startsAt":"","endsAt":"","active":true,"paymentMethodIds":null,"gifts":[]}'const res = await fetch("https://api.nivesistemas.com.br/promotions", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "name": "Exemplo", "description": "", "minValue": 0, "valueCriterion": "", "startsAt": "", "endsAt": "", "active": true, "paymentMethodIds": null, "gifts": [] }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/promotions", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "name": "Exemplo", "description": "", "minValue": 0, "valueCriterion": "", "startsAt": "", "endsAt": "", "active": True, "paymentMethodIds": None, "gifts": [] },)print(res.json())PATCH /promotions/:id
Seção intitulada “PATCH /promotions/:id”Atualizar promoção (mesmo corpo da criação)
Parâmetros de rota: id
curl -X PATCH "https://api.nivesistemas.com.br/promotions/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/promotions/{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/promotions/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())PATCH /promotions/:id/active
Seção intitulada “PATCH /promotions/:id/active”Ativar ou pausar
Parâmetros de rota: id
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
active |
boolean | sim | Situação |
curl -X PATCH "https://api.nivesistemas.com.br/promotions/{id}/active" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"active":true}'const res = await fetch("https://api.nivesistemas.com.br/promotions/{id}/active", { method: "PATCH", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "active": true }),});const data = await res.json();import requests
res = requests.request( "PATCH", "https://api.nivesistemas.com.br/promotions/{id}/active", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "active": True },)print(res.json())DELETE /promotions/:id
Seção intitulada “DELETE /promotions/:id”Excluir promoção
Parâmetros de rota: id
Resposta: 204 No Content
curl -X DELETE "https://api.nivesistemas.com.br/promotions/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/promotions/{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/promotions/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())
