Configure endpoints to receive real-time event notifications.
Overview
Webhooks send real-time notifications to your server when events occur in Pelcro. Configure webhook endpoints to receive notifications about subscriptions, payments, customers, and other events. This enables you to build integrations and automate workflows.
How It Works
- Create a webhook - Register your endpoint URL and select events to receive
- Events occur - When selected events happen, Pelcro sends a POST request
- Your server responds - Process the event and return a 2xx status code
- Retry on failure - Failed deliveries are retried with exponential backoff
Example: Create a webhook for subscription.canceled events. When a customer cancels, Pelcro posts the subscription details to your endpoint. Your server updates your CRM and sends a win-back email.
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/core/webhooks | List all webhooks |
POST | /api/v1/core/webhooks | Create a webhook |
GET | /api/v1/core/webhooks/{id} | Get a webhook |
PUT | /api/v1/core/webhooks/{id} | Update a webhook |
DELETE | /api/v1/core/webhooks/{id} | Delete a webhook |
Webhook Object
| Attribute | Type | Description |
|---|---|---|
id | integer | Unique identifier for the webhook |
url | string | The endpoint URL where events are sent |
description | string | A description of what this webhook is for |
events | array | Array of subscribed event types |
all_events_enabled | boolean | Whether all event types are enabled |
status | string | Current status of the webhook |
created_at | timestamp | Unix timestamp of creation |
updated_at | timestamp | Unix timestamp of last update |
Common Event Types
| Event | Description |
|---|---|
subscription.created | New subscription started |
subscription.renewed | Subscription successfully renewed |
subscription.canceled | Subscription was canceled |
invoice.paid | Invoice payment succeeded |
invoice.payment_failed | Invoice payment failed |
customer.created | New customer registered |
customer.updated | Customer profile changed |
Related Endpoints
- Subscriptions - Events for subscription changes
- Invoices - Events for invoice and payment status
- Customers - Events for customer lifecycle
