Register webhook endpoint
Registers a URL to receive the webhooks of the chosen events.
POST
https://api.hub.payzu.com.br/api/v1/transactions/webhooksResponses
curl -X POST "https://api.hub.payzu.com.br/api/v1/transactions/webhooks" \ -H "Authorization: Bearer {{token}}" \ -H "Content-Type: application/json" \ -d '{ "url": "https://sualoja.com.br/webhooks/payzu", "events": [ "PAYMENT_PAID", "PAYMENT_EXPIRED", "WITHDRAW_COMPLETED", "WITHDRAW_FAILED" ] }'const body = JSON.stringify({ "url": "https://sualoja.com.br/webhooks/payzu", "events": [ "PAYMENT_PAID", "PAYMENT_EXPIRED", "WITHDRAW_COMPLETED", "WITHDRAW_FAILED" ]})fetch("https://api.hub.payzu.com.br/api/v1/transactions/webhooks", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer {{token}}" }, body})import requestsurl = "https://api.hub.payzu.com.br/api/v1/transactions/webhooks"body = """{ "url": "https://sualoja.com.br/webhooks/payzu", "events": [ "PAYMENT_PAID", "PAYMENT_EXPIRED", "WITHDRAW_COMPLETED", "WITHDRAW_FAILED" ]}"""response = requests.request("POST", url, data = body, headers = { "Content-Type": "application/json", "Authorization": "Bearer {{token}}"})print(response.text)