Atualizar cupom
curl --request PUT \
--url https://api.dooki.com.br/v2/{alias}/pricing/promocodes/{id} \
--header 'Content-Type: application/json' \
--header 'User-Secret-Key: <api-key>' \
--header 'User-Token: <api-key>' \
--data '
{
"active": true,
"value": 10,
"code": "10OFF",
"quantity": 100000,
"min_value": 99.99,
"start_at": "2025-06-01 00:00:00",
"end_at": "2025-08-10 00:00:00",
"for_the_price_of": true,
"accumulate": true,
"once_per_customer": true,
"abandoned_cart": true,
"newsletter": true,
"free_shipment": true,
"ignore_promotion_products": true,
"freebie_id": 123,
"advertise": true
}
'import requests
url = "https://api.dooki.com.br/v2/{alias}/pricing/promocodes/{id}"
payload = {
"active": True,
"value": 10,
"code": "10OFF",
"quantity": 100000,
"min_value": 99.99,
"start_at": "2025-06-01 00:00:00",
"end_at": "2025-08-10 00:00:00",
"for_the_price_of": True,
"accumulate": True,
"once_per_customer": True,
"abandoned_cart": True,
"newsletter": True,
"free_shipment": True,
"ignore_promotion_products": True,
"freebie_id": 123,
"advertise": True
}
headers = {
"User-Token": "<api-key>",
"User-Secret-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'User-Token': '<api-key>',
'User-Secret-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
active: true,
value: 10,
code: '10OFF',
quantity: 100000,
min_value: 99.99,
start_at: '2025-06-01 00:00:00',
end_at: '2025-08-10 00:00:00',
for_the_price_of: true,
accumulate: true,
once_per_customer: true,
abandoned_cart: true,
newsletter: true,
free_shipment: true,
ignore_promotion_products: true,
freebie_id: 123,
advertise: true
})
};
fetch('https://api.dooki.com.br/v2/{alias}/pricing/promocodes/{id}', 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}/pricing/promocodes/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'active' => true,
'value' => 10,
'code' => '10OFF',
'quantity' => 100000,
'min_value' => 99.99,
'start_at' => '2025-06-01 00:00:00',
'end_at' => '2025-08-10 00:00:00',
'for_the_price_of' => true,
'accumulate' => true,
'once_per_customer' => true,
'abandoned_cart' => true,
'newsletter' => true,
'free_shipment' => true,
'ignore_promotion_products' => true,
'freebie_id' => 123,
'advertise' => true
]),
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}/pricing/promocodes/{id}"
payload := strings.NewReader("{\n \"active\": true,\n \"value\": 10,\n \"code\": \"10OFF\",\n \"quantity\": 100000,\n \"min_value\": 99.99,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"for_the_price_of\": true,\n \"accumulate\": true,\n \"once_per_customer\": true,\n \"abandoned_cart\": true,\n \"newsletter\": true,\n \"free_shipment\": true,\n \"ignore_promotion_products\": true,\n \"freebie_id\": 123,\n \"advertise\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.dooki.com.br/v2/{alias}/pricing/promocodes/{id}")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"value\": 10,\n \"code\": \"10OFF\",\n \"quantity\": 100000,\n \"min_value\": 99.99,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"for_the_price_of\": true,\n \"accumulate\": true,\n \"once_per_customer\": true,\n \"abandoned_cart\": true,\n \"newsletter\": true,\n \"free_shipment\": true,\n \"ignore_promotion_products\": true,\n \"freebie_id\": 123,\n \"advertise\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dooki.com.br/v2/{alias}/pricing/promocodes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["User-Token"] = '<api-key>'
request["User-Secret-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": true,\n \"value\": 10,\n \"code\": \"10OFF\",\n \"quantity\": 100000,\n \"min_value\": 99.99,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"for_the_price_of\": true,\n \"accumulate\": true,\n \"once_per_customer\": true,\n \"abandoned_cart\": true,\n \"newsletter\": true,\n \"free_shipment\": true,\n \"ignore_promotion_products\": true,\n \"freebie_id\": 123,\n \"advertise\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"code": "TEST",
"description": "",
"customer_id": 123,
"active": true,
"expired": true,
"discount_type": "p",
"for_the_price_of": true,
"cart_default": true,
"type_increment_value": "",
"value": 10,
"price_products": 123,
"percent_products": 123,
"quantity": "100000",
"total_customers_used": "22",
"product_quantity": 123,
"product_max_quantity": 123,
"used": 22,
"items_count": 123,
"min_value": 99.99,
"use_percent": 0.02,
"shipment_percent": 123,
"accumulate": true,
"once_per_customer": true,
"abandoned_cart": true,
"newsletter": true,
"payments_ids": "[1, 2, 3, 4]",
"free_shipment": true,
"ignore_promotion_products": true,
"freebie_id": 123,
"advertise": true
}Cupons
Atualizar cupom
Atualiza os detalhes de um cupom de desconto específico
PUT
/
{alias}
/
pricing
/
promocodes
/
{id}
Atualizar cupom
curl --request PUT \
--url https://api.dooki.com.br/v2/{alias}/pricing/promocodes/{id} \
--header 'Content-Type: application/json' \
--header 'User-Secret-Key: <api-key>' \
--header 'User-Token: <api-key>' \
--data '
{
"active": true,
"value": 10,
"code": "10OFF",
"quantity": 100000,
"min_value": 99.99,
"start_at": "2025-06-01 00:00:00",
"end_at": "2025-08-10 00:00:00",
"for_the_price_of": true,
"accumulate": true,
"once_per_customer": true,
"abandoned_cart": true,
"newsletter": true,
"free_shipment": true,
"ignore_promotion_products": true,
"freebie_id": 123,
"advertise": true
}
'import requests
url = "https://api.dooki.com.br/v2/{alias}/pricing/promocodes/{id}"
payload = {
"active": True,
"value": 10,
"code": "10OFF",
"quantity": 100000,
"min_value": 99.99,
"start_at": "2025-06-01 00:00:00",
"end_at": "2025-08-10 00:00:00",
"for_the_price_of": True,
"accumulate": True,
"once_per_customer": True,
"abandoned_cart": True,
"newsletter": True,
"free_shipment": True,
"ignore_promotion_products": True,
"freebie_id": 123,
"advertise": True
}
headers = {
"User-Token": "<api-key>",
"User-Secret-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'User-Token': '<api-key>',
'User-Secret-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
active: true,
value: 10,
code: '10OFF',
quantity: 100000,
min_value: 99.99,
start_at: '2025-06-01 00:00:00',
end_at: '2025-08-10 00:00:00',
for_the_price_of: true,
accumulate: true,
once_per_customer: true,
abandoned_cart: true,
newsletter: true,
free_shipment: true,
ignore_promotion_products: true,
freebie_id: 123,
advertise: true
})
};
fetch('https://api.dooki.com.br/v2/{alias}/pricing/promocodes/{id}', 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}/pricing/promocodes/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'active' => true,
'value' => 10,
'code' => '10OFF',
'quantity' => 100000,
'min_value' => 99.99,
'start_at' => '2025-06-01 00:00:00',
'end_at' => '2025-08-10 00:00:00',
'for_the_price_of' => true,
'accumulate' => true,
'once_per_customer' => true,
'abandoned_cart' => true,
'newsletter' => true,
'free_shipment' => true,
'ignore_promotion_products' => true,
'freebie_id' => 123,
'advertise' => true
]),
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}/pricing/promocodes/{id}"
payload := strings.NewReader("{\n \"active\": true,\n \"value\": 10,\n \"code\": \"10OFF\",\n \"quantity\": 100000,\n \"min_value\": 99.99,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"for_the_price_of\": true,\n \"accumulate\": true,\n \"once_per_customer\": true,\n \"abandoned_cart\": true,\n \"newsletter\": true,\n \"free_shipment\": true,\n \"ignore_promotion_products\": true,\n \"freebie_id\": 123,\n \"advertise\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.dooki.com.br/v2/{alias}/pricing/promocodes/{id}")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"value\": 10,\n \"code\": \"10OFF\",\n \"quantity\": 100000,\n \"min_value\": 99.99,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"for_the_price_of\": true,\n \"accumulate\": true,\n \"once_per_customer\": true,\n \"abandoned_cart\": true,\n \"newsletter\": true,\n \"free_shipment\": true,\n \"ignore_promotion_products\": true,\n \"freebie_id\": 123,\n \"advertise\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dooki.com.br/v2/{alias}/pricing/promocodes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["User-Token"] = '<api-key>'
request["User-Secret-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": true,\n \"value\": 10,\n \"code\": \"10OFF\",\n \"quantity\": 100000,\n \"min_value\": 99.99,\n \"start_at\": \"2025-06-01 00:00:00\",\n \"end_at\": \"2025-08-10 00:00:00\",\n \"for_the_price_of\": true,\n \"accumulate\": true,\n \"once_per_customer\": true,\n \"abandoned_cart\": true,\n \"newsletter\": true,\n \"free_shipment\": true,\n \"ignore_promotion_products\": true,\n \"freebie_id\": 123,\n \"advertise\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"code": "TEST",
"description": "",
"customer_id": 123,
"active": true,
"expired": true,
"discount_type": "p",
"for_the_price_of": true,
"cart_default": true,
"type_increment_value": "",
"value": 10,
"price_products": 123,
"percent_products": 123,
"quantity": "100000",
"total_customers_used": "22",
"product_quantity": 123,
"product_max_quantity": 123,
"used": 22,
"items_count": 123,
"min_value": 99.99,
"use_percent": 0.02,
"shipment_percent": 123,
"accumulate": true,
"once_per_customer": true,
"abandoned_cart": true,
"newsletter": true,
"payments_ids": "[1, 2, 3, 4]",
"free_shipment": true,
"ignore_promotion_products": true,
"freebie_id": 123,
"advertise": true
}Envie somente os campos obrigatórios e os que deseja alterar, para reduzir validações desnecessárias.
Caso não envie um campo, o mesmo será mantido com o valor atual.
Esta API possui limites de requisições (rate limits) para garantir estabilidade.
Cada endpoint tem um limite específico de chamadas por minuto.
Este endpoint em específico tem um limite de requisições por minuto.
Body
application/json
Estrutura de dados para criação e atualização de um cupom de desconto.
Response
Cupom atualizado com sucesso
Representa um código promocional
Was this page helpful?