API Reference

Webhooks

PayZu's webhook system allows your application to receive real-time notifications about transaction status changes. When you create a transaction and provide a callbackUrl, our system will automatically send updates to that URL whenever there's a status change.

The URL must be accessible and open for processing requests with the following header:

Content-Type: application/json

PayZu webhooks feature a robust retry system that ensures notification delivery even in case of temporary failures. When a notification is triggered, the system makes up to 5 delivery attempts with progressively longer intervals between each attempt. This approach guarantees that temporary unavailabilities or network issues won't prevent your notifications from being delivered, providing a reliable integration experience with PayZu systems.

The intervals between attempts are randomly varied within the specified ranges, which allows for better load distribution across servers and helps avoid request peaks that could overload the system. This progressive retry strategy means you can trust that your notifications will be delivered even in case of temporary problems, without needing to implement your own retry logic.

AttemptInterval after previousExpected situation
1stInitial send
2ndBetween 1 and 3 minutesFirst failure detected
3rdBetween 2 and 6 minutesRetry 1
4thBetween 4 and 12 minutesRetry 2
5thBetween 8 and 24 minutesFinal retry

⚠️

Response Time Requirements

Your webhook must respond with HTTP 200 OK within 10 seconds. If the response time exceeds this limit, the system considers it a timeout and initiates the retry process.

To guarantee the integrity and security of notifications, it is strongly recommended to restrict access to your webhook URL. Only official IP addresses from the PROCESSAMENTO should be allowed to communicate with your endpoint. This prevents unauthorized access and ensures that all incoming notifications are legitimate and originate from PayZu systems.

Payload Fields

ParameterTypeDescription
idstringTransaction ID
clientReferencestringExternal reference you provided
statusstringPENDING, COMPLETED, CANCELED, WAITING_FOR_REFUND, REFUNDED, EXPIRED, ERROR
amountnumberAmount in BRL
typestringDEPOSIT, WITHDRAW
qrCodeTextstringPix "copy-and-paste" code
qrCodeUrlstringURL to the QR Code image
generatedNamestringReference name
generatedDocumentstringCPF/CNPJ
generatedEmailstringEmail linked to the transaction
payerNamestringPayer name
payerDocumentstringPayer document
payerInstitutionIspbstringPayer bank ISPB
payerInstitutionNamestringPayer bank name
serviceFeeChargednumberService fee charged
withdrawPixKeystringPix key used for withdrawal
withdrawPixTypestringcpf, cnpj, phone, email, evp
receiverNamestringReceiver name
receiverDocumentstringReceiver document
receiverInstitutionIspbstringReceiver bank ISPB
receiverInstitutionNamestringReceiver bank name
endToEndIdstringPix EndToEnd ID
cancellationReasonstringReason for cancellation
paidAtstringPaid timestamp (ISO 8601)
refundEndToEndIdstringRefund EndToEnd ID
refundAmountstringAmount refunded
refundStatusstringPENDING, COMPLETED, FAILED
refundReasonstringReason for refund
refundDescriptionstringRefund description
refundedAtstringRefunded timestamp (ISO 8601)
qrCodeBase64stringQR Code image in Base64 format
createdAtstringCreation timestamp (ISO 8601)
updatedAtstringUpdate timestamp (ISO 8601)
callbackUrlstringThe webhook URL
infractionsobjectInfraction info