Listar Produtos
curl --request GET \
--url https://api.example.com/productsimport requests
url = "https://api.example.com/products"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/products', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/products")
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": {},
"500": {}
}Produtos
Listar Produtos
Lista todos os produtos cadastrados na conta
GET
/
products
Listar Produtos
curl --request GET \
--url https://api.example.com/productsimport requests
url = "https://api.example.com/products"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/products', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/products")
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": {},
"500": {}
}Visão Geral
Este endpoint retorna uma lista paginada de todos os produtos cadastrados na sua conta KlivoPay.Endpoint
GET https://api.klivopay.com.br/api/public/v1/products
Parâmetros
Seu token de autenticação da API KlivoPay
Número da página para paginação
Quantidade de itens por página (máximo: 100)
Exemplo de Requisição
curl -X GET 'https://api.klivopay.com.br/api/public/v1/products?api_token=seu_token_aqui&page=1&per_page=20'
const params = new URLSearchParams({
api_token: 'seu_token_aqui',
page: 1,
per_page: 20
});
const response = await fetch(`https://api.klivopay.com.br/api/public/v1/products?${params}`);
const data = await response.json();
console.log(data);
import requests
url = 'https://api.klivopay.com.br/api/public/v1/products'
params = {
'api_token': 'seu_token_aqui',
'page': 1,
'per_page': 20
}
response = requests.get(url, params=params)
print(response.json())
<?php
$params = http_build_query([
'api_token' => 'seu_token_aqui',
'page' => 1,
'per_page' => 20
]);
$url = 'https://api.klivopay.com.br/api/public/v1/products?' . $params;
$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",
"product_type": "digital",
"payment_type": 1,
"amount": 29900,
"category": {
"id": 5,
"name": "Educação"
},
"created_at": "2025-01-15T10:00:00Z"
},
{
"hash": "prod456def",
"title": "E-book Vendas Online",
"cover": "https://cdn.klivopay.com.br/products/cover456.jpg",
"product_type": "digital",
"payment_type": 1,
"amount": 4900,
"category": {
"id": 5,
"name": "Educação"
},
"created_at": "2025-01-10T14:30:00Z"
}
],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 12,
"total_pages": 1
}
}
Códigos de Resposta
Lista de produtos retornada com sucesso
Token de API inválido ou ausente
Erro interno do servidor
⌘I