Documentation Index
Fetch the complete documentation index at: https://docs.garu.com.br/llms.txt
Use this file to discover all available pages before exploring further.
Visão Geral
Retorna todos os preços de assinatura do vendedor autenticado.
Exemplo de Requisição
curl -X GET https://garu.com.br/api/subscription-prices \
-H "Authorization: Bearer sk_test_sua_chave"
Parâmetros de Query
Filtrar por UUID do produto (ex: prod_abc123xyz).
Filtrar por status ativo/inativo.
Resposta de Sucesso (200 OK)
{
"data": [
{
"id": "price_def456uvw",
"productId": "prod_abc123xyz",
"name": "Plano Mensal",
"amount": 49.90,
"currency": "BRL",
"billingInterval": "monthly",
"trialDays": 7,
"isActive": true,
"createdAt": "2024-01-15T10:35:00.000Z"
},
{
"id": "price_ghi789abc",
"productId": "prod_abc123xyz",
"name": "Plano Anual",
"amount": 479.00,
"currency": "BRL",
"billingInterval": "annually",
"trialDays": 14,
"isActive": true,
"createdAt": "2024-01-15T10:40:00.000Z"
}
]
}
Exemplo: Listar Preços por Produto
async function listarPrecosPorProduto(productId) {
const response = await fetch(
`https://garu.com.br/api/subscription-prices?productId=${productId}`,
{
headers: {
'Authorization': `Bearer ${process.env.GARU_API_KEY}`
}
}
);
const { data } = await response.json();
return data.map(preco => ({
id: preco.id,
nome: preco.name,
valor: preco.amount,
moeda: preco.currency,
intervalo: preco.billingInterval,
trialDias: preco.trialDays,
checkoutUrl: `https://garu.com.br/pay/${productId}?priceId=${preco.id}`
}));
}
// Uso:
const precos = await listarPrecosPorProduto('prod_abc123xyz');
Próximos Passos
Detalhes do Preço
Consulte os detalhes de um preço específico
Atualizar Preço
Atualize um preço existente