Atualizar Oferta
curl --request PUT \
--url https://api.example.com/products/{hash}/offers/{offerHash} \
--header 'Content-Type: application/json' \
--data '
{
"api_token": "<string>",
"title": "<string>",
"amount": 123,
"cover": "<string>"
}
'import requests
url = "https://api.example.com/products/{hash}/offers/{offerHash}"
payload = {
"api_token": "<string>",
"title": "<string>",
"amount": 123,
"cover": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({api_token: '<string>', title: '<string>', amount: 123, cover: '<string>'})
};
fetch('https://api.example.com/products/{hash}/offers/{offerHash}', 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}/offers/{offerHash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'api_token' => '<string>',
'title' => '<string>',
'amount' => 123,
'cover' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/products/{hash}/offers/{offerHash}"
payload := strings.NewReader("{\n \"api_token\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"cover\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.example.com/products/{hash}/offers/{offerHash}")
.header("Content-Type", "application/json")
.body("{\n \"api_token\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"cover\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/products/{hash}/offers/{offerHash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_token\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"cover\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"200": {},
"400": {},
"401": {},
"404": {},
"422": {},
"500": {}
}Produtos
Atualizar Oferta
Atualiza uma oferta existente de um produto
PUT
/
products
/
{hash}
/
offers
/
{offerHash}
Atualizar Oferta
curl --request PUT \
--url https://api.example.com/products/{hash}/offers/{offerHash} \
--header 'Content-Type: application/json' \
--data '
{
"api_token": "<string>",
"title": "<string>",
"amount": 123,
"cover": "<string>"
}
'import requests
url = "https://api.example.com/products/{hash}/offers/{offerHash}"
payload = {
"api_token": "<string>",
"title": "<string>",
"amount": 123,
"cover": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({api_token: '<string>', title: '<string>', amount: 123, cover: '<string>'})
};
fetch('https://api.example.com/products/{hash}/offers/{offerHash}', 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}/offers/{offerHash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'api_token' => '<string>',
'title' => '<string>',
'amount' => 123,
'cover' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/products/{hash}/offers/{offerHash}"
payload := strings.NewReader("{\n \"api_token\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"cover\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.example.com/products/{hash}/offers/{offerHash}")
.header("Content-Type", "application/json")
.body("{\n \"api_token\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"cover\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/products/{hash}/offers/{offerHash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_token\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"cover\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"200": {},
"400": {},
"401": {},
"404": {},
"422": {},
"500": {}
}Visão Geral
Este endpoint permite atualizar as informações de uma oferta existente vinculada a um produto.Endpoint
PUT https://api.klivopay.com.br/api/public/v1/products/{hash}/offers/{offerHash}
Parâmetros
Hash identificador único do produto
Hash identificador único da oferta
Seu token de autenticação da API KlivoPay
Novo título da oferta
Novo valor em centavos
Nova URL da imagem de capa
Exemplo de Requisição
curl -X PUT 'https://api.klivopay.com.br/api/public/v1/products/prod123abc/offers/offer123' \
-H 'Content-Type: application/json' \
-d '{
"api_token": "seu_token_aqui",
"title": "Super Promoção",
"amount": 14900
}'
const productHash = 'prod123abc';
const offerHash = 'offer123';
const response = await fetch(
`https://api.klivopay.com.br/api/public/v1/products/${productHash}/offers/${offerHash}`,
{
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
api_token: 'seu_token_aqui',
title: 'Super Promoção',
amount: 14900
})
}
);
const data = await response.json();
console.log(data);
import requests
product_hash = 'prod123abc'
offer_hash = 'offer123'
url = f'https://api.klivopay.com.br/api/public/v1/products/{product_hash}/offers/{offer_hash}'
payload = {
'api_token': 'seu_token_aqui',
'title': 'Super Promoção',
'amount': 14900
}
response = requests.put(url, json=payload)
print(response.json())
<?php
$productHash = 'prod123abc';
$offerHash = 'offer123';
$url = "https://api.klivopay.com.br/api/public/v1/products/{$productHash}/offers/{$offerHash}";
$data = [
'api_token' => 'seu_token_aqui',
'title' => 'Super Promoção',
'amount' => 14900
];
$options = [
'http' => [
'header' => "Content-Type: application/json\r\n",
'method' => 'PUT',
'content' => json_encode($data)
]
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
print_r(json_decode($result));
?>
Resposta de Sucesso
200 OK
{
"success": true,
"data": {
"hash": "offer123",
"title": "Super Promoção",
"amount": 14900,
"product_hash": "prod123abc",
"updated_at": "2025-01-20T15:30:00Z"
}
}
Códigos de Resposta
Oferta atualizada com sucesso
Dados inválidos na requisição
Token de API inválido ou ausente
Produto ou oferta não encontrado
Erro de validação nos dados enviados
Erro interno do servidor
⌘I