Atualizar categoria
curl --request PUT \
--url https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Pizzas doces",
"status": "INACTIVE"
}
'import requests
url = "https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{id}"
payload = {
"name": "Pizzas doces",
"status": "INACTIVE"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Pizzas doces', status: 'INACTIVE'})
};
fetch('https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{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://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{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' => 'Pizzas doces',
'status' => 'INACTIVE'
]),
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://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{id}"
payload := strings.NewReader("{\n \"name\": \"Pizzas doces\",\n \"status\": \"INACTIVE\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Pizzas doces\",\n \"status\": \"INACTIVE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Pizzas doces\",\n \"status\": \"INACTIVE\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"description": "<string>",
"index": 123,
"status": "ACTIVE",
"image": {
"image_url": "<string>",
"thumbnail_url": "<string>"
},
"allowed_times": [
{
"weekday": "sunday",
"start_at": "18:00",
"end_at": "23:00"
}
],
"items": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"image": {
"image_url": "<string>",
"thumbnail_url": "<string>"
},
"highlighted": true,
"external_code": "<string>",
"price": 1,
"cost_price": 1,
"stock": 1,
"active_stock_control": true,
"index": 123,
"available_for": [
"delivery"
],
"hide_observation_field": true,
"adults_only": true,
"promotional_price_active": true,
"promotional_price": 1,
"promotional_price_schedules": [
{
"day": "sunday",
"start": "18:00",
"end": "23:00"
}
],
"status": "ACTIVE",
"unit_type": "UN",
"badge": "best_seller",
"kind": "regular_item",
"allowed_times": [
{
"weekday": "sunday",
"start_at": "18:00",
"end_at": "23:00"
}
],
"extra_images": [
{
"image_url": "<string>",
"thumbnail_url": "<string>"
}
],
"option_groups": [
{
"id": 123,
"name": "<string>",
"status": "ACTIVE",
"choice_type": "SINGLE",
"price_calculation_type": "SUM",
"minimum_quantity": 1,
"maximum_quantity": 2,
"index": 123,
"options": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"external_code": "<string>",
"status": "ACTIVE",
"image": {
"image_url": "<string>",
"thumbnail_url": "<string>"
},
"cost_price": 1,
"active_stock_control": true,
"stock": 123,
"index": 123,
"max_quantity": 123,
"price": 1,
"badge": "best_seller"
}
]
}
],
"combo_steps": [
{
"id": 123,
"name": "<string>",
"price": 1,
"remove_add_on_prices": true,
"index": 123,
"combo_step_items": [
{
"item_id": 123,
"index": 123,
"additional_price": 1
}
]
}
]
}
]
}Categorias
Atualizar categoria
Atualiza os dados de uma categoria existente. Apenas os campos enviados serão atualizados.
PUT
/
api
/
partner
/
v1
/
catalog
/
categories
/
{id}
Atualizar categoria
curl --request PUT \
--url https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Pizzas doces",
"status": "INACTIVE"
}
'import requests
url = "https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{id}"
payload = {
"name": "Pizzas doces",
"status": "INACTIVE"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Pizzas doces', status: 'INACTIVE'})
};
fetch('https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{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://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{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' => 'Pizzas doces',
'status' => 'INACTIVE'
]),
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://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{id}"
payload := strings.NewReader("{\n \"name\": \"Pizzas doces\",\n \"status\": \"INACTIVE\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Pizzas doces\",\n \"status\": \"INACTIVE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/categories/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Pizzas doces\",\n \"status\": \"INACTIVE\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"description": "<string>",
"index": 123,
"status": "ACTIVE",
"image": {
"image_url": "<string>",
"thumbnail_url": "<string>"
},
"allowed_times": [
{
"weekday": "sunday",
"start_at": "18:00",
"end_at": "23:00"
}
],
"items": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"image": {
"image_url": "<string>",
"thumbnail_url": "<string>"
},
"highlighted": true,
"external_code": "<string>",
"price": 1,
"cost_price": 1,
"stock": 1,
"active_stock_control": true,
"index": 123,
"available_for": [
"delivery"
],
"hide_observation_field": true,
"adults_only": true,
"promotional_price_active": true,
"promotional_price": 1,
"promotional_price_schedules": [
{
"day": "sunday",
"start": "18:00",
"end": "23:00"
}
],
"status": "ACTIVE",
"unit_type": "UN",
"badge": "best_seller",
"kind": "regular_item",
"allowed_times": [
{
"weekday": "sunday",
"start_at": "18:00",
"end_at": "23:00"
}
],
"extra_images": [
{
"image_url": "<string>",
"thumbnail_url": "<string>"
}
],
"option_groups": [
{
"id": 123,
"name": "<string>",
"status": "ACTIVE",
"choice_type": "SINGLE",
"price_calculation_type": "SUM",
"minimum_quantity": 1,
"maximum_quantity": 2,
"index": 123,
"options": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"external_code": "<string>",
"status": "ACTIVE",
"image": {
"image_url": "<string>",
"thumbnail_url": "<string>"
},
"cost_price": 1,
"active_stock_control": true,
"stock": 123,
"index": 123,
"max_quantity": 123,
"price": 1,
"badge": "best_seller"
}
]
}
],
"combo_steps": [
{
"id": 123,
"name": "<string>",
"price": 1,
"remove_add_on_prices": true,
"index": 123,
"combo_step_items": [
{
"item_id": 123,
"index": 123,
"additional_price": 1
}
]
}
]
}
]
}Autorizações
bearerAuthpartnerKey & apiKey
Corpo
application/json
Resposta
Categoria atualizada com sucesso.
Categoria do cardápio que agrupa itens relacionados.
Esta página foi útil?
