What are Webhooks?
Webhooks are HTTP callbacks that Revolv3 sends to your server when events happen. Instead of you constantly checking (“polling”) the API to see if something changed, Revolv3 automatically notifies you when events occur. Why use webhooks:- Real-time updates: Know immediately when payments succeed or fail
- Efficient: No need to constantly poll the API
- Better UX: Update your UI instantly when events happen
- Essential for ACH: ACH payments take days—webhooks tell you when they complete
How Webhooks Work
The Flow
- Event happens in Revolv3 (payment succeeds, invoice status changes, etc.)
- Revolv3 sends HTTP POST to your webhook URL
- Your server receives the webhook and processes it
- Your server responds with 200 OK to confirm receipt
- You update your system based on the event data
Webhook Format
Revolv3 sends webhooks with this structure:Body: A JSON string containing the event data (you need to parse it)Entropy: A random string for additional security
The Body field is a string, so you need to parse it as JSON to access the data inside.
Available Webhook Events
Revolv3 sends webhooks for these events:| Event Type | When It’s Sent | What It Means |
|---|---|---|
SubscriptionCreated | Subscription is successfully created | New subscription is active |
SubscriptionChanged | Subscription is updated | Subscription details changed |
SubscriptionFailed | Subscription creation failed | Couldn’t create the subscription |
InvoiceCreated | New invoice is created | Invoice ready for payment |
InvoiceStatusChanged | Invoice status changes | Payment succeeded, failed, or status updated |
InvoiceAttemptCreated | Payment attempt is made | Revolv3 tried to process a payment |
InvoiceAttemptStatusChanged | Payment attempt status changes | Attempt succeeded or failed |
WebhookTest | During webhook setup | Test event to verify your endpoint works |
Note: TheACHInvoiceStatusChangedwebhook is deprecated. UseInvoiceStatusChangedinstead—it covers all payment types including ACH.
Understanding Event Data
Parsing the Body
TheBody field is a JSON string, so you need to parse it:
Before parsing (what you receive):
Event Data Structure
Each event includes:Event-specific data: The main object (Invoice, Subscription, Attempt, etc.)EventDateTime: When the event occurred (ISO 8601 timestamp)EventType: The type of event (see table above)RevolvMerchantId: Your merchant ID (useful for multi-merchant setups)
Webhook Examples
Subscription Created
When: A subscription is successfully created Body (after parsing):Invoice Status Changed
When: An invoice status changes (e.g., from Pending to Paid) Body (after parsing):- If status is “Paid”: Fulfill the order, send confirmation
- If status is “Noncollectable”: Notify customer, ask for different payment method
Invoice Attempt Status Changed
When: A payment attempt’s status changes Body (after parsing):Webhook Security: Signature Verification
Revolv3 includes a signature in thex-revolv3-signature header so you can verify the webhook came from Revolv3.
Why Verify Signatures?
Security: Verifying signatures ensures:- The webhook actually came from Revolv3 (not a malicious third party)
- The data wasn’t tampered with in transit
- You’re processing legitimate events
How Signature Verification Works
Revolv3 uses HMAC-SHA256 to create a signature:- Concatenate your webhook URL +
$+ request body - Create HMAC-SHA256 hash using your webhook key
- Encode the hash as Base64
- Compare with the
x-revolv3-signatureheader
Verification Examples
C# Example
PHP Example
JavaScript/Node.js Example
Best Practices for Webhook Handling
1. Always Verify Signatures
Never process webhooks without verifying the signature first. This is a critical security requirement.2. Respond Quickly
- Respond with 200 OK as soon as you receive the webhook
- Process asynchronously if processing takes time
- Don’t block on long operations
3. Handle Duplicates
Webhooks may be sent multiple times. Make your handler idempotent:- Check if you’ve already processed this event
- Use event IDs or timestamps to detect duplicates
- Don’t process the same event twice
4. Log Everything
- Log all incoming webhooks (for debugging)
- Store event data for auditing
- Track which events you’ve processed
5. Handle Errors Gracefully
- If processing fails, log the error
- Consider retrying failed processing
- Don’t crash your server on webhook errors
Common Webhook Scenarios
Scenario 1: Payment Succeeds
Event:InvoiceStatusChanged Status: Paid
What to do:
- Verify signature
- Parse the Body JSON
- Extract invoice ID and status
- Update order status to “paid”
- Fulfill the order (ship product, activate service, etc.)
- Send confirmation email to customer
- Respond with 200 OK
Scenario 2: ACH Payment Completes
Event:InvoiceStatusChanged Status: Paid (after 1-5 business days)
What to do:
- Verify signature
- Parse the Body JSON
- Check if status is “Paid” or “Noncollectable”
- If Paid: Fulfill order, send confirmation
- If Noncollectable: Notify customer, ask for different payment method
- Respond with 200 OK
Scenario 3: Subscription Payment Fails
Event:InvoiceAttemptStatusChanged Status: Fail
What to do:
- Verify signature
- Parse the Body JSON
- Check the failure reason
- Notify customer that payment failed
- Pause subscription (optional)
- Give customer a grace period to update payment method
- Respond with 200 OK
Troubleshooting
Webhook Not Received
Check:- Is your endpoint publicly accessible? (webhooks can’t reach localhost)
- Is your endpoint returning 200 OK?
- Are you checking the correct URL?
- Is your server firewall blocking requests?
Signature Verification Fails
Check:- Are you using the correct webhook key?
- Are you concatenating URL + ”$” + body correctly?
- Are you using HMAC-SHA256 and Base64 encoding?
- Is the URL exactly as configured (including https://)?
Duplicate Events
Solution:- Implement idempotency checking
- Store event IDs or timestamps
- Skip processing if already handled
Next Steps
- Creating a Webhook — Step-by-step guide to setting up webhooks
- Invoice Status — Understand invoice statuses you’ll receive in webhooks
- Subscriptions — Learn about subscription events

