Excluir Produto
curl --request DELETE \
--url https://garu.com.br/api/v1/products/{uuid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://garu.com.br/api/v1/products/{uuid}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
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 => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://garu.com.br/api/v1/products/{uuid}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://garu.com.br/api/v1/products/{uuid}")
.header("Authorization", "Bearer <token>")
.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::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyProdutos
Excluir Produto
Desative um produto existente
DELETE
/
api
/
v1
/
products
/
{uuid}
Excluir Produto
curl --request DELETE \
--url https://garu.com.br/api/v1/products/{uuid} \
--header 'Authorization: Bearer <token>'import requests
url = "https://garu.com.br/api/v1/products/{uuid}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
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 => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://garu.com.br/api/v1/products/{uuid}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://garu.com.br/api/v1/products/{uuid}")
.header("Authorization", "Bearer <token>")
.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::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyVisão Geral
Este endpoint realiza uma exclusão suave (soft delete) do produto, definindoisActive: false. Os dados do produto são preservados para histórico de transações.
Após excluir um produto, o link de pagamento deixará de funcionar. Clientes que tentarem acessar receberão uma mensagem de produto indisponível.
Parâmetros de Path
string
required
UUID do produto a ser excluído.
Exemplo de Requisição
curl -X DELETE https://garu.com.br/api/v1/products/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer sk_test_sua_chave_api"
const response = await fetch('https://garu.com.br/api/v1/products/a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.GARU_API_KEY}`
}
});
const produto = await response.json();
console.log(`Produto ${produto.uuid} desativado (isActive: ${produto.isActive})`);
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']}"
}
response = requests.delete(url, headers=headers)
produto = response.json()
print(f"Produto {produto['uuid']} desativado")
Resposta de Sucesso
200 OK - Retorna o produto já desativado, comisActive: false.
{
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Curso de Marketing Digital",
"value": 297.00,
"isActive": false,
"updatedAt": "2026-01-15T10:30:00.000Z"
}
Erros Comuns
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"
}
Comportamento
- O produto é marcado como
isActive: false - O link de pagamento para de funcionar
- Os dados permanecem no sistema para histórico
- Transações anteriores não são afetadas
A desativação é definitiva pela API: não há endpoint de reativação.
isActive é somente leitura na resposta e não pode ser alterado via PATCH. Se precisar vender o produto novamente, crie um novo produto.Próximos Passos
Criar Produto
Crie um novo produto
Listar Produtos
Veja todos os seus produtos
Was this page helpful?