How It Works
- Configure your callback URL when creating the credit card charge using the
callbackUrlparameter - Receive notifications automatically when transaction status changes
- Process the payload containing the complete transaction details
- Return a 200 OK response to acknowledge receipt
Setting Up Webhooks
To receive webhook notifications for credit card transactions, include thecallbackUrl parameter when creating a charge:
Webhook Payload
When a credit card transaction status changes, you’ll receive a POST request with the following data:Response Fields
string
Unique charge identifier
string
Unique key for payment page access
integer
Your client ID in the WEpayments system
string
Your registered company name
string
Name of the customer making the purchase
string
Customer’s document number (CPF/CNPJ)
string
Customer’s email address
string
Your custom reference number for this transaction
integer
WEpayments internal transaction number
object
Current transaction status
string
Payment method type - will be
"credit-card" for credit card transactionsinteger
Transaction amount in cents
integer
Amount actually paid in cents (null if not yet paid)
string
Timestamp when payment was confirmed (ISO 8601 format)
string
Transaction expiration timestamp (ISO 8601 format)
string
Transaction creation timestamp (ISO 8601 format)
array
Array of status changes with timestamps
string
Refund configuration mode
integer
Total amount refunded in cents
array
Array of refund records if any refunds were processed
string
Additional status information if applicable
Example Payload
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
Common Status Updates
You’ll receive webhook notifications for these status changes:- Created → Transaction initiated
- Paid → Payment successfully processed
- Rejected → Payment declined (see Rejection Status for details)
- Refunded → Payment refunded to customer
- Canceled → Transaction canceled
Related Resources
Create Charge
Create a new credit card charge
Rejection Status
Understanding rejection reasons
Test Cards
Test cards for development

