Webhooks
Testar Webhook
POST
/v1/users/webhooks/testBase URL Produção:
https://api.validapay.com.brBase URL Sandbox:
https://sandbox.validapay.com.brAutenticação
bearerAuthorizationstring · header · obrigatório
Envie no header:
Authorization: Bearer {{token}}Envia um aviso de teste para o endereço configurado, permitindo validar se as notificações estão chegando corretamente.
Testar webhook (payload fake)
Obrigatório webhookId ou url.
| Campo | Obrig. | Tipo | Descrição |
|---|---|---|---|
webhookId | ✅* | string | ID do webhook registrado |
url | ✅* | string | URL alternativa |
entity | ✅ | string | Tipo de evento para gerar payload |
Body
application/json
Content-Type:application/json
{
"webhookId": "wh_xxx",
"entity": "payment.success"
}Schema
| Field | Type | Required | Description |
|---|---|---|---|
webhookId | string | - | - |
entity | string | - | - |
Headers
| Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | - | application/json | Optional |
const url = 'https://sandbox.validapay.com.br/v1/users/webhooks/test';
const options = {
method: 'POST',
headers: {
'Authorization': 'Bearer {{token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"webhookId": "wh_xxx",
"entity": "payment.success"
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Response Examples
200200
{
"success": true,
"url": "https://meusite.com/webhook",
"event": "payment.success",
"payload": {},
"response": {
"statusCode": 200
}
}400400
{
"success": false,
"error": "Connection refused"
}