Skip to main content
PUT
/
{alias}
/
catalog
/
products
/
{id}
/
skus
/
batch-update-skus
Atualizar SKUs em massa
curl --request PUT \
  --url https://api.dooki.com.br/v2/{alias}/catalog/products/{id}/skus/batch-update-skus \
  --header 'Content-Type: application/json' \
  --header 'User-Secret-Key: <api-key>' \
  --header 'User-Token: <api-key>' \
  --data '
{
  "product_id": 123,
  "update_all": true,
  "grid_options_filter": [
    1,
    2,
    3,
    4
  ],
  "price_cost": 123,
  "price_sale": 123,
  "price_discount": 123,
  "weight": 123,
  "height": 123,
  "width": 123,
  "length": 123,
  "blocked_sale": true,
  "skus_id": [
    123
  ]
}
'
import requests

url = "https://api.dooki.com.br/v2/{alias}/catalog/products/{id}/skus/batch-update-skus"

payload = {
"product_id": 123,
"update_all": True,
"grid_options_filter": [1, 2, 3, 4],
"price_cost": 123,
"price_sale": 123,
"price_discount": 123,
"weight": 123,
"height": 123,
"width": 123,
"length": 123,
"blocked_sale": True,
"skus_id": [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({
product_id: 123,
update_all: true,
grid_options_filter: [1, 2, 3, 4],
price_cost: 123,
price_sale: 123,
price_discount: 123,
weight: 123,
height: 123,
width: 123,
length: 123,
blocked_sale: true,
skus_id: [123]
})
};

fetch('https://api.dooki.com.br/v2/{alias}/catalog/products/{id}/skus/batch-update-skus', 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/products/{id}/skus/batch-update-skus",
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([
'product_id' => 123,
'update_all' => true,
'grid_options_filter' => [
1,
2,
3,
4
],
'price_cost' => 123,
'price_sale' => 123,
'price_discount' => 123,
'weight' => 123,
'height' => 123,
'width' => 123,
'length' => 123,
'blocked_sale' => true,
'skus_id' => [
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/products/{id}/skus/batch-update-skus"

payload := strings.NewReader("{\n \"product_id\": 123,\n \"update_all\": true,\n \"grid_options_filter\": [\n 1,\n 2,\n 3,\n 4\n ],\n \"price_cost\": 123,\n \"price_sale\": 123,\n \"price_discount\": 123,\n \"weight\": 123,\n \"height\": 123,\n \"width\": 123,\n \"length\": 123,\n \"blocked_sale\": true,\n \"skus_id\": [\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/products/{id}/skus/batch-update-skus")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": 123,\n \"update_all\": true,\n \"grid_options_filter\": [\n 1,\n 2,\n 3,\n 4\n ],\n \"price_cost\": 123,\n \"price_sale\": 123,\n \"price_discount\": 123,\n \"weight\": 123,\n \"height\": 123,\n \"width\": 123,\n \"length\": 123,\n \"blocked_sale\": true,\n \"skus_id\": [\n 123\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.dooki.com.br/v2/{alias}/catalog/products/{id}/skus/batch-update-skus")

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 \"product_id\": 123,\n \"update_all\": true,\n \"grid_options_filter\": [\n 1,\n 2,\n 3,\n 4\n ],\n \"price_cost\": 123,\n \"price_sale\": 123,\n \"price_discount\": 123,\n \"weight\": 123,\n \"height\": 123,\n \"width\": 123,\n \"length\": 123,\n \"blocked_sale\": true,\n \"skus_id\": [\n 123\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "updated": 123
  }
}

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 produto

Body

application/json

Representa os dados que são possíveis atualizar em lote para os SKUs de um produto específico.

product_id
integer
required
update_all
boolean

Indica se a atualização deve ser aplicada a todos os SKUs do produto. Se definido como true, o campo skus_id não é necessário.

Example:

true

grid_options_filter
integer[]
Example:
[1, 2, 3, 4]
price_cost
number<float>
price_sale
number<float>
price_discount
number<float>
weight
number<float>
height
number<float>
width
number<float>
length
number<float>
blocked_sale
boolean
skus_id
integer[]

Response

Atualização dos SKUs iniciada, com informação se foi sincrona ou assincronamente

data
object