Buscar webhook por ID
curl --request GET \
--url https://api.sandbox.z2pay.com/v1/webhooks/{id} \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.z2pay.com/v1/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.z2pay.com/v1/webhooks/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "<string>",
"name": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"checkoutLinkIds": [
"<string>"
],
"isActive": true,
"hasSecret": true,
"secretHint": "<string>",
"autoDisabledAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Webhook not found"
}
}Webhooks
Buscar webhook por ID
Retorna a configuração de um webhook — URL, eventos assinados, situação e se ele assina as entregas.
GET
/
webhooks
/
{id}
Buscar webhook por ID
curl --request GET \
--url https://api.sandbox.z2pay.com/v1/webhooks/{id} \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.z2pay.com/v1/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sandbox.z2pay.com/v1/webhooks/{id}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"id": "<string>",
"name": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"checkoutLinkIds": [
"<string>"
],
"isActive": true,
"hasSecret": true,
"secretHint": "<string>",
"autoDisabledAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Webhook not found"
}
}GET /webhooks/:id
Faz parte do recurso Webhooks — o cadastro e o catálogo de eventos estão lá.
Retorna a configuração atual de um webhook. É a leitura que responde “este endereço ainda está
recebendo, e o quê”.
autoDisabledAt diz por que ele parou. Preenchido, o webhook foi desativado pela Z2Pay
depois de uma sequência de falhas — e nenhum evento novo é enviado desde então. null com
isActive: false significa que alguém o desativou de propósito. O critério da desativação
automática está em Entrega e retentativas.secretHint não serve para verificar assinatura — é um fragmento, só para você reconhecer
qual segredo está configurado. O valor completo aparece uma única vez, na
criação.Exemplo
curl https://api.sandbox.z2pay.com/v1/webhooks/whk_k9clfafnldd96dbbxruh34233 \
-H "x-api-key: SUA_CHAVE_DE_SANDBOX"
Resposta 200
{
"id": "whk_k9clfafnldd96dbbxruh34233",
"name": "Notificações de pagamento",
"url": "https://meusite.com/webhooks/z2pay",
"events": ["transaction.paid", "transaction.refunded"],
"isActive": true,
"hasSecret": true,
"secretHint": "whsec_kQ8v…rS8t",
"autoDisabledAt": null,
"createdAt": "2026-06-24T13:45:00.000Z",
"updatedAt": "2026-06-24T13:45:00.000Z"
}
Response
Dados do webhook