Skip to main content
PUT
/
{alias}
/
catalog
/
categories
/
{id}
Atualizar categoria
curl --request PUT \
  --url https://api.dooki.com.br/v2/{alias}/catalog/categories/{id} \
  --header 'Content-Type: application/json' \
  --header 'User-Secret-Key: <api-key>' \
  --header 'User-Token: <api-key>' \
  --data '
{
  "active": true,
  "name": "Categoria",
  "parent_id": 123,
  "home": true,
  "featured": false,
  "price_factor": 1,
  "slug": "categoria",
  "seo_title": "Título SEO para categoria",
  "seo_keywords": "palavras, chave, SEO",
  "seo_description": "Descrição SEO",
  "external_url": "https://www.link.com",
  "canonical_url": "https://www.link.com",
  "order": 1,
  "sort_by": "relevance",
  "banners_ids": [
    123
  ]
}
'
import requests

url = "https://api.dooki.com.br/v2/{alias}/catalog/categories/{id}"

payload = {
    "active": True,
    "name": "Categoria",
    "parent_id": 123,
    "home": True,
    "featured": False,
    "price_factor": 1,
    "slug": "categoria",
    "seo_title": "Título SEO para categoria",
    "seo_keywords": "palavras, chave, SEO",
    "seo_description": "Descrição SEO",
    "external_url": "https://www.link.com",
    "canonical_url": "https://www.link.com",
    "order": 1,
    "sort_by": "relevance",
    "banners_ids": [123]
}
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,
    name: 'Categoria',
    parent_id: 123,
    home: true,
    featured: false,
    price_factor: 1,
    slug: 'categoria',
    seo_title: 'Título SEO para categoria',
    seo_keywords: 'palavras, chave, SEO',
    seo_description: 'Descrição SEO',
    external_url: 'https://www.link.com',
    canonical_url: 'https://www.link.com',
    order: 1,
    sort_by: 'relevance',
    banners_ids: [123]
  })
};

fetch('https://api.dooki.com.br/v2/{alias}/catalog/categories/{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}/catalog/categories/{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,
    'name' => 'Categoria',
    'parent_id' => 123,
    'home' => true,
    'featured' => false,
    'price_factor' => 1,
    'slug' => 'categoria',
    'seo_title' => 'Título SEO para categoria',
    'seo_keywords' => 'palavras, chave, SEO',
    'seo_description' => 'Descrição SEO',
    'external_url' => 'https://www.link.com',
    'canonical_url' => 'https://www.link.com',
    'order' => 1,
    'sort_by' => 'relevance',
    'banners_ids' => [
        123
    ]
  ]),
  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}/catalog/categories/{id}"

	payload := strings.NewReader("{\n  \"active\": true,\n  \"name\": \"Categoria\",\n  \"parent_id\": 123,\n  \"home\": true,\n  \"featured\": false,\n  \"price_factor\": 1,\n  \"slug\": \"categoria\",\n  \"seo_title\": \"Título SEO para categoria\",\n  \"seo_keywords\": \"palavras, chave, SEO\",\n  \"seo_description\": \"Descrição SEO\",\n  \"external_url\": \"https://www.link.com\",\n  \"canonical_url\": \"https://www.link.com\",\n  \"order\": 1,\n  \"sort_by\": \"relevance\",\n  \"banners_ids\": [\n    123\n  ]\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}/catalog/categories/{id}")
  .header("User-Token", "<api-key>")
  .header("User-Secret-Key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"active\": true,\n  \"name\": \"Categoria\",\n  \"parent_id\": 123,\n  \"home\": true,\n  \"featured\": false,\n  \"price_factor\": 1,\n  \"slug\": \"categoria\",\n  \"seo_title\": \"Título SEO para categoria\",\n  \"seo_keywords\": \"palavras, chave, SEO\",\n  \"seo_description\": \"Descrição SEO\",\n  \"external_url\": \"https://www.link.com\",\n  \"canonical_url\": \"https://www.link.com\",\n  \"order\": 1,\n  \"sort_by\": \"relevance\",\n  \"banners_ids\": [\n    123\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.dooki.com.br/v2/{alias}/catalog/categories/{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  \"name\": \"Categoria\",\n  \"parent_id\": 123,\n  \"home\": true,\n  \"featured\": false,\n  \"price_factor\": 1,\n  \"slug\": \"categoria\",\n  \"seo_title\": \"Título SEO para categoria\",\n  \"seo_keywords\": \"palavras, chave, SEO\",\n  \"seo_description\": \"Descrição SEO\",\n  \"external_url\": \"https://www.link.com\",\n  \"canonical_url\": \"https://www.link.com\",\n  \"order\": 1,\n  \"sort_by\": \"relevance\",\n  \"banners_ids\": [\n    123\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "merchant_id": 123,
  "parent_id": 123,
  "active": true,
  "featured": true,
  "price_factor": 123,
  "total_banners": 0,
  "sort_by": "<string>",
  "name": "<string>",
  "slug": "<string>",
  "url": "<string>",
  "description": "<string>",
  "external_url": "<string>",
  "canonical_url": "<string>",
  "order": 123,
  "is_parent": true,
  "url_path": "<string>",
  "slug_path": "<string>",
  "filters_values_ids": [
    123
  ],
  "category_cover": "<string>",
  "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

id
integer
required

ID da categoria

Body

application/json

Representa uma requisição para criar categorias

active
boolean
required
Example:

true

name
string
required
Example:

"Categoria"

parent_id
integer | null
home
boolean | null
Example:

false

price_factor
number<float>
Example:

1

slug
string
Example:

"categoria"

seo_title
string

O valor é sanitizado e normalizado automaticamente.

Example:

"Título SEO para categoria"

seo_keywords
string
Example:

"palavras, chave, SEO"

seo_description
string

O valor é sanitizado e normalizado automaticamente.

Example:

"Descrição SEO"

external_url
string<url>
Example:

"https://www.link.com"

canonical_url
string<url>
Example:

"https://www.link.com"

order
integer
Example:

1

sort_by
string
Example:

"relevance"

banners_ids
integer[]
create_redirect
object

Se presente na requisição, cria um redirect junto com a atualização. A presença do nó é o que sinaliza a intenção — o conteúdo descreve o redirect.

Response

Categoria atualizada com sucesso

id
integer
merchant_id
integer
read-only
parent_id
integer
active
boolean
price_factor
number<float>
total_banners
integer
Example:

0

sort_by
string
name
string
slug
string
url
string<url>
description
string
external_url
string
canonical_url
string
order
integer
is_parent
boolean

Indica se a categoria é principal.

url_path
string

Caminho relativo para a URL da categoria.

slug_path
string

Slug completo da categoria, incluindo hierarquia.

filters_values_ids
integer[]

Lista de IDs de filtros associados à categoria.

category_cover
string<url>

URL da imagem de capa da categoria.

created_at
object
updated_at
object