Skip to main content
GET
/
{alias}
/
public
/
search
/
products
/
promotions
Listar Promoções da loja
curl --request GET \
  --url https://api.dooki.com.br/v2/{alias}/public/search/products/promotions \
  --header 'Content-Type: application/json' \
  --data '
{
  "context": "search",
  "q": "smartphone",
  "slug": "eletronicos",
  "min": 100,
  "max": 500,
  "brand_id": [
    1,
    2,
    3
  ],
  "category_id": [
    10,
    12
  ],
  "filter_id": [
    5,
    6
  ]
}
'
import requests

url = "https://api.dooki.com.br/v2/{alias}/public/search/products/promotions"

payload = {
"context": "search",
"q": "smartphone",
"slug": "eletronicos",
"min": 100,
"max": 500,
"brand_id": [1, 2, 3],
"category_id": [10, 12],
"filter_id": [5, 6]
}
headers = {"Content-Type": "application/json"}

response = requests.get(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
context: 'search',
q: 'smartphone',
slug: 'eletronicos',
min: 100,
max: 500,
brand_id: [1, 2, 3],
category_id: [10, 12],
filter_id: [5, 6]
})
};

fetch('https://api.dooki.com.br/v2/{alias}/public/search/products/promotions', 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}/public/search/products/promotions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'context' => 'search',
'q' => 'smartphone',
'slug' => 'eletronicos',
'min' => 100,
'max' => 500,
'brand_id' => [
1,
2,
3
],
'category_id' => [
10,
12
],
'filter_id' => [
5,
6
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$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}/public/search/products/promotions"

payload := strings.NewReader("{\n \"context\": \"search\",\n \"q\": \"smartphone\",\n \"slug\": \"eletronicos\",\n \"min\": 100,\n \"max\": 500,\n \"brand_id\": [\n 1,\n 2,\n 3\n ],\n \"category_id\": [\n 10,\n 12\n ],\n \"filter_id\": [\n 5,\n 6\n ]\n}")

req, _ := http.NewRequest("GET", url, payload)

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.get("https://api.dooki.com.br/v2/{alias}/public/search/products/promotions")
.header("Content-Type", "application/json")
.body("{\n \"context\": \"search\",\n \"q\": \"smartphone\",\n \"slug\": \"eletronicos\",\n \"min\": 100,\n \"max\": 500,\n \"brand_id\": [\n 1,\n 2,\n 3\n ],\n \"category_id\": [\n 10,\n 12\n ],\n \"filter_id\": [\n 5,\n 6\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.dooki.com.br/v2/{alias}/public/search/products/promotions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"context\": \"search\",\n \"q\": \"smartphone\",\n \"slug\": \"eletronicos\",\n \"min\": 100,\n \"max\": 500,\n \"brand_id\": [\n 1,\n 2,\n 3\n ],\n \"category_id\": [\n 10,\n 12\n ],\n \"filter_id\": [\n 5,\n 6\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": 214,
  "name": "Promoção Meu Livro",
  "slug": "promocao-meu-livro",
  "url": "/promocoes/promocao-meu-livro"
}

Path Parameters

alias
string
required

Alias da loja

Body

application/json

Parâmetros para listagem de produtos com base no contexto e filtros.

context
enum<string>
required

Contexto da listagem: 'search' para busca por palavra-chave, 'category' para filtrar por categoria, 'collection' para coleção, 'promotion' para promoções.

Available options:
search,
category,
collection,
promotion
Example:

"search"

q
string | null

Palavra-chave para busca. Obrigatório quando 'context' = 'search'.

Example:

"smartphone"

slug
string | null

Identificador slug de categoria, coleção ou promoção. Obrigatório quando 'context' != 'search'.

Example:

"eletronicos"

min
number<float> | null

Preço mínimo para filtro.

Required range: x >= 0
Example:

100

max
number<float> | null

Preço máximo para filtro.

Required range: x >= 0
Example:

500

brand_id
integer[] | null

IDs das marcas dos produtos.

Example:
[1, 2, 3]
category_id
integer[] | null

IDs das categorias dos produtos.

Example:
[10, 12]
filter_id
integer[] | null

IDs dos filtros dos produtos.

Example:
[5, 6]

Response

Informações públicas das Promoções da Loja

Informações de uma promoção.

id
integer
Example:

214

name
string
Example:

"Promoção Meu Livro"

slug
string
Example:

"promocao-meu-livro"

url
string
Example:

"/promocoes/promocao-meu-livro"