Criar upsell
curl --request POST \
--url https://api.dooki.com.br/v2/{alias}/pricing/upsells \
--header 'Content-Type: application/json' \
--header 'User-Secret-Key: <api-key>' \
--header 'User-Token: <api-key>' \
--data '
{
"active": true,
"name": "Combo Protetor + Película",
"context": "before",
"suggested_product_id": 34025022,
"resource_type": "product",
"description": "Aproveite e proteja seu smartphone com esse combo especial",
"email_subject": "Não perca essa oferta especial para seu produto!",
"sms": "Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}",
"type": "product",
"discount_type": "percentage",
"discount_amount": 20,
"product_price": 40,
"product_quantity": 2,
"trigger_resource_id": [
42,
51
]
}
'import requests
url = "https://api.dooki.com.br/v2/{alias}/pricing/upsells"
payload = {
"active": True,
"name": "Combo Protetor + Película",
"context": "before",
"suggested_product_id": 34025022,
"resource_type": "product",
"description": "Aproveite e proteja seu smartphone com esse combo especial",
"email_subject": "Não perca essa oferta especial para seu produto!",
"sms": "Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}",
"type": "product",
"discount_type": "percentage",
"discount_amount": 20,
"product_price": 40,
"product_quantity": 2,
"trigger_resource_id": [42, 51]
}
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({
active: true,
name: 'Combo Protetor + Película',
context: 'before',
suggested_product_id: 34025022,
resource_type: 'product',
description: 'Aproveite e proteja seu smartphone com esse combo especial',
email_subject: 'Não perca essa oferta especial para seu produto!',
sms: 'Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}',
type: 'product',
discount_type: 'percentage',
discount_amount: 20,
product_price: 40,
product_quantity: 2,
trigger_resource_id: [42, 51]
})
};
fetch('https://api.dooki.com.br/v2/{alias}/pricing/upsells', 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}/pricing/upsells",
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([
'active' => true,
'name' => 'Combo Protetor + Película',
'context' => 'before',
'suggested_product_id' => 34025022,
'resource_type' => 'product',
'description' => 'Aproveite e proteja seu smartphone com esse combo especial',
'email_subject' => 'Não perca essa oferta especial para seu produto!',
'sms' => 'Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}',
'type' => 'product',
'discount_type' => 'percentage',
'discount_amount' => 20,
'product_price' => 40,
'product_quantity' => 2,
'trigger_resource_id' => [
42,
51
]
]),
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}/pricing/upsells"
payload := strings.NewReader("{\n \"active\": true,\n \"name\": \"Combo Protetor + Película\",\n \"context\": \"before\",\n \"suggested_product_id\": 34025022,\n \"resource_type\": \"product\",\n \"description\": \"Aproveite e proteja seu smartphone com esse combo especial\",\n \"email_subject\": \"Não perca essa oferta especial para seu produto!\",\n \"sms\": \"Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}\",\n \"type\": \"product\",\n \"discount_type\": \"percentage\",\n \"discount_amount\": 20,\n \"product_price\": 40,\n \"product_quantity\": 2,\n \"trigger_resource_id\": [\n 42,\n 51\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}/pricing/upsells")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"name\": \"Combo Protetor + Película\",\n \"context\": \"before\",\n \"suggested_product_id\": 34025022,\n \"resource_type\": \"product\",\n \"description\": \"Aproveite e proteja seu smartphone com esse combo especial\",\n \"email_subject\": \"Não perca essa oferta especial para seu produto!\",\n \"sms\": \"Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}\",\n \"type\": \"product\",\n \"discount_type\": \"percentage\",\n \"discount_amount\": 20,\n \"product_price\": 40,\n \"product_quantity\": 2,\n \"trigger_resource_id\": [\n 42,\n 51\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dooki.com.br/v2/{alias}/pricing/upsells")
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 \"active\": true,\n \"name\": \"Combo Protetor + Película\",\n \"context\": \"before\",\n \"suggested_product_id\": 34025022,\n \"resource_type\": \"product\",\n \"description\": \"Aproveite e proteja seu smartphone com esse combo especial\",\n \"email_subject\": \"Não perca essa oferta especial para seu produto!\",\n \"sms\": \"Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}\",\n \"type\": \"product\",\n \"discount_type\": \"percentage\",\n \"discount_amount\": 20,\n \"product_price\": 40,\n \"product_quantity\": 2,\n \"trigger_resource_id\": [\n 42,\n 51\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 123,
"suggested_product_id": 123,
"active": true,
"context": "<string>",
"product_price": 123,
"product_quantity": 123,
"name": "<string>",
"description": "<string>",
"email_subject": "<string>",
"sms": "<string>",
"views": 123
}
]
}Upsells
Criar upsell
Cria um novo upsell
POST
/
{alias}
/
pricing
/
upsells
Criar upsell
curl --request POST \
--url https://api.dooki.com.br/v2/{alias}/pricing/upsells \
--header 'Content-Type: application/json' \
--header 'User-Secret-Key: <api-key>' \
--header 'User-Token: <api-key>' \
--data '
{
"active": true,
"name": "Combo Protetor + Película",
"context": "before",
"suggested_product_id": 34025022,
"resource_type": "product",
"description": "Aproveite e proteja seu smartphone com esse combo especial",
"email_subject": "Não perca essa oferta especial para seu produto!",
"sms": "Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}",
"type": "product",
"discount_type": "percentage",
"discount_amount": 20,
"product_price": 40,
"product_quantity": 2,
"trigger_resource_id": [
42,
51
]
}
'import requests
url = "https://api.dooki.com.br/v2/{alias}/pricing/upsells"
payload = {
"active": True,
"name": "Combo Protetor + Película",
"context": "before",
"suggested_product_id": 34025022,
"resource_type": "product",
"description": "Aproveite e proteja seu smartphone com esse combo especial",
"email_subject": "Não perca essa oferta especial para seu produto!",
"sms": "Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}",
"type": "product",
"discount_type": "percentage",
"discount_amount": 20,
"product_price": 40,
"product_quantity": 2,
"trigger_resource_id": [42, 51]
}
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({
active: true,
name: 'Combo Protetor + Película',
context: 'before',
suggested_product_id: 34025022,
resource_type: 'product',
description: 'Aproveite e proteja seu smartphone com esse combo especial',
email_subject: 'Não perca essa oferta especial para seu produto!',
sms: 'Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}',
type: 'product',
discount_type: 'percentage',
discount_amount: 20,
product_price: 40,
product_quantity: 2,
trigger_resource_id: [42, 51]
})
};
fetch('https://api.dooki.com.br/v2/{alias}/pricing/upsells', 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}/pricing/upsells",
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([
'active' => true,
'name' => 'Combo Protetor + Película',
'context' => 'before',
'suggested_product_id' => 34025022,
'resource_type' => 'product',
'description' => 'Aproveite e proteja seu smartphone com esse combo especial',
'email_subject' => 'Não perca essa oferta especial para seu produto!',
'sms' => 'Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}',
'type' => 'product',
'discount_type' => 'percentage',
'discount_amount' => 20,
'product_price' => 40,
'product_quantity' => 2,
'trigger_resource_id' => [
42,
51
]
]),
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}/pricing/upsells"
payload := strings.NewReader("{\n \"active\": true,\n \"name\": \"Combo Protetor + Película\",\n \"context\": \"before\",\n \"suggested_product_id\": 34025022,\n \"resource_type\": \"product\",\n \"description\": \"Aproveite e proteja seu smartphone com esse combo especial\",\n \"email_subject\": \"Não perca essa oferta especial para seu produto!\",\n \"sms\": \"Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}\",\n \"type\": \"product\",\n \"discount_type\": \"percentage\",\n \"discount_amount\": 20,\n \"product_price\": 40,\n \"product_quantity\": 2,\n \"trigger_resource_id\": [\n 42,\n 51\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}/pricing/upsells")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"name\": \"Combo Protetor + Película\",\n \"context\": \"before\",\n \"suggested_product_id\": 34025022,\n \"resource_type\": \"product\",\n \"description\": \"Aproveite e proteja seu smartphone com esse combo especial\",\n \"email_subject\": \"Não perca essa oferta especial para seu produto!\",\n \"sms\": \"Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}\",\n \"type\": \"product\",\n \"discount_type\": \"percentage\",\n \"discount_amount\": 20,\n \"product_price\": 40,\n \"product_quantity\": 2,\n \"trigger_resource_id\": [\n 42,\n 51\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dooki.com.br/v2/{alias}/pricing/upsells")
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 \"active\": true,\n \"name\": \"Combo Protetor + Película\",\n \"context\": \"before\",\n \"suggested_product_id\": 34025022,\n \"resource_type\": \"product\",\n \"description\": \"Aproveite e proteja seu smartphone com esse combo especial\",\n \"email_subject\": \"Não perca essa oferta especial para seu produto!\",\n \"sms\": \"Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}\",\n \"type\": \"product\",\n \"discount_type\": \"percentage\",\n \"discount_amount\": 20,\n \"product_price\": 40,\n \"product_quantity\": 2,\n \"trigger_resource_id\": [\n 42,\n 51\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": 123,
"suggested_product_id": 123,
"active": true,
"context": "<string>",
"product_price": 123,
"product_quantity": 123,
"name": "<string>",
"description": "<string>",
"email_subject": "<string>",
"sms": "<string>",
"views": 123
}
]
}Path Parameters
Alias da loja
Body
application/json
Example:
true
Example:
"Combo Protetor + Película"
Available options:
before, after, delayed, manual Example:
"before"
Example:
34025022
Available options:
always, product, category, brand Example:
"product"
Example:
"Aproveite e proteja seu smartphone com esse combo especial"
Example:
"Não perca essa oferta especial para seu produto!"
Example:
"Aproveite 20% OFF no combo protetor + película para seu smartphone! Clique aqui: {link}"
Available options:
product Example:
"product"
Available options:
percentage, fixed Example:
"percentage"
Example:
20
Example:
40
Example:
2
Example:
[42, 51]Response
Upsell criado com sucesso
Show child attributes
Show child attributes
Was this page helpful?
⌘I