Update Tag
curl --request PATCH \
--url https://api.centralcart.io/v1/app/tag/{tag-id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"color": "#22c55e"
}
'import requests
url = "https://api.centralcart.io/v1/app/tag/{tag-id}"
payload = { "color": "#22c55e" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({color: '#22c55e'})
};
fetch('https://api.centralcart.io/v1/app/tag/{tag-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.centralcart.io/v1/app/tag/{tag-id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'color' => '#22c55e'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.centralcart.io/v1/app/tag/{tag-id}"
payload := strings.NewReader("{\n \"color\": \"#22c55e\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.centralcart.io/v1/app/tag/{tag-id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"color\": \"#22c55e\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/app/tag/{tag-id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"color\": \"#22c55e\"\n}"
response = http.request(request)
puts response.read_body{
"id": 12,
"store_id": 2,
"name": "VIP",
"color": "#22c55e",
"apply_to_all_packages": false,
"created_at": "2024-09-04T15:44:47.000-03:00",
"updated_at": "2024-09-05T10:12:03.000-03:00"
}Tags
Update Tag
Atualiza uma tag.
PATCH
/
app
/
tag
/
{tag-id}
Update Tag
curl --request PATCH \
--url https://api.centralcart.io/v1/app/tag/{tag-id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"color": "#22c55e"
}
'import requests
url = "https://api.centralcart.io/v1/app/tag/{tag-id}"
payload = { "color": "#22c55e" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({color: '#22c55e'})
};
fetch('https://api.centralcart.io/v1/app/tag/{tag-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.centralcart.io/v1/app/tag/{tag-id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'color' => '#22c55e'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.centralcart.io/v1/app/tag/{tag-id}"
payload := strings.NewReader("{\n \"color\": \"#22c55e\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.centralcart.io/v1/app/tag/{tag-id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"color\": \"#22c55e\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centralcart.io/v1/app/tag/{tag-id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"color\": \"#22c55e\"\n}"
response = http.request(request)
puts response.read_body{
"id": 12,
"store_id": 2,
"name": "VIP",
"color": "#22c55e",
"apply_to_all_packages": false,
"created_at": "2024-09-04T15:44:47.000-03:00",
"updated_at": "2024-09-05T10:12:03.000-03:00"
}Autorizações
Token de API gerado no painel da CentralCart.
Parâmetros de caminho
ID da tag
Corpo
application/json
Na criação, name e color são obrigatórios. Na atualização, envie só os campos que mudam.