Overview
Webhooks (also called Hooks in Mangopay) allow you to receive HTTP notifications when specific events occur in your Mangopay account. This enables you to:- Update your database when payments are processed
- Notify users of transaction status changes
- Trigger automated workflows
- Monitor KYC document validation
Event Types
Mangopay supports notifications for various event types:- PAYIN_NORMAL_SUCCEEDED: Pay-in succeeded
- PAYIN_NORMAL_FAILED: Pay-in failed
- PAYOUT_NORMAL_SUCCEEDED: Payout succeeded
- PAYOUT_NORMAL_FAILED: Payout failed
- TRANSFER_NORMAL_SUCCEEDED: Transfer succeeded
- TRANSFER_NORMAL_FAILED: Transfer failed
- KYC_SUCCEEDED: KYC document validated
- KYC_FAILED: KYC document refused
- USER_KYC_REGULAR: User upgraded to regular KYC level
- USER_KYC_LIGHT: User downgraded to light KYC level
Creating a Webhook
Complete Webhook Handler
Full example with error handling and verification:Managing Webhooks
Create Multiple Webhooks
Register webhooks for different events:Get All Webhooks
List all registered webhooks:Get a Specific Webhook
Update a Webhook
You can enable/disable webhooks or change the URL:Webhook Security
Verify webhooks to ensure they’re from Mangopay:Webhook Reliability
Implement retry logic and idempotency:Testing Webhooks
Test your webhook handler locally:Common Event Handlers
Payment Events
KYC Events
Webhook Status Monitoring
Monitor webhook health:Best Practices
Respond Quickly
Return 200 OK immediately, then process asynchronously.
Use HTTPS
Always use HTTPS URLs for webhook endpoints.
Idempotent Processing
Handle duplicate webhooks gracefully.
Verify Webhooks
Verify webhook authenticity by fetching the resource.
Troubleshooting
Common webhook issues:Next Steps
Processing Pay-ins
Learn about payment processing
Rate Limits
Understand API rate limiting