curl --request PUT \
--url https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/inventory/supplies/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Farinha integral",
"external_code": "FAR-002"
}
'import requests
url = "https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/inventory/supplies/{id}"
payload = {
"name": "Farinha integral",
"external_code": "FAR-002"
}
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: 'Farinha integral', external_code: 'FAR-002'})
};
fetch('https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/inventory/supplies/{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/inventory/supplies/{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' => 'Farinha integral',
'external_code' => 'FAR-002'
]),
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/inventory/supplies/{id}"
payload := strings.NewReader("{\n \"name\": \"Farinha integral\",\n \"external_code\": \"FAR-002\"\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/inventory/supplies/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Farinha integral\",\n \"external_code\": \"FAR-002\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/inventory/supplies/{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\": \"Farinha integral\",\n \"external_code\": \"FAR-002\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"external_code": "<string>",
"name": "<string>",
"unit_type": "UN",
"allow_negative_stock": true,
"cost_price": 1,
"active_stock_control": true,
"stock": 123,
"minimum_stock": 123,
"created_at": "2023-11-07T05:31:56Z",
"supply_category": {
"id": 123,
"name": "<string>"
}
}{
"code": 4001,
"message": "Requisição inválida.",
"errors": {
"name": [
"não pode ficar em branco",
"é muito curto (mínimo: 1 caractere)"
],
"price": [
"não é um número"
]
}
}{
"code": 4010,
"message": "Token inválido."
}{
"code": 4041,
"message": "Recurso não encontrado."
}This response has no body data.Atualizar insumo
Atualiza os dados de um insumo existente. Apenas os campos enviados serão atualizados.
Os campos stock, minimum_stock e active_stock_control são somente leitura.
Este endpoint exige autenticação OAuth 2.0 com escopo catalog. Não aceita API Key.
curl --request PUT \
--url https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/inventory/supplies/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Farinha integral",
"external_code": "FAR-002"
}
'import requests
url = "https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/inventory/supplies/{id}"
payload = {
"name": "Farinha integral",
"external_code": "FAR-002"
}
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: 'Farinha integral', external_code: 'FAR-002'})
};
fetch('https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/inventory/supplies/{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/inventory/supplies/{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' => 'Farinha integral',
'external_code' => 'FAR-002'
]),
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/inventory/supplies/{id}"
payload := strings.NewReader("{\n \"name\": \"Farinha integral\",\n \"external_code\": \"FAR-002\"\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/inventory/supplies/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Farinha integral\",\n \"external_code\": \"FAR-002\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://integracao.sandbox.cardapioweb.com/api/partner/v1/catalog/inventory/supplies/{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\": \"Farinha integral\",\n \"external_code\": \"FAR-002\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"external_code": "<string>",
"name": "<string>",
"unit_type": "UN",
"allow_negative_stock": true,
"cost_price": 1,
"active_stock_control": true,
"stock": 123,
"minimum_stock": 123,
"created_at": "2023-11-07T05:31:56Z",
"supply_category": {
"id": 123,
"name": "<string>"
}
}{
"code": 4001,
"message": "Requisição inválida.",
"errors": {
"name": [
"não pode ficar em branco",
"é muito curto (mínimo: 1 caractere)"
],
"price": [
"não é um número"
]
}
}{
"code": 4010,
"message": "Token inválido."
}{
"code": 4041,
"message": "Recurso não encontrado."
}This response has no body data.Autorizações
Access token OAuth 2.0 de app instalado na CW App Store. Escopo: catalog.
Parâmetros de caminho
ID do insumo.
Corpo
Nome do insumo.
1 - 200Código externo do insumo.
50ID da nova categoria de insumos.
Unidade de medida do insumo.
UN: unidade (padrão).KG: quilograma.L: litro.
UN, KG, L Indica se o estoque pode ficar negativo.
Preço de custo do insumo. Deve ser um número positivo com no máximo 2 casas decimais.
x >= 0Resposta
Insumo atualizado com sucesso.
Insumo do estabelecimento.
Identificador único do insumo.
Código externo do insumo.
Nome do insumo.
Unidade de medida do insumo.
UN: unidade (padrão).KG: quilograma.L: litro.
UN, KG, L Indica se o estoque pode ficar negativo.
Preço de custo do insumo. Deve ser um número positivo com no máximo 2 casas decimais.
x >= 0Indica se o controle de estoque está ativo. Somente leitura.
Quantidade disponível em estoque. Somente leitura.
Estoque mínimo. Somente leitura.
Data e hora de criação do insumo.
Categoria à qual o insumo pertence.
Show child attributes
Show child attributes
Esta página foi útil?
