Atualizar Produto
curl --request PATCH \
--url https://garu.com.br/api/v1/products/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"value": 123,
"pix": true,
"creditCard": true,
"boleto": true,
"pixAutomatic": true,
"installments": 123,
"image": "<string>",
"returnUrl": "<string>",
"returnUrlButtonText": "<string>",
"isSubscription": true
}
'import requests
url = "https://garu.com.br/api/v1/products/{uuid}"
payload = {
"name": "<string>",
"description": "<string>",
"value": 123,
"pix": True,
"creditCard": True,
"boleto": True,
"pixAutomatic": True,
"installments": 123,
"image": "<string>",
"returnUrl": "<string>",
"returnUrlButtonText": "<string>",
"isSubscription": True
}
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({
name: '<string>',
description: '<string>',
value: 123,
pix: true,
creditCard: true,
boleto: true,
pixAutomatic: true,
installments: 123,
image: '<string>',
returnUrl: '<string>',
returnUrlButtonText: '<string>',
isSubscription: true
})
};
fetch('https://garu.com.br/api/v1/products/{uuid}', 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://garu.com.br/api/v1/products/{uuid}",
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([
'name' => '<string>',
'description' => '<string>',
'value' => 123,
'pix' => true,
'creditCard' => true,
'boleto' => true,
'pixAutomatic' => true,
'installments' => 123,
'image' => '<string>',
'returnUrl' => '<string>',
'returnUrlButtonText' => '<string>',
'isSubscription' => true
]),
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://garu.com.br/api/v1/products/{uuid}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"value\": 123,\n \"pix\": true,\n \"creditCard\": true,\n \"boleto\": true,\n \"pixAutomatic\": true,\n \"installments\": 123,\n \"image\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"returnUrlButtonText\": \"<string>\",\n \"isSubscription\": true\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://garu.com.br/api/v1/products/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"value\": 123,\n \"pix\": true,\n \"creditCard\": true,\n \"boleto\": true,\n \"pixAutomatic\": true,\n \"installments\": 123,\n \"image\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"returnUrlButtonText\": \"<string>\",\n \"isSubscription\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/v1/products/{uuid}")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"value\": 123,\n \"pix\": true,\n \"creditCard\": true,\n \"boleto\": true,\n \"pixAutomatic\": true,\n \"installments\": 123,\n \"image\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"returnUrlButtonText\": \"<string>\",\n \"isSubscription\": true\n}"
response = http.request(request)
puts response.read_bodyProdutos
Atualizar Produto
Atualize os dados de um produto existente
PATCH
/
api
/
v1
/
products
/
{uuid}
Atualizar Produto
curl --request PATCH \
--url https://garu.com.br/api/v1/products/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"value": 123,
"pix": true,
"creditCard": true,
"boleto": true,
"pixAutomatic": true,
"installments": 123,
"image": "<string>",
"returnUrl": "<string>",
"returnUrlButtonText": "<string>",
"isSubscription": true
}
'import requests
url = "https://garu.com.br/api/v1/products/{uuid}"
payload = {
"name": "<string>",
"description": "<string>",
"value": 123,
"pix": True,
"creditCard": True,
"boleto": True,
"pixAutomatic": True,
"installments": 123,
"image": "<string>",
"returnUrl": "<string>",
"returnUrlButtonText": "<string>",
"isSubscription": True
}
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({
name: '<string>',
description: '<string>',
value: 123,
pix: true,
creditCard: true,
boleto: true,
pixAutomatic: true,
installments: 123,
image: '<string>',
returnUrl: '<string>',
returnUrlButtonText: '<string>',
isSubscription: true
})
};
fetch('https://garu.com.br/api/v1/products/{uuid}', 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://garu.com.br/api/v1/products/{uuid}",
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([
'name' => '<string>',
'description' => '<string>',
'value' => 123,
'pix' => true,
'creditCard' => true,
'boleto' => true,
'pixAutomatic' => true,
'installments' => 123,
'image' => '<string>',
'returnUrl' => '<string>',
'returnUrlButtonText' => '<string>',
'isSubscription' => true
]),
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://garu.com.br/api/v1/products/{uuid}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"value\": 123,\n \"pix\": true,\n \"creditCard\": true,\n \"boleto\": true,\n \"pixAutomatic\": true,\n \"installments\": 123,\n \"image\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"returnUrlButtonText\": \"<string>\",\n \"isSubscription\": true\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://garu.com.br/api/v1/products/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"value\": 123,\n \"pix\": true,\n \"creditCard\": true,\n \"boleto\": true,\n \"pixAutomatic\": true,\n \"installments\": 123,\n \"image\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"returnUrlButtonText\": \"<string>\",\n \"isSubscription\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/v1/products/{uuid}")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"value\": 123,\n \"pix\": true,\n \"creditCard\": true,\n \"boleto\": true,\n \"pixAutomatic\": true,\n \"installments\": 123,\n \"image\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"returnUrlButtonText\": \"<string>\",\n \"isSubscription\": true\n}"
response = http.request(request)
puts response.read_bodyVisão Geral
Use este endpoint para atualizar as informações de um produto existente. Apenas os campos enviados serão atualizados.Parâmetros de Path
string
required
UUID do produto a ser atualizado.
Parâmetros do Body
Todos os campos são opcionais. Envie apenas os que deseja atualizar.string
Novo nome do produto.
string
Nova descrição do produto.
number
Novo preço do produto em Reais (BRL decimal, ex:
347.00), nunca em centavos. Envie 0 para deixar o produto sem preço; qualquer outro preço precisa ser de **pelo menos R5,00∗∗.DeR 0,01 a R$ 4,99, ou um valor negativo, a API responde 400.Omita o campo para manter o preço atual. A regra do mínimo só vale quando o pedido define um preço: um produto que já custava menos de R$ 5,00 continua vendendo, e um pedido que só troca o nome ou liga o PIX passa normalmente.boolean
Habilitar/desabilitar pagamento via PIX.
boolean
Habilitar/desabilitar pagamento via cartão de crédito.
boolean
Habilitar/desabilitar pagamento via boleto.
boolean
Habilitar/desabilitar o Pix Automático (débito recorrente do Pix) no produto. Enviar
false impede novas assinaturas por Pix Automático nesse produto; as assinaturas já ativas continuam sendo cobradas normalmente.number
Novo número máximo de parcelas (1-12).
string
Nova URL da imagem do produto.
string
Nova URL de retorno após pagamento.
string
Novo texto do botão de retorno.
boolean
Transforma o produto em assinatura (
true) ou em venda avulsa (false). Transformar um produto de assinatura em venda avulsa conta como definir o preço: o value guardado nele passa a ser o preço do link, e precisa ser 0 ou pelo menos R$ 5,00.Exemplo de Requisição
curl -X PATCH https://garu.com.br/api/v1/products/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer sk_test_sua_chave_api" \
-H "Content-Type: application/json" \
-d '{
"value": 347.00,
"installments": 6
}'
const response = await fetch('https://garu.com.br/api/v1/products/a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${process.env.GARU_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
value: 347.00,
installments: 6
})
});
const product = await response.json();
console.log(`Produto atualizado: ${product.name} - R$ ${product.value}`);
import requests
import os
url = "https://garu.com.br/api/v1/products/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
headers = {
"Authorization": f"Bearer {os.environ['GARU_API_KEY']}",
"Content-Type": "application/json"
}
payload = {
"value": 347.00,
"installments": 6
}
response = requests.patch(url, json=payload, headers=headers)
product = response.json()
print(f"Produto atualizado: {product['name']} - R$ {product['value']}")
Resposta de Sucesso (200 OK)
{
"name": "Curso de Marketing Digital",
"description": "Aprenda marketing digital do zero ao avançado",
"value": 347.00,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"pix": true,
"creditCard": true,
"boleto": true,
"installments": [
{ "quantity": 1, "value": 347.00 },
{ "quantity": 2, "value": 179.32 },
{ "quantity": 3, "value": 122.61 },
{ "quantity": 4, "value": 94.28 },
{ "quantity": 5, "value": 77.30 },
{ "quantity": 6, "value": 66.05 }
],
"isActive": true,
"createdAt": "2024-12-24T10:30:00.000Z",
"updatedAt": "2024-12-24T14:45:00.000Z"
}
O
uuid do produto não muda ao atualizar. O link de pagamento permanece o mesmo.Erros Comuns
400 - Preço abaixo do mínimo
400 - Preço abaixo do mínimo
{
"statusCode": 400,
"timestamp": "2026-09-30T21:00:00.000Z",
"path": "/api/v1/products/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "O preço mínimo de um produto é R$ 5,00. Use R$ 0,00 para um produto sem preço."
}
value de pelo menos 5.00, ou 0 para deixar o produto sem preço. Se você não quer mudar o preço, não envie value.404 - Produto não encontrado
404 - Produto não encontrado
{
"statusCode": 404,
"message": "Product not found"
}
403 - Sem permissão
403 - Sem permissão
{
"statusCode": 403,
"message": "Insufficient permissions"
}
Próximos Passos
Excluir Produto
Desative um produto
Webhooks
Receba notificações de eventos
Was this page helpful?