Webhooks (configuração)
Criar webhook
Registre um endereço para receber notificações e, se quiser, já gere o segredo HMAC que confirma a autenticidade de cada envio, mostrado uma única vez.
Autorização
BearerAuth AutorizaçãoBearer <token>
Em: header
Corpo da requisição
application/json
Definições TypeScript
Use o tipo request body no TypeScript.
Corpo da resposta
application/json
curl --request POST \ --url 'https://api.payzu.processamento.com/v1/user/webhooks' \ --header 'Authorization: Bearer $PAYZU_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://sualoja.com.br/webhook", "events": [], "generateSecret": false, "active": true}'const url = 'https://api.payzu.processamento.com/v1/user/webhooks';const response = await fetch(url, { method: 'POST', headers: { Authorization: `Bearer ${process.env.PAYZU_TOKEN}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ url: 'https://sualoja.com.br/webhook', events: [], generateSecret: false, active: true }),});const data = await response.json();console.log(data);import osimport requestsresponse = requests.post( 'https://api.payzu.processamento.com/v1/user/webhooks', headers={ 'Authorization': f'Bearer {os.environ["PAYZU_TOKEN"]}', 'Content-Type': 'application/json', }, json={ 'url': 'https://sualoja.com.br/webhook', 'events': [], 'generateSecret': False, 'active': True },)print(response.json())201
{
"id": "yl9k2m0c8x1",
"url": "https://sualoja.com.br/webhook",
"active": true,
"TRANSACTION_COMPLETED",
"TRANSACTION_REFUNDED"
],
"hasSecret": true,
"createdAt": "2026-08-10T12:00:00.000Z",
"updatedAt": "2026-08-10T12:00:00.000Z",
"secret": "whsec_9f8a2b7c6d5e4f3a2b1c0d9e8f7a6b5c"
}