curl --request PUT \
--url https://api.dooki.com.br/v2/{alias}/catalog/customizations/{id} \
--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/{id}"
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.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({
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/{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/customizations/{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([
'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/{id}"
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("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/customizations/{id}")
.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/{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 \"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']"
}Atualizar customização
Atualiza uma customização existente
curl --request PUT \
--url https://api.dooki.com.br/v2/{alias}/catalog/customizations/{id} \
--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/{id}"
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.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({
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/{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/customizations/{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([
'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/{id}"
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("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/customizations/{id}")
.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/{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 \"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']"
}Body
Dados da customização
Representa os dados necessários para criar ou atualizar um customização de produto
Nome da customização
Preço da customização
Tipo da customização
Se a customização é obrigatória
Número máximo de caracteres
Descrição da customização
Opções que o cliente pode escolher na customização
Valor disponível para a customização
Response
Customização atualizada com sucesso
Campo de personalização preenchido pelo cliente na compra de um produto.
ID do produto customizado
Nome do campo de customização, exibido ao cliente.
"Primeira Letra"
Preço do produto customizado
Texto de ajuda exibido junto ao campo de customização.
"Descrição"
Tipo do campo de customização (ex.: select para lista de valores).
"select"
Indica se é obrigatório ou não
true
Valores permitidos para o campo
Há uma limitação de caracteres na customização. Exemplo: o número da camisa deve ter apenas 2 caracteres.
1
IDs dos produtos que possuem essa customização
Valores cadastrados para o cliente escolher, usados nos campos de seleção.
"['A', 'B', 'C', 'D']"
Was this page helpful?