Skip to main content
PUT
/
{alias}
/
customers
/
clusters
/
{id}
Atualizar cluster de clientes
curl --request PUT \
  --url https://api.dooki.com.br/v2/{alias}/customers/clusters/{id} \
  --header 'Content-Type: application/json' \
  --header 'User-Secret-Key: <api-key>' \
  --header 'User-Token: <api-key>' \
  --data '
{
  "name": "<string>",
  "person_type": "<string>",
  "min_order_value": "<string>",
  "base_price_percent": "<string>",
  "shipping_rules": [
    {
      "country": "<string>",
      "zipcode_min": 123,
      "zipcode_max": 123,
      "min_order_value": "<string>",
      "shipment_discount_percent": "<string>"
    }
  ],
  "active": true,
  "attach_on_signup": true,
  "payments_ids": [
    123
  ],
  "carriers_ids": [
    123
  ]
}
'
import requests

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

payload = {
"name": "<string>",
"person_type": "<string>",
"min_order_value": "<string>",
"base_price_percent": "<string>",
"shipping_rules": [
{
"country": "<string>",
"zipcode_min": 123,
"zipcode_max": 123,
"min_order_value": "<string>",
"shipment_discount_percent": "<string>"
}
],
"active": True,
"attach_on_signup": True,
"payments_ids": [123],
"carriers_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({
name: '<string>',
person_type: '<string>',
min_order_value: '<string>',
base_price_percent: '<string>',
shipping_rules: [
{
country: '<string>',
zipcode_min: 123,
zipcode_max: 123,
min_order_value: '<string>',
shipment_discount_percent: '<string>'
}
],
active: true,
attach_on_signup: true,
payments_ids: [123],
carriers_ids: [123]
})
};

fetch('https://api.dooki.com.br/v2/{alias}/customers/clusters/{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}/customers/clusters/{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>',
'person_type' => '<string>',
'min_order_value' => '<string>',
'base_price_percent' => '<string>',
'shipping_rules' => [
[
'country' => '<string>',
'zipcode_min' => 123,
'zipcode_max' => 123,
'min_order_value' => '<string>',
'shipment_discount_percent' => '<string>'
]
],
'active' => true,
'attach_on_signup' => true,
'payments_ids' => [
123
],
'carriers_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}/customers/clusters/{id}"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"person_type\": \"<string>\",\n \"min_order_value\": \"<string>\",\n \"base_price_percent\": \"<string>\",\n \"shipping_rules\": [\n {\n \"country\": \"<string>\",\n \"zipcode_min\": 123,\n \"zipcode_max\": 123,\n \"min_order_value\": \"<string>\",\n \"shipment_discount_percent\": \"<string>\"\n }\n ],\n \"active\": true,\n \"attach_on_signup\": true,\n \"payments_ids\": [\n 123\n ],\n \"carriers_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}/customers/clusters/{id}")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"person_type\": \"<string>\",\n \"min_order_value\": \"<string>\",\n \"base_price_percent\": \"<string>\",\n \"shipping_rules\": [\n {\n \"country\": \"<string>\",\n \"zipcode_min\": 123,\n \"zipcode_max\": 123,\n \"min_order_value\": \"<string>\",\n \"shipment_discount_percent\": \"<string>\"\n }\n ],\n \"active\": true,\n \"attach_on_signup\": true,\n \"payments_ids\": [\n 123\n ],\n \"carriers_ids\": [\n 123\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.dooki.com.br/v2/{alias}/customers/clusters/{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 \"person_type\": \"<string>\",\n \"min_order_value\": \"<string>\",\n \"base_price_percent\": \"<string>\",\n \"shipping_rules\": [\n {\n \"country\": \"<string>\",\n \"zipcode_min\": 123,\n \"zipcode_max\": 123,\n \"min_order_value\": \"<string>\",\n \"shipment_discount_percent\": \"<string>\"\n }\n ],\n \"active\": true,\n \"attach_on_signup\": true,\n \"payments_ids\": [\n 123\n ],\n \"carriers_ids\": [\n 123\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "id": 123,
      "name": "<string>",
      "active": true,
      "attach_on_signup": true,
      "person_type": "<string>",
      "min_order_value": 123,
      "base_price_percent": 123,
      "payments_ids": [
        123
      ],
      "carriers_ids": [
        123
      ],
      "restrictions": {
        "include": {
          "products_ids": [
            123
          ],
          "brands_ids": [
            123
          ],
          "collections_ids": [
            123
          ],
          "categories_ids": [
            123
          ]
        }
      },
      "exclude": {
        "products_ids": [
          123
        ],
        "brands_ids": [
          123
        ],
        "collections_ids": [
          123
        ],
        "categories_ids": [
          123
        ]
      },
      "include_ids": "[987, 654, 456, 321, 123]",
      "exclude_ids": "[123, 321]",
      "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"
      }
    }
  ]
}
Envie somente os campos obrigatórios e os que deseja alterar, para reduzir validações desnecessárias. Caso não envie um campo, o mesmo será mantido com o valor atual.

Authorizations

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

Path Parameters

alias
string
required

Alias da loja

id
integer
required

ID do cluster

Body

application/json

Representa os dados necessários para criar ou atualizar um cluster de clientes

name
string
required

Nome do cluster

person_type
string
required

Tipo de pessoa

min_order_value
string
required

Valor mínimo do pedido

base_price_percent
string
required

Percentual do preço base

shipping_rules
object[]
required
active
boolean

Status do cluster

attach_on_signup
boolean

Anexar ao cadastro

payments_ids
integer[]

IDs dos métodos de pagamento

carriers_ids
integer[]

IDs das transportadoras

Response

Cluster atualizado com sucesso

data
Cluster de clientes · object[]