Consultar Produto
curl --request GET \
--url https://api.example.com/products/{hash}import requests
url = "https://api.example.com/products/{hash}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/products/{hash}', 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://api.example.com/products/{hash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/products/{hash}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/products/{hash}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/products/{hash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"200": {},
"401": {},
"404": {},
"500": {}
}Produtos
Consultar Produto
Consulta os detalhes completos de um produto específico
GET
/
products
/
{hash}
Consultar Produto
curl --request GET \
--url https://api.example.com/products/{hash}import requests
url = "https://api.example.com/products/{hash}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/products/{hash}', 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://api.example.com/products/{hash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/products/{hash}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/products/{hash}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/products/{hash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"200": {},
"401": {},
"404": {},
"500": {}
}Visão Geral
Este endpoint retorna todos os detalhes de um produto específico, incluindo suas ofertas associadas.Endpoint
GET https://api.klivopay.com.br/api/public/v1/products/{hash}
Parâmetros
Hash identificador único do produto
Seu token de autenticação da API KlivoPay
Exemplo de Requisição
curl -X GET 'https://api.klivopay.com.br/api/public/v1/products/prod123abc?api_token=seu_token_aqui'
const hash = 'prod123abc';
const response = await fetch(
`https://api.klivopay.com.br/api/public/v1/products/${hash}?api_token=seu_token_aqui`
);
const data = await response.json();
console.log(data);
import requests
hash_id = 'prod123abc'
url = f'https://api.klivopay.com.br/api/public/v1/products/{hash_id}'
params = {'api_token': 'seu_token_aqui'}
response = requests.get(url, params=params)
print(response.json())
<?php
$hash = 'prod123abc';
$url = "https://api.klivopay.com.br/api/public/v1/products/{$hash}?api_token=seu_token_aqui";
$response = file_get_contents($url);
print_r(json_decode($response));
?>
Resposta de Sucesso
200 OK
{
"success": true,
"data": {
"hash": "prod123abc",
"title": "Curso de Marketing Digital",
"cover": "https://cdn.klivopay.com.br/products/cover123.jpg",
"sale_page": "https://meucurso.com.br/marketing",
"product_type": "digital",
"delivery_type": "email",
"payment_type": 1,
"amount": 29900,
"category": {
"id": 5,
"name": "Educação"
},
"offers": [
{
"hash": "offer123",
"title": "Oferta Especial",
"amount": 19900,
"cover": "https://cdn.klivopay.com.br/offers/offer123.jpg"
}
],
"created_at": "2025-01-15T10:00:00Z",
"updated_at": "2025-01-15T10:00:00Z"
}
}
Códigos de Resposta
Produto encontrado e retornado com sucesso
Token de API inválido ou ausente
Produto não encontrado
Erro interno do servidor
⌘I