Criar webhook
curl --request POST \
--url https://api.uvvipay.com.br/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'client-id: <api-key>' \
--header 'client-secret: <api-key>' \
--data '
{
"webhook_url": "https://minhaloja.com.br/webhooks/uvvipay",
"events": [
"transaction.status.updated"
],
"hmac_secret": "seu-segredo-compartilhado"
}
'import requests
url = "https://api.uvvipay.com.br/v1/webhooks"
payload = {
"webhook_url": "https://minhaloja.com.br/webhooks/uvvipay",
"events": ["transaction.status.updated"],
"hmac_secret": "seu-segredo-compartilhado"
}
headers = {
"client-id": "<api-key>",
"client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'client-id': '<api-key>',
'client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
webhook_url: 'https://minhaloja.com.br/webhooks/uvvipay',
events: ['transaction.status.updated'],
hmac_secret: 'seu-segredo-compartilhado'
})
};
fetch('https://api.uvvipay.com.br/v1/webhooks', 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.uvvipay.com.br/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'webhook_url' => 'https://minhaloja.com.br/webhooks/uvvipay',
'events' => [
'transaction.status.updated'
],
'hmac_secret' => 'seu-segredo-compartilhado'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"client-id: <api-key>",
"client-secret: <api-key>"
],
]);
$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.uvvipay.com.br/v1/webhooks"
payload := strings.NewReader("{\n \"webhook_url\": \"https://minhaloja.com.br/webhooks/uvvipay\",\n \"events\": [\n \"transaction.status.updated\"\n ],\n \"hmac_secret\": \"seu-segredo-compartilhado\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client-id", "<api-key>")
req.Header.Add("client-secret", "<api-key>")
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.post("https://api.uvvipay.com.br/v1/webhooks")
.header("client-id", "<api-key>")
.header("client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"webhook_url\": \"https://minhaloja.com.br/webhooks/uvvipay\",\n \"events\": [\n \"transaction.status.updated\"\n ],\n \"hmac_secret\": \"seu-segredo-compartilhado\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uvvipay.com.br/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client-id"] = '<api-key>'
request["client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"webhook_url\": \"https://minhaloja.com.br/webhooks/uvvipay\",\n \"events\": [\n \"transaction.status.updated\"\n ],\n \"hmac_secret\": \"seu-segredo-compartilhado\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"endpoint": "https://minhaloja.com.br/webhooks/uvvipay",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"events": [
"transaction.status.updated"
],
"hmac_configured": true
}
}Webhooks
Criar webhook
Cria um endpoint de webhook para o merchant autenticado. Informe webhook_url e events (ao menos um). Opcionalmente hmac_secret para assinatura HMAC. Limite de 10 endpoints ativos por conta.
POST
/
v1
/
webhooks
Criar webhook
curl --request POST \
--url https://api.uvvipay.com.br/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'client-id: <api-key>' \
--header 'client-secret: <api-key>' \
--data '
{
"webhook_url": "https://minhaloja.com.br/webhooks/uvvipay",
"events": [
"transaction.status.updated"
],
"hmac_secret": "seu-segredo-compartilhado"
}
'import requests
url = "https://api.uvvipay.com.br/v1/webhooks"
payload = {
"webhook_url": "https://minhaloja.com.br/webhooks/uvvipay",
"events": ["transaction.status.updated"],
"hmac_secret": "seu-segredo-compartilhado"
}
headers = {
"client-id": "<api-key>",
"client-secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'client-id': '<api-key>',
'client-secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
webhook_url: 'https://minhaloja.com.br/webhooks/uvvipay',
events: ['transaction.status.updated'],
hmac_secret: 'seu-segredo-compartilhado'
})
};
fetch('https://api.uvvipay.com.br/v1/webhooks', 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.uvvipay.com.br/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'webhook_url' => 'https://minhaloja.com.br/webhooks/uvvipay',
'events' => [
'transaction.status.updated'
],
'hmac_secret' => 'seu-segredo-compartilhado'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"client-id: <api-key>",
"client-secret: <api-key>"
],
]);
$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.uvvipay.com.br/v1/webhooks"
payload := strings.NewReader("{\n \"webhook_url\": \"https://minhaloja.com.br/webhooks/uvvipay\",\n \"events\": [\n \"transaction.status.updated\"\n ],\n \"hmac_secret\": \"seu-segredo-compartilhado\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client-id", "<api-key>")
req.Header.Add("client-secret", "<api-key>")
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.post("https://api.uvvipay.com.br/v1/webhooks")
.header("client-id", "<api-key>")
.header("client-secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"webhook_url\": \"https://minhaloja.com.br/webhooks/uvvipay\",\n \"events\": [\n \"transaction.status.updated\"\n ],\n \"hmac_secret\": \"seu-segredo-compartilhado\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uvvipay.com.br/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client-id"] = '<api-key>'
request["client-secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"webhook_url\": \"https://minhaloja.com.br/webhooks/uvvipay\",\n \"events\": [\n \"transaction.status.updated\"\n ],\n \"hmac_secret\": \"seu-segredo-compartilhado\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"endpoint": "https://minhaloja.com.br/webhooks/uvvipay",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"events": [
"transaction.status.updated"
],
"hmac_configured": true
}
}Informe
webhook_url e events (ao menos um). Opcionalmente envie
hmac_secret (mínimo 16 e máximo 256 caracteres) para autenticação HMAC nas entregas.
Cada conta pode ter no máximo 10 endpoints de webhook ativos. O secret nunca é
devolvido na resposta.Headers
ID público da credencial do merchant
Secret da credencial do merchant
Body
application/json
URL HTTPS que receberá as notificações via POST
Pattern:
^https://.+Example:
"https://minhaloja.com.br/webhooks/uvvipay"
Eventos em que o endpoint será inscrito
Minimum array length:
1Available options:
transaction.status.updated, transaction.waiting_payment, transaction.paid, transaction.refused, transaction.refunded, transaction.chargedback, transaction.cancelled, transaction.expired, transaction.in_analysis, submerchant.status.updated, subscription.created, subscription.trial_started, subscription.activated, subscription.past_due, subscription.cancelled, subscription.reactivated, subscription.completed, subscription.renewed Example:
["transaction.status.updated"]
Secret HMAC opcional usado para assinar as entregas (X-UvviPay-Timestamp + X-UvviPay-Signature sobre timestamp.body). Nunca é devolvido nas respostas.
Required string length:
16 - 256Example:
"seu-segredo-compartilhado"
Response
Webhook criado com sucesso
Show child attributes
Show child attributes

