Skip to main content
Webhooks allow you to receive automatic notifications about payin events in real-time. When a payin status changes, WEpayments will send a POST request to your registered webhook URL with the updated transaction data.

How It Works

  1. Configure your notification URL when creating the payin charge using the notification_url parameter
  2. Receive notifications automatically when payin status changes
  3. Process the payload containing the complete payin details
  4. Return a 200 OK response to acknowledge receipt
Webhooks are sent only for final statuses: Credited, Canceled, Rejected

Setting Up Webhooks

To receive webhook notifications for payin transactions, include the notification_url parameter when creating a charge:
The notification URL is defined in the notification_url field in the request body when creating a charge. Each charge can have its own notification URL, allowing you to route notifications to different endpoints based on your needs.

Webhook Payload

When a payin status changes, you’ll receive a POST request with the following data:

Response Fields

id
integer
Payin IDExample: 113589233
hash
string
Unique hash identifier for the payin transactionExample: 54a3cbc66f4ec54a10826edc62ff3f8f8f706c5c54a9db22e1f57fcfff4516d8
invoice
string
Payin invoiceExample: eb21ce52-2897-475b-85af-a5201f4035bf
end_to_end
string
Payin end-to-end identifierExample: E12345678202603191234567890AB1
status
object
Object that contains the current status of your payin.
status_detail
object
This object will only be returned if the payin is rejected and the merchant is using the “Account Mismatch” functionality. It provides more details on the reason for the rejection.
updated_at
string
Last update of your payin.Format: <date-time>Example: 2024-09-09T20:55:56.000000Z
metadata
object
Additional metadata about the payment.

Example Payload

Status Codes

Common payin status codes: See Payin Status Flow for detailed status information.

Status Detail Codes

When a PIX transaction is rejected, the status_detail.code field provides specific information about the rejection reason:
These codes are only returned when the payin status is Rejected and the merchant has the “Account Mismatch” functionality enabled.

Webhook Endpoint Requirements

Your webhook endpoint must:
  • Accept POST requests - All webhook notifications are sent via POST
  • Use HTTPS - Only secure HTTPS URLs are accepted
  • Return 200 OK - Respond with a 200 status code within 5 seconds
  • Be publicly accessible - The endpoint must be reachable from the internet

Retry Policy

If your endpoint responds with a failure (status code different from 200), 15 retry attempts will be made to deliver the webhook notification.

Best Practices

Always Respond 200 OK: Your endpoint must respond with HTTP 200 to acknowledge receipt.
Validate Webhook Signature: Always validate the webhook signature to ensure it’s from WEpayments. See Webhook Signature Documentation for details.
Verify paid_amount: The paid_amount field represents the actual amount paid by the customer and is important to consider for reconciliation.

Status Flow

Understand payin status lifecycle