Skip to main content
POST
/
{alias}
/
pricing
/
freebies
Criar novo Brinde
curl --request POST \
  --url https://api.dooki.com.br/v2/{alias}/pricing/freebies \
  --header 'Content-Type: application/json' \
  --header 'User-Secret-Key: <api-key>' \
  --header 'User-Token: <api-key>' \
  --data '
{
  "name": "Brinde Natal",
  "active": true,
  "start_at": "2025-06-01 00:00:00",
  "resource_type": "product",
  "resource_id": 9791068,
  "rule": "products_amount",
  "end_at": "2025-08-10 00:00:00",
  "min_quantity": 2,
  "min_amount": 100
}
'
import requests

url = "https://api.dooki.com.br/v2/{alias}/pricing/freebies"

payload = {
    "name": "Brinde Natal",
    "active": True,
    "start_at": "2025-06-01 00:00:00",
    "resource_type": "product",
    "resource_id": 9791068,
    "rule": "products_amount",
    "end_at": "2025-08-10 00:00:00",
    "min_quantity": 2,
    "min_amount": 100
}
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: 'Brinde Natal',
    active: true,
    start_at: '2025-06-01 00:00:00',
    resource_type: 'product',
    resource_id: 9791068,
    rule: 'products_amount',
    end_at: '2025-08-10 00:00:00',
    min_quantity: 2,
    min_amount: 100
  })
};

fetch('https://api.dooki.com.br/v2/{alias}/pricing/freebies', 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/freebies",
  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' => 'Brinde Natal',
    'active' => true,
    'start_at' => '2025-06-01 00:00:00',
    'resource_type' => 'product',
    'resource_id' => 9791068,
    'rule' => 'products_amount',
    'end_at' => '2025-08-10 00:00:00',
    'min_quantity' => 2,
    'min_amount' => 100
  ]),
  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/freebies"

	payload := strings.NewReader("{\n  \"name\": \"Brinde Natal\",\n  \"active\": true,\n  \"start_at\": \"2025-06-01 00:00:00\",\n  \"resource_type\": \"product\",\n  \"resource_id\": 9791068,\n  \"rule\": \"products_amount\",\n  \"end_at\": \"2025-08-10 00:00:00\",\n  \"min_quantity\": 2,\n  \"min_amount\": 100\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}/pricing/freebies")
  .header("User-Token", "<api-key>")
  .header("User-Secret-Key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Brinde Natal\",\n  \"active\": true,\n  \"start_at\": \"2025-06-01 00:00:00\",\n  \"resource_type\": \"product\",\n  \"resource_id\": 9791068,\n  \"rule\": \"products_amount\",\n  \"end_at\": \"2025-08-10 00:00:00\",\n  \"min_quantity\": 2,\n  \"min_amount\": 100\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.dooki.com.br/v2/{alias}/pricing/freebies")

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\": \"Brinde Natal\",\n  \"active\": true,\n  \"start_at\": \"2025-06-01 00:00:00\",\n  \"resource_type\": \"product\",\n  \"resource_id\": 9791068,\n  \"rule\": \"products_amount\",\n  \"end_at\": \"2025-08-10 00:00:00\",\n  \"min_quantity\": 2,\n  \"min_amount\": 100\n}"

response = http.request(request)
puts response.read_body
{
  "id": 3976,
  "active": true,
  "store_id": 176851,
  "name": "Teste docs",
  "start_at": "2025-09-16",
  "expires_at": "2025-09-16",
  "resource_id": 9791068,
  "resource_type": "product",
  "rule": "always",
  "min_quantity": 0,
  "min_amount": 0,
  "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"
  }
}

Authorizations

User-Token
string
header
required
User-Secret-Key
string
header
required

Path Parameters

alias
string
required

Alias da loja

Body

application/json

Request para criação/atualização de brindes.

name
string
required

Deve ser único por loja. O valor é sanitizado e normalizado automaticamente.

Maximum string length: 190
Example:

"Brinde Natal"

active
boolean
required

Mostra se a regra está ativa.

Example:

true

start_at
string<date-time>
required

Data e hora de início

Example:

"2025-06-01 00:00:00"

resource_type
enum<string>
required

Tipo do item no Brinde, Você pode escolher entre produto ou SKU.

Available options:
sku,
product
Example:

"product"

resource_id
integer
required

ID do item ofertado no Brinde.

Example:

9791068

rule
enum<string>
required

Regra que diz em qual condição o Comprador ganha um brinde. Se será sempre (always), baseado na quantidade de produtos no carrinho (products_quantity) ou no valor total dos prdutos (products_amount).

Available options:
always,
products_amount,
products_quantity
Example:

"products_amount"

end_at
string<date-time>

Data e hora de término

Example:

"2025-08-10 00:00:00"

min_quantity
number<integer>

Se escolher a regra para ofertar o brinde pela quantidade de produtos no carrinho, deverá definir a quantidade mínima aqui.

Required range: x >= 1
Example:

2

min_amount
number<float>

Se escolher a regra para ofertar o brinde pelo valor do carrinho, deverá definir a um valor mínimo aqui.

Required range: x >= 0.01
Example:

100

Response

Brinde criado com sucesso

Atributos do brinde

id
integer

ID do brinde

Example:

3976

active
boolean

Indica se o brinde está ativo

Example:

true

store_id
integer

ID da loja associada

Example:

176851

name
string

Nome do brinde

Example:

"Teste docs"

start_at
string<date>

Data de início da oferta do brinde

Example:

"2025-09-16"

expires_at
string<date> | null

Data de expiração do brinde (se configurado)

Example:

"2025-09-16"

resource_id
integer

ID do produto ou SKU vinculado ao brinde

Example:

9791068

resource_type
string

Pode ser produto ou SKU

Example:

"product"

rule
string

Regra aplicada ao brinde

Example:

"always"

min_quantity
integer

Quantidade mínima de produtos no carrinho para receber o brinde

Example:

0

min_amount
number<float>

Valor mínimo no carrinho para receber o brinde

Example:

0

created_at
object
updated_at
object