Criar item
curl --request POST \
--url https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Margherita",
"description": "A clássica pizza italiana",
"category_id": 658,
"price": 30,
"cost_price": 12.5,
"status": "ACTIVE",
"unit_type": "UN",
"highlighted": false,
"adults_only": false,
"hide_observation_field": false,
"promotional_price_active": false,
"option_groups": [
{
"option_group_id": 1039,
"index": 1
},
{
"option_group_id": 1040,
"index": 2
}
]
}
'import requests
url = "https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/items"
payload = {
"name": "Margherita",
"description": "A clássica pizza italiana",
"category_id": 658,
"price": 30,
"cost_price": 12.5,
"status": "ACTIVE",
"unit_type": "UN",
"highlighted": False,
"adults_only": False,
"hide_observation_field": False,
"promotional_price_active": False,
"option_groups": [
{
"option_group_id": 1039,
"index": 1
},
{
"option_group_id": 1040,
"index": 2
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Margherita',
description: 'A clássica pizza italiana',
category_id: 658,
price: 30,
cost_price: 12.5,
status: 'ACTIVE',
unit_type: 'UN',
highlighted: false,
adults_only: false,
hide_observation_field: false,
promotional_price_active: false,
option_groups: [{option_group_id: 1039, index: 1}, {option_group_id: 1040, index: 2}]
})
};
fetch('https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/items', 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/items",
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([
'name' => 'Margherita',
'description' => 'A clássica pizza italiana',
'category_id' => 658,
'price' => 30,
'cost_price' => 12.5,
'status' => 'ACTIVE',
'unit_type' => 'UN',
'highlighted' => false,
'adults_only' => false,
'hide_observation_field' => false,
'promotional_price_active' => false,
'option_groups' => [
[
'option_group_id' => 1039,
'index' => 1
],
[
'option_group_id' => 1040,
'index' => 2
]
]
]),
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/items"
payload := strings.NewReader("{\n \"name\": \"Margherita\",\n \"description\": \"A clássica pizza italiana\",\n \"category_id\": 658,\n \"price\": 30,\n \"cost_price\": 12.5,\n \"status\": \"ACTIVE\",\n \"unit_type\": \"UN\",\n \"highlighted\": false,\n \"adults_only\": false,\n \"hide_observation_field\": false,\n \"promotional_price_active\": false,\n \"option_groups\": [\n {\n \"option_group_id\": 1039,\n \"index\": 1\n },\n {\n \"option_group_id\": 1040,\n \"index\": 2\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Margherita\",\n \"description\": \"A clássica pizza italiana\",\n \"category_id\": 658,\n \"price\": 30,\n \"cost_price\": 12.5,\n \"status\": \"ACTIVE\",\n \"unit_type\": \"UN\",\n \"highlighted\": false,\n \"adults_only\": false,\n \"hide_observation_field\": false,\n \"promotional_price_active\": false,\n \"option_groups\": [\n {\n \"option_group_id\": 1039,\n \"index\": 1\n },\n {\n \"option_group_id\": 1040,\n \"index\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Margherita\",\n \"description\": \"A clássica pizza italiana\",\n \"category_id\": 658,\n \"price\": 30,\n \"cost_price\": 12.5,\n \"status\": \"ACTIVE\",\n \"unit_type\": \"UN\",\n \"highlighted\": false,\n \"adults_only\": false,\n \"hide_observation_field\": false,\n \"promotional_price_active\": false,\n \"option_groups\": [\n {\n \"option_group_id\": 1039,\n \"index\": 1\n },\n {\n \"option_group_id\": 1040,\n \"index\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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
}
]
}
]
}Itens
Criar item
Cria um novo item no cardápio. O nome deve ser único no estabelecimento.
Para associar grupos de complementos, é necessário que eles tenham sido criados previamente. Em seguida, o ID de cada grupo deve ser enviado no array option_groups, utilizando o campo option_group_id.
POST
/
api
/
partner
/
v1
/
catalog
/
items
Criar item
curl --request POST \
--url https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Margherita",
"description": "A clássica pizza italiana",
"category_id": 658,
"price": 30,
"cost_price": 12.5,
"status": "ACTIVE",
"unit_type": "UN",
"highlighted": false,
"adults_only": false,
"hide_observation_field": false,
"promotional_price_active": false,
"option_groups": [
{
"option_group_id": 1039,
"index": 1
},
{
"option_group_id": 1040,
"index": 2
}
]
}
'import requests
url = "https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/items"
payload = {
"name": "Margherita",
"description": "A clássica pizza italiana",
"category_id": 658,
"price": 30,
"cost_price": 12.5,
"status": "ACTIVE",
"unit_type": "UN",
"highlighted": False,
"adults_only": False,
"hide_observation_field": False,
"promotional_price_active": False,
"option_groups": [
{
"option_group_id": 1039,
"index": 1
},
{
"option_group_id": 1040,
"index": 2
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Margherita',
description: 'A clássica pizza italiana',
category_id: 658,
price: 30,
cost_price: 12.5,
status: 'ACTIVE',
unit_type: 'UN',
highlighted: false,
adults_only: false,
hide_observation_field: false,
promotional_price_active: false,
option_groups: [{option_group_id: 1039, index: 1}, {option_group_id: 1040, index: 2}]
})
};
fetch('https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/items', 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/items",
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([
'name' => 'Margherita',
'description' => 'A clássica pizza italiana',
'category_id' => 658,
'price' => 30,
'cost_price' => 12.5,
'status' => 'ACTIVE',
'unit_type' => 'UN',
'highlighted' => false,
'adults_only' => false,
'hide_observation_field' => false,
'promotional_price_active' => false,
'option_groups' => [
[
'option_group_id' => 1039,
'index' => 1
],
[
'option_group_id' => 1040,
'index' => 2
]
]
]),
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/items"
payload := strings.NewReader("{\n \"name\": \"Margherita\",\n \"description\": \"A clássica pizza italiana\",\n \"category_id\": 658,\n \"price\": 30,\n \"cost_price\": 12.5,\n \"status\": \"ACTIVE\",\n \"unit_type\": \"UN\",\n \"highlighted\": false,\n \"adults_only\": false,\n \"hide_observation_field\": false,\n \"promotional_price_active\": false,\n \"option_groups\": [\n {\n \"option_group_id\": 1039,\n \"index\": 1\n },\n {\n \"option_group_id\": 1040,\n \"index\": 2\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Margherita\",\n \"description\": \"A clássica pizza italiana\",\n \"category_id\": 658,\n \"price\": 30,\n \"cost_price\": 12.5,\n \"status\": \"ACTIVE\",\n \"unit_type\": \"UN\",\n \"highlighted\": false,\n \"adults_only\": false,\n \"hide_observation_field\": false,\n \"promotional_price_active\": false,\n \"option_groups\": [\n {\n \"option_group_id\": 1039,\n \"index\": 1\n },\n {\n \"option_group_id\": 1040,\n \"index\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Margherita\",\n \"description\": \"A clássica pizza italiana\",\n \"category_id\": 658,\n \"price\": 30,\n \"cost_price\": 12.5,\n \"status\": \"ACTIVE\",\n \"unit_type\": \"UN\",\n \"highlighted\": false,\n \"adults_only\": false,\n \"hide_observation_field\": false,\n \"promotional_price_active\": false,\n \"option_groups\": [\n {\n \"option_group_id\": 1039,\n \"index\": 1\n },\n {\n \"option_group_id\": 1040,\n \"index\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"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
Item criado com sucesso.
Produto do cardápio que pode ser item regular ou combo.
Locais onde o item está disponível.
delivery: cardápio digital de delivery e retirada.internal_table: pedido de mesa pelo portal.table: pedido de mesa pelo cardápio digital.service_desk: cardápio digital de balcão e portal.view_only: cardápio digital de visualização.
Opções disponíveis:
delivery, table, service_desk, view_only, internal_table Esta página foi útil?
