Webhooks
Webhooks allow your application to receive real-time notifications when events happen in your Gale account, such as completed payments, failed charges, or subscription changes.How Webhooks Work
- Customer completes payment on Gale’s checkout page
- Gale processes the payment
- Gale sends a POST request to your webhook endpoint with event data
- Your server processes the event (e.g., fulfills order, sends email)
- Your server returns a
200 OKresponse - Event is marked as delivered successfully
Setup
1. Create Webhook Endpoint
Create an endpoint on your server to receive webhook events:2. Configure in Dashboard
- Log in to Gale Dashboard
- Go to Settings → Webhooks
- Click Add Endpoint
- Enter your webhook URL
- Select events to receive
- Click Create
Understanding Webhooks & Orders
All payment methods (checkout sessions, payment links, subscriptions) create orders when paid. This means:- Checkout session paid →
order.createdfires - Payment link paid →
payment_link.paidfires, thenorder.createdfires - Subscription payment →
subscription.payment_succeededfires, thenorder.createdfires
order object is your source of truth for all successful payments, regardless of how the customer paid.
For most integrations, listen to order.created to fulfill purchases.
Webhook Events
Payment Link Events
| Event | Description |
|---|---|
payment_link.created | Payment link created |
payment_link.paid | Payment successfully completed |
payment_link.expired | Payment link expired without payment |
payment_link.cancelled | Payment link cancelled |
Order Events
| Event | Description |
|---|---|
order.created | Order created from paid payment link |
order.completed | Order completed successfully |
order.failed | Order payment failed |
order.refunded | Order was refunded |
Subscription Events
| Event | Description |
|---|---|
subscription.created | Subscription created |
subscription.updated | Subscription updated |
subscription.trial_ending | Trial period ending soon (3 days before) |
subscription.trial_ended | Trial period ended |
subscription.payment_succeeded | Recurring payment succeeded |
subscription.payment_failed | Recurring payment failed |
subscription.cancelled | Subscription cancelled |
subscription.ended | Subscription ended |
Product Events
| Event | Description |
|---|---|
product.created | Product created |
product.updated | Product updated |
product.deleted | Product deleted |
Refund Events
| Event | Description |
|---|---|
refund.created | Refund initiated |
refund.succeeded | Refund processed successfully |
refund.failed | Refund failed |
Event Examples
payment_link.paid
order.created
Best Practices
- Return 200 quickly, process asynchronously
- Handle duplicate events using event IDs
- Verify webhook signatures
- Handle all event types with a default case
