curl --request POST \
--url https://api.dooki.com.br/v2/{alias}/discounts \
--header 'Content-Type: application/json' \
--header 'User-Secret-Key: <api-key>' \
--header 'User-Token: <api-key>' \
--data '
{
"name": "Promoção de Outubro",
"discount_method": "percent",
"discount_value": 20,
"discount_type": "buy_x_get_y",
"entry_condition_type": "amount",
"entry_condition_value": 1,
"accumulate": false,
"start_at": "2025-06-01 00:00:00",
"end_at": "2025-08-10 00:00:00",
"specifications": {
"payment_method_type": "pix",
"set_cart_usage_limit": true,
"cart_usage_limit": 1,
"get_products_quantity": 1,
"restrictions": {
"include": {
"brands_ids": [
11
],
"products_ids": [
51
],
"categories_ids": [
4
],
"collections_ids": [
9
]
}
}
}
}
'import requests
url = "https://api.dooki.com.br/v2/{alias}/discounts"
payload = {
"name": "Promoção de Outubro",
"discount_method": "percent",
"discount_value": 20,
"discount_type": "buy_x_get_y",
"entry_condition_type": "amount",
"entry_condition_value": 1,
"accumulate": False,
"start_at": "2025-06-01 00:00:00",
"end_at": "2025-08-10 00:00:00",
"specifications": {
"payment_method_type": "pix",
"set_cart_usage_limit": True,
"cart_usage_limit": 1,
"get_products_quantity": 1,
"restrictions": { "include": {
"brands_ids": [11],
"products_ids": [51],
"categories_ids": [4],
"collections_ids": [9]
} }
}
}
headers = {
"User-Token": "<api-key>",
"User-Secret-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'User-Token': '<api-key>',
'User-Secret-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Promoção de Outubro',
discount_method: 'percent',
discount_value: 20,
discount_type: 'buy_x_get_y',
entry_condition_type: 'amount',
entry_condition_value: 1,
accumulate: false,
start_at: '2025-06-01 00:00:00',
end_at: '2025-08-10 00:00:00',
specifications: {
payment_method_type: 'pix',
set_cart_usage_limit: true,
cart_usage_limit: 1,
get_products_quantity: 1,
restrictions: {
include: {
brands_ids: [11],
products_ids: [51],
categories_ids: [4],
collections_ids: [9]
}
}
}
})
};
fetch('https://api.dooki.com.br/v2/{alias}/discounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dooki.com.br/v2/{alias}/discounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Promoção de Outubro',
'discount_method' => 'percent',
'discount_value' => 20,
'discount_type' => 'buy_x_get_y',
'entry_condition_type' => 'amount',
'entry_condition_value' => 1,
'accumulate' => false,
'start_at' => '2025-06-01 00:00:00',
'end_at' => '2025-08-10 00:00:00',
'specifications' => [
'payment_method_type' => 'pix',
'set_cart_usage_limit' => true,
'cart_usage_limit' => 1,
'get_products_quantity' => 1,
'restrictions' => [
'include' => [
'brands_ids' => [
11
],
'products_ids' => [
51
],
'categories_ids' => [
4
],
'collections_ids' => [
9
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"User-Secret-Key: <api-key>",
"User-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dooki.com.br/v2/{alias}/discounts"
payload := strings.NewReader("{\n \"name\": \"Promoção de Outubro\",\n \"discount_method\": \"percent\",\n \"discount_value\": 20,\n \"discount_type\": \"buy_x_get_y\",\n \"entry_condition_type\": \"amount\",\n \"entry_condition_value\": 1,\n \"accumulate\": false,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"specifications\": {\n \"payment_method_type\": \"pix\",\n \"set_cart_usage_limit\": true,\n \"cart_usage_limit\": 1,\n \"get_products_quantity\": 1,\n \"restrictions\": {\n \"include\": {\n \"brands_ids\": [\n 11\n ],\n \"products_ids\": [\n 51\n ],\n \"categories_ids\": [\n 4\n ],\n \"collections_ids\": [\n 9\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("User-Token", "<api-key>")
req.Header.Add("User-Secret-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dooki.com.br/v2/{alias}/discounts")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Promoção de Outubro\",\n \"discount_method\": \"percent\",\n \"discount_value\": 20,\n \"discount_type\": \"buy_x_get_y\",\n \"entry_condition_type\": \"amount\",\n \"entry_condition_value\": 1,\n \"accumulate\": false,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"specifications\": {\n \"payment_method_type\": \"pix\",\n \"set_cart_usage_limit\": true,\n \"cart_usage_limit\": 1,\n \"get_products_quantity\": 1,\n \"restrictions\": {\n \"include\": {\n \"brands_ids\": [\n 11\n ],\n \"products_ids\": [\n 51\n ],\n \"categories_ids\": [\n 4\n ],\n \"collections_ids\": [\n 9\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dooki.com.br/v2/{alias}/discounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["User-Token"] = '<api-key>'
request["User-Secret-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Promoção de Outubro\",\n \"discount_method\": \"percent\",\n \"discount_value\": 20,\n \"discount_type\": \"buy_x_get_y\",\n \"entry_condition_type\": \"amount\",\n \"entry_condition_value\": 1,\n \"accumulate\": false,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"specifications\": {\n \"payment_method_type\": \"pix\",\n \"set_cart_usage_limit\": true,\n \"cart_usage_limit\": 1,\n \"get_products_quantity\": 1,\n \"restrictions\": {\n \"include\": {\n \"brands_ids\": [\n 11\n ],\n \"products_ids\": [\n 51\n ],\n \"categories_ids\": [\n 4\n ],\n \"collections_ids\": [\n 9\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 1520,
"store_id": 1319250,
"discount_type_id": 1520,
"name": "Lucas",
"entry_condition_type": "amount",
"entry_condition_value": 10,
"discount_method": "percent",
"discount_value": 100,
"discount_type": "buy_x_get_y",
"accumulate": false,
"start_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
},
"end_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
},
"created_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
},
"updated_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
}
}Criar um desconto da loja
Cria um desconto na loja
curl --request POST \
--url https://api.dooki.com.br/v2/{alias}/discounts \
--header 'Content-Type: application/json' \
--header 'User-Secret-Key: <api-key>' \
--header 'User-Token: <api-key>' \
--data '
{
"name": "Promoção de Outubro",
"discount_method": "percent",
"discount_value": 20,
"discount_type": "buy_x_get_y",
"entry_condition_type": "amount",
"entry_condition_value": 1,
"accumulate": false,
"start_at": "2025-06-01 00:00:00",
"end_at": "2025-08-10 00:00:00",
"specifications": {
"payment_method_type": "pix",
"set_cart_usage_limit": true,
"cart_usage_limit": 1,
"get_products_quantity": 1,
"restrictions": {
"include": {
"brands_ids": [
11
],
"products_ids": [
51
],
"categories_ids": [
4
],
"collections_ids": [
9
]
}
}
}
}
'import requests
url = "https://api.dooki.com.br/v2/{alias}/discounts"
payload = {
"name": "Promoção de Outubro",
"discount_method": "percent",
"discount_value": 20,
"discount_type": "buy_x_get_y",
"entry_condition_type": "amount",
"entry_condition_value": 1,
"accumulate": False,
"start_at": "2025-06-01 00:00:00",
"end_at": "2025-08-10 00:00:00",
"specifications": {
"payment_method_type": "pix",
"set_cart_usage_limit": True,
"cart_usage_limit": 1,
"get_products_quantity": 1,
"restrictions": { "include": {
"brands_ids": [11],
"products_ids": [51],
"categories_ids": [4],
"collections_ids": [9]
} }
}
}
headers = {
"User-Token": "<api-key>",
"User-Secret-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'User-Token': '<api-key>',
'User-Secret-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Promoção de Outubro',
discount_method: 'percent',
discount_value: 20,
discount_type: 'buy_x_get_y',
entry_condition_type: 'amount',
entry_condition_value: 1,
accumulate: false,
start_at: '2025-06-01 00:00:00',
end_at: '2025-08-10 00:00:00',
specifications: {
payment_method_type: 'pix',
set_cart_usage_limit: true,
cart_usage_limit: 1,
get_products_quantity: 1,
restrictions: {
include: {
brands_ids: [11],
products_ids: [51],
categories_ids: [4],
collections_ids: [9]
}
}
}
})
};
fetch('https://api.dooki.com.br/v2/{alias}/discounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dooki.com.br/v2/{alias}/discounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Promoção de Outubro',
'discount_method' => 'percent',
'discount_value' => 20,
'discount_type' => 'buy_x_get_y',
'entry_condition_type' => 'amount',
'entry_condition_value' => 1,
'accumulate' => false,
'start_at' => '2025-06-01 00:00:00',
'end_at' => '2025-08-10 00:00:00',
'specifications' => [
'payment_method_type' => 'pix',
'set_cart_usage_limit' => true,
'cart_usage_limit' => 1,
'get_products_quantity' => 1,
'restrictions' => [
'include' => [
'brands_ids' => [
11
],
'products_ids' => [
51
],
'categories_ids' => [
4
],
'collections_ids' => [
9
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"User-Secret-Key: <api-key>",
"User-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dooki.com.br/v2/{alias}/discounts"
payload := strings.NewReader("{\n \"name\": \"Promoção de Outubro\",\n \"discount_method\": \"percent\",\n \"discount_value\": 20,\n \"discount_type\": \"buy_x_get_y\",\n \"entry_condition_type\": \"amount\",\n \"entry_condition_value\": 1,\n \"accumulate\": false,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"specifications\": {\n \"payment_method_type\": \"pix\",\n \"set_cart_usage_limit\": true,\n \"cart_usage_limit\": 1,\n \"get_products_quantity\": 1,\n \"restrictions\": {\n \"include\": {\n \"brands_ids\": [\n 11\n ],\n \"products_ids\": [\n 51\n ],\n \"categories_ids\": [\n 4\n ],\n \"collections_ids\": [\n 9\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("User-Token", "<api-key>")
req.Header.Add("User-Secret-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.dooki.com.br/v2/{alias}/discounts")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Promoção de Outubro\",\n \"discount_method\": \"percent\",\n \"discount_value\": 20,\n \"discount_type\": \"buy_x_get_y\",\n \"entry_condition_type\": \"amount\",\n \"entry_condition_value\": 1,\n \"accumulate\": false,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"specifications\": {\n \"payment_method_type\": \"pix\",\n \"set_cart_usage_limit\": true,\n \"cart_usage_limit\": 1,\n \"get_products_quantity\": 1,\n \"restrictions\": {\n \"include\": {\n \"brands_ids\": [\n 11\n ],\n \"products_ids\": [\n 51\n ],\n \"categories_ids\": [\n 4\n ],\n \"collections_ids\": [\n 9\n ]\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dooki.com.br/v2/{alias}/discounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["User-Token"] = '<api-key>'
request["User-Secret-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Promoção de Outubro\",\n \"discount_method\": \"percent\",\n \"discount_value\": 20,\n \"discount_type\": \"buy_x_get_y\",\n \"entry_condition_type\": \"amount\",\n \"entry_condition_value\": 1,\n \"accumulate\": false,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"specifications\": {\n \"payment_method_type\": \"pix\",\n \"set_cart_usage_limit\": true,\n \"cart_usage_limit\": 1,\n \"get_products_quantity\": 1,\n \"restrictions\": {\n \"include\": {\n \"brands_ids\": [\n 11\n ],\n \"products_ids\": [\n 51\n ],\n \"categories_ids\": [\n 4\n ],\n \"collections_ids\": [\n 9\n ]\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 1520,
"store_id": 1319250,
"discount_type_id": 1520,
"name": "Lucas",
"entry_condition_type": "amount",
"entry_condition_value": 10,
"discount_method": "percent",
"discount_value": 100,
"discount_type": "buy_x_get_y",
"accumulate": false,
"start_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
},
"end_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
},
"created_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
},
"updated_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
}
}Path Parameters
Alias da loja
Body
Dados para criação do desconto
Nome do desconto.
3 - 100"Promoção de Outubro"
Método de desconto.
percent, amount 10"percent"
Valor do desconto. Se percentual, o máximo é 100.
x >= 0.0120
Tipo do desconto.
buy_x_get_y, by_payment_method "buy_x_get_y"
Tipo de condição para aplicar o desconto.
amount, quantity "amount"
Valor mínimo (quantidade de produto ou valor do carrinho) necessário para ativar o desconto.
x >= 11
Define se o desconto pode acumular com outras promoções.
false
Data e hora de início
"2025-06-01 00:00:00"
Data e hora de término
"2025-08-10 00:00:00"
Restrições de aplicação do desconto.
Show child attributes
Show child attributes
Configurações específicas do tipo de desconto. Os campos obrigatórios variam conforme discount_type.
Show child attributes
Show child attributes
Response
Detalhes do desconto
Representa os atributos de um Desconto
1520
1319250
1520
"Lucas"
"amount"
10
"percent"
100
"buy_x_get_y"
false
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?