This webhook is specific to refunds and is separate from the Credit Card Webhook, which notifies you about the charge (payin) status. A refund generates its own independent notifications.
How It Works
- Create a refund for a credited credit card charge and provide a
notification_url - Receive notifications automatically each time the refund status changes
- Process the payload containing the refund details and amounts
- Return a 200 OK response to acknowledge receipt
Setting Up the Refund Webhook
To receive notifications, include thenotification_url parameter when creating the refund:
Refund Statuses
You will receive a webhook for each of the following refund statuses:| Status ID | Status Name | Description |
|---|---|---|
| 2 | Requested | The refund has been requested and is being processed by the card processor. |
| 4 | Paid | The refund has been successfully completed. |
| 5 | Error | An error occurred while processing the refund. |
Refund Status Flow
Success scenario:Webhook Payload
When a credit card refund status changes, you’ll receive a POST request with the following data:Unique identifier of the refund.Example:
123ID of the credit card charge (payin) being refunded.Example:
456Current refund status ID (
2, 4, or 5).User who created the refund.
Your client ID in the WEpayments system.
Amount of this refund, in cents.Example:
10000History of all status changes for this refund.
End-to-end identifier. Used for Pix refunds; typically
null for credit card refunds.Reason provided when the refund was created.
Error code returned by the processor when the refund fails (status
5). null otherwise.The notification URL configured for this refund.
Refund creation timestamp (ISO 8601 format).
Timestamp of the last update (ISO 8601 format).
Example Payloads
Authentication
Credit card refund webhooks are delivered with the following headers:| Header | Value |
|---|---|
Accept | application/json |
Content-type | application/json |
User-Agent | WEpayments |
If you have configured a custom authentication header for your account (callback authentication key and value), it will be included in every refund webhook request. Contact our support team to set up a custom authentication header so you can validate that the request was sent by WEpayments.
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 status code other than 200, the notification will be retried up to 15 times, with a 5-minute interval between attempts.
Related Resources
Create Refund
Create a refund for a credit card charge
Credit Card Webhook
Notifications about the charge status
About Credit Card
How credit card charges and refund modes work
Create Credit Card Charge
Create a new credit card charge

