Promoções por quantidade
Base: https://api.nivesistemas.com.br · 5 endpoints
GET /quantity-promotions
Seção intitulada “GET /quantity-promotions”Listar promoções por quantidade
curl -X GET "https://api.nivesistemas.com.br/quantity-promotions" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/quantity-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/quantity-promotions", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())POST /quantity-promotions
Seção intitulada “POST /quantity-promotions”Criar promoção por quantidade (leve X pague Y, X por R$ Z, % ou R$ por unidade a partir de X)
Corpo (JSON)
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name |
string | não | Nome da promoção |
type |
string | não | BUY_X_PAY_Y | BUNDLE_PRICE | PERCENT_FROM_QTY | UNIT_PRICE_FROM_QTY |
buyQty |
number | não | Quantidade que ativa a promoção |
payQty |
number | não | BUY_X_PAY_Y: quantas o cliente paga |
bundlePrice |
number | não | BUNDLE_PRICE: preço do conjunto |
percent |
number | não | PERCENT_FROM_QTY: percentual de desconto |
unitPrice |
number | não | UNIT_PRICE_FROM_QTY: preço de cada unidade a partir de buyQty (ex.: 24 ou mais a R$ 8,33 cada) |
mixProducts |
boolean | não | Soma a quantidade de todos os produtos da promoção (ex.: sabores diferentes). Padrão false |
productIds |
string[] | não | Produtos da promoção |
curl -X POST "https://api.nivesistemas.com.br/quantity-promotions" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo" \ -H "Content-Type: application/json" \ -d '{"name":"Exemplo","type":"","buyQty":0,"payQty":0,"bundlePrice":0,"percent":0,"unitPrice":0,"mixProducts":true,"productIds":null}'const res = await fetch("https://api.nivesistemas.com.br/quantity-promotions", { method: "POST", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", "Content-Type": "application/json", }, body: JSON.stringify({ "name": "Exemplo", "type": "", "buyQty": 0, "payQty": 0, "bundlePrice": 0, "percent": 0, "unitPrice": 0, "mixProducts": true, "productIds": null }),});const data = await res.json();import requests
res = requests.request( "POST", "https://api.nivesistemas.com.br/quantity-promotions", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", }, json={ "name": "Exemplo", "type": "", "buyQty": 0, "payQty": 0, "bundlePrice": 0, "percent": 0, "unitPrice": 0, "mixProducts": True, "productIds": None },)print(res.json())PUT /quantity-promotions/:id
Seção intitulada “PUT /quantity-promotions/:id”Alterar promoção por quantidade
Parâmetros de rota: id
curl -X PUT "https://api.nivesistemas.com.br/quantity-promotions/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/quantity-promotions/{id}", { method: "PUT", headers: { Authorization: "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },});const data = await res.json();import requests
res = requests.request( "PUT", "https://api.nivesistemas.com.br/quantity-promotions/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())PATCH /quantity-promotions/:id/active
Seção intitulada “PATCH /quantity-promotions/:id/active”Ativar ou desativar
Parâmetros de rota: id
curl -X PATCH "https://api.nivesistemas.com.br/quantity-promotions/{id}/active" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/quantity-promotions/{id}/active", { 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/quantity-promotions/{id}/active", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())DELETE /quantity-promotions/:id
Seção intitulada “DELETE /quantity-promotions/:id”Excluir promoção por quantidade
Parâmetros de rota: id
curl -X DELETE "https://api.nivesistemas.com.br/quantity-promotions/{id}" \ -H "Authorization: Bearer sl_live_exemplo_abc123xyz789" \ -H "X-Store-Slug: loja-demo"const res = await fetch("https://api.nivesistemas.com.br/quantity-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/quantity-promotions/{id}", headers={ "Authorization": "Bearer sl_live_exemplo_abc123xyz789", "X-Store-Slug": "loja-demo", },)print(res.json())
