Atualizar cashback
curl --request POST \
--url https://api.dooki.com.br/v2/{alias}/pricing/cashbacks \
--header 'Content-Type: application/json' \
--header 'User-Secret-Key: <api-key>' \
--header 'User-Token: <api-key>' \
--data '
{
"active": true,
"name": "Nome do cashback. Esse valor deve ser único.",
"min_amount": 123,
"max_amount": 123,
"valid_for": 123,
"percent_amount": 123,
"has_expiration": true,
"starts_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.dooki.com.br/v2/{alias}/pricing/cashbacks"
payload = {
"active": True,
"name": "Nome do cashback. Esse valor deve ser único.",
"min_amount": 123,
"max_amount": 123,
"valid_for": 123,
"percent_amount": 123,
"has_expiration": True,
"starts_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
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: 'Nome do cashback. Esse valor deve ser único.',
min_amount: 123,
max_amount: 123,
valid_for: 123,
percent_amount: 123,
has_expiration: true,
starts_at: '2023-11-07T05:31:56Z',
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.dooki.com.br/v2/{alias}/pricing/cashbacks', 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/cashbacks",
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' => 'Nome do cashback. Esse valor deve ser único.',
'min_amount' => 123,
'max_amount' => 123,
'valid_for' => 123,
'percent_amount' => 123,
'has_expiration' => true,
'starts_at' => '2023-11-07T05:31:56Z',
'expires_at' => '2023-11-07T05:31:56Z'
]),
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/cashbacks"
payload := strings.NewReader("{\n \"active\": true,\n \"name\": \"Nome do cashback. Esse valor deve ser único.\",\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"valid_for\": 123,\n \"percent_amount\": 123,\n \"has_expiration\": true,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\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/cashbacks")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"name\": \"Nome do cashback. Esse valor deve ser único.\",\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"valid_for\": 123,\n \"percent_amount\": 123,\n \"has_expiration\": true,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dooki.com.br/v2/{alias}/pricing/cashbacks")
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\": \"Nome do cashback. Esse valor deve ser único.\",\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"valid_for\": 123,\n \"percent_amount\": 123,\n \"has_expiration\": true,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"store_id": 123,
"token": "<string>",
"active": true,
"name": "Exemplo de cashback",
"min_amount": 123,
"max_amount": 123,
"valid_for": 123,
"percent_amount": 123,
"has_expiration": true,
"starts_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
},
"expires_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
},
"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"
}
}Cashback
Criar Cashbacks
Atualiza os detalhes de um cashback específico
POST
/
{alias}
/
pricing
/
cashbacks
Atualizar cashback
curl --request POST \
--url https://api.dooki.com.br/v2/{alias}/pricing/cashbacks \
--header 'Content-Type: application/json' \
--header 'User-Secret-Key: <api-key>' \
--header 'User-Token: <api-key>' \
--data '
{
"active": true,
"name": "Nome do cashback. Esse valor deve ser único.",
"min_amount": 123,
"max_amount": 123,
"valid_for": 123,
"percent_amount": 123,
"has_expiration": true,
"starts_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.dooki.com.br/v2/{alias}/pricing/cashbacks"
payload = {
"active": True,
"name": "Nome do cashback. Esse valor deve ser único.",
"min_amount": 123,
"max_amount": 123,
"valid_for": 123,
"percent_amount": 123,
"has_expiration": True,
"starts_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}
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: 'Nome do cashback. Esse valor deve ser único.',
min_amount: 123,
max_amount: 123,
valid_for: 123,
percent_amount: 123,
has_expiration: true,
starts_at: '2023-11-07T05:31:56Z',
expires_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.dooki.com.br/v2/{alias}/pricing/cashbacks', 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/cashbacks",
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' => 'Nome do cashback. Esse valor deve ser único.',
'min_amount' => 123,
'max_amount' => 123,
'valid_for' => 123,
'percent_amount' => 123,
'has_expiration' => true,
'starts_at' => '2023-11-07T05:31:56Z',
'expires_at' => '2023-11-07T05:31:56Z'
]),
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/cashbacks"
payload := strings.NewReader("{\n \"active\": true,\n \"name\": \"Nome do cashback. Esse valor deve ser único.\",\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"valid_for\": 123,\n \"percent_amount\": 123,\n \"has_expiration\": true,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\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/cashbacks")
.header("User-Token", "<api-key>")
.header("User-Secret-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"name\": \"Nome do cashback. Esse valor deve ser único.\",\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"valid_for\": 123,\n \"percent_amount\": 123,\n \"has_expiration\": true,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dooki.com.br/v2/{alias}/pricing/cashbacks")
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\": \"Nome do cashback. Esse valor deve ser único.\",\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"valid_for\": 123,\n \"percent_amount\": 123,\n \"has_expiration\": true,\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"store_id": 123,
"token": "<string>",
"active": true,
"name": "Exemplo de cashback",
"min_amount": 123,
"max_amount": 123,
"valid_for": 123,
"percent_amount": 123,
"has_expiration": true,
"starts_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
},
"expires_at": {
"date": "2000-08-17 10:24:24",
"timezone_type": 3,
"timezone": "America/Sao_Paulo"
},
"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"
}
}Path Parameters
Alias da loja
Body
application/json
Example:
true
Example:
"Nome do cashback. Esse valor deve ser único."
Example:
true
Data de início
Data de término
Response
Cashback criado com sucesso
Representa um cashback
Example:
"Exemplo de cashback"
Dias de validade
Percentual de cashback
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I