Skip to main content
POST
/
{alias}
/
catalog
/
customizations
Criar customização
curl --request POST \
  --url https://api.dooki.com.br/v2/{alias}/catalog/customizations \
  --header 'Content-Type: application/json' \
  --header 'User-Secret-Key: <api-key>' \
  --header 'User-Token: <api-key>' \
  --data '
{
  "name": "<string>",
  "price": 123,
  "type": "<string>",
  "required": true,
  "max_chars": 123,
  "description": "<string>",
  "values": [
    "<string>"
  ]
}
'
import requests

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

payload = {
    "name": "<string>",
    "price": 123,
    "type": "<string>",
    "required": True,
    "max_chars": 123,
    "description": "<string>",
    "values": ["<string>"]
}
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: '<string>',
    price: 123,
    type: '<string>',
    required: true,
    max_chars: 123,
    description: '<string>',
    values: ['<string>']
  })
};

fetch('https://api.dooki.com.br/v2/{alias}/catalog/customizations', 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/customizations",
  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' => '<string>',
    'price' => 123,
    'type' => '<string>',
    'required' => true,
    'max_chars' => 123,
    'description' => '<string>',
    'values' => [
        '<string>'
    ]
  ]),
  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/customizations"

	payload := strings.NewReader("{\n  \"name\": \"<string>\",\n  \"price\": 123,\n  \"type\": \"<string>\",\n  \"required\": true,\n  \"max_chars\": 123,\n  \"description\": \"<string>\",\n  \"values\": [\n    \"<string>\"\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}/catalog/customizations")
  .header("User-Token", "<api-key>")
  .header("User-Secret-Key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"<string>\",\n  \"price\": 123,\n  \"type\": \"<string>\",\n  \"required\": true,\n  \"max_chars\": 123,\n  \"description\": \"<string>\",\n  \"values\": [\n    \"<string>\"\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

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

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\": \"<string>\",\n  \"price\": 123,\n  \"type\": \"<string>\",\n  \"required\": true,\n  \"max_chars\": 123,\n  \"description\": \"<string>\",\n  \"values\": [\n    \"<string>\"\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "name": "Primeira Letra",
  "price": 123,
  "description": "Descrição",
  "type": "select",
  "required": true,
  "allowed_values": "<string>",
  "max_chars": 1,
  "products_ids": [
    123
  ],
  "values": "['A', 'B', 'C', 'D']"
}

Authorizations

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

Path Parameters

alias
string
required

Alias da loja

Body

application/json

Dados da customização

Representa os dados necessários para criar ou atualizar um customização de produto

name
string
required

Nome da customização

price
number<float>
required

Preço da customização

type
string
required

Tipo da customização

required
boolean
required

Se a customização é obrigatória

max_chars
integer
required

Número máximo de caracteres

description
string

Descrição da customização

values
string[]

Valor disponível para a customização

Response

Customização criada com sucesso

id
integer

ID do produto customizado

name
string
Example:

"Primeira Letra"

price
number

Preço do produto customizado

description
string
Example:

"Descrição"

type
string
Example:

"select"

required
boolean

Indica se é obrigatório ou não

Example:

true

allowed_values
string

Valores permitidos para o campo

max_chars
integer

Há uma limitação de caracteres na customização. Exemplo: o número da camisa deve ter apenas 2 caracteres.

Example:

1

products_ids
integer[]

IDs dos produtos que possuem essa customização

values
string[]
Example:

"['A', 'B', 'C', 'D']"