FlexPrice sends webhook events to notify your application when events happen in your account. Webhooks are particularly useful for asynchronous events like payment confirmations, subscription updates, and invoice status changes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/flexprice/flexprice/llms.txt
Use this file to discover all available pages before exploring further.
How Webhooks Work
When an event occurs in FlexPrice:- FlexPrice creates a webhook event payload
- The event is published to Kafka for reliable delivery
- The webhook service delivers the event to your configured endpoint
- Your application returns a 2xx status code to acknowledge receipt
Webhook Events
FlexPrice supports the following webhook event types:Invoice Events
| Event Name | Description |
|---|---|
invoice.create.drafted | Invoice created in draft status |
invoice.update.finalized | Invoice finalized and ready for payment |
invoice.update.payment | Invoice payment status updated |
invoice.update.voided | Invoice voided/cancelled |
invoice.update | Invoice updated |
invoice.payment.overdue | Invoice payment is overdue |
invoice.communication.triggered | Invoice email/SMS sent |
Subscription Events
| Event Name | Description |
|---|---|
subscription.created | New subscription created |
subscription.draft.created | Subscription created in draft status |
subscription.activated | Subscription activated |
subscription.updated | Subscription details updated |
subscription.paused | Subscription paused |
subscription.cancelled | Subscription cancelled |
subscription.resumed | Paused subscription resumed |
subscription.renewal.due | Subscription renewal is due |
Payment Events
| Event Name | Description |
|---|---|
payment.created | Payment record created |
payment.updated | Payment details updated |
payment.success | Payment succeeded |
payment.failed | Payment failed |
payment.pending | Payment pending processing |
Customer Events
| Event Name | Description |
|---|---|
customer.created | New customer created |
customer.updated | Customer details updated |
customer.deleted | Customer deleted |
Wallet Events
| Event Name | Description |
|---|---|
wallet.created | Wallet created for customer |
wallet.updated | Wallet details updated |
wallet.terminated | Wallet terminated |
wallet.transaction.created | Wallet transaction recorded |
wallet.credit_balance.dropped | Credit balance below threshold |
wallet.credit_balance.recovered | Credit balance restored |
wallet.ongoing_balance.dropped | Ongoing balance below threshold |
wallet.ongoing_balance.recovered | Ongoing balance restored |
Feature Events
| Event Name | Description |
|---|---|
feature.created | Feature created |
feature.updated | Feature updated |
feature.deleted | Feature deleted |
feature.wallet_balance.alert | Feature usage threshold alert |
Entitlement Events
| Event Name | Description |
|---|---|
entitlement.created | Customer entitlement granted |
entitlement.updated | Entitlement updated |
entitlement.deleted | Entitlement revoked |
Credit Note Events
| Event Name | Description |
|---|---|
credit_note.created | Credit note issued |
credit_note.updated | Credit note updated |
Webhook Payload Structure
All webhook events follow this standard structure:Invoice Event Payload
Configuration
Create Webhook Endpoint
Configure a webhook endpoint to receive events:Event Filtering
Subscribe only to events you need:Implementation
Basic Webhook Handler
Security
Signature Verification
All webhook requests include anX-Flexprice-Signature header for verification:
Best Practices
- Use HTTPS - Only accept webhooks over HTTPS endpoints
- Verify Signatures - Always validate the webhook signature
- Use Constant-Time Comparison - Prevent timing attacks when comparing signatures
- Idempotency - Handle duplicate webhook deliveries gracefully
- Async Processing - Process webhooks asynchronously to avoid timeouts
- Error Handling - Return 2xx status codes even if processing fails internally
Webhook Architecture
FlexPrice’s webhook system uses Kafka for reliable delivery:Testing
Test Webhook Locally
Use tools like ngrok to expose your local server:Trigger Test Events
Create test events to verify your webhook handler:Monitoring
View Webhook Deliveries
Check webhook delivery status and logs:Troubleshooting
Common Issues
Webhook not received
Webhook not received
- Verify endpoint URL is publicly accessible
- Check firewall rules allow FlexPrice IPs
- Ensure endpoint returns 2xx status code
- Verify webhook endpoint is enabled
Signature verification fails
Signature verification fails
- Use raw request body (don’t parse JSON first)
- Verify webhook secret is correct
- Use constant-time comparison
- Check for encoding issues
Missing events
Missing events
- Check event subscription configuration
- Verify webhook endpoint is active
- Review delivery logs for failures
- Check for rate limiting on your endpoint
Duplicate events
Duplicate events
- Implement idempotency using event.id
- Track processed event IDs
- Return 2xx even if already processed
Next Steps
Stripe Integration
Configure Stripe integration
API Reference
Explore webhook endpoint API