Webhooks
Webhooks allow your application to receive real-time notifications when events happen in your Gale account, such as completed payments, failed charges, and refunds.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
200, Gale retries the delivery automatically.
Setup
1. Create an Endpoint on Your Server
2. Register It in the Dashboard
- Log in to Gale Dashboard
- Go to Settings → Webhooks
- Click Add Endpoint
- Enter your webhook URL
- Select the events to subscribe to
- Copy the secret shown — it is only displayed once
Authentication
Every request Gale sends to your endpoint includes a Bearer token in theAuthorization header:
Retry Schedule
If your endpoint doesn’t return200, Gale retries with increasing delays:
After all retries are exhausted the delivery is marked as failed. You can see failed deliveries in the dashboard under Settings → Webhooks.
Webhook Events
Event Envelope
Every event shares the same top-level structure:id for deduplication — Gale may deliver the same event more than once during retries.
Event Payload Examples
order.completed
Fires when payment is captured and the order is complete. Use this to trigger fulfillment.payment_link_id and client_reference_id are present for payment link orders. For checkout session orders, reference_id is set instead and payment_link_id is null.order.failed
Fires when payment fails or is declined.refund.created
Fires when a refund is initiated. Arefund.succeeded or refund.failed will follow.
refund.succeeded
Fires when the refund is processed. Checkpayment_status to know if the order is fully or partially refunded.
payment_status will be refunded for a full refund or partially_refunded if only part of the order was refunded.
refund.failed
Fires when the refund attempt fails.Status Fields
status — Fulfillment status
payment_status — Payment state
Best Practices
- Return 200 immediately, then process the event asynchronously
- Deduplicate using
id— Gale may send the same event more than once during retries - Don’t rely on webhooks alone — use
GET /api/v2/checkout/{checkout_id}to poll status if a webhook is missed - Always validate the Bearer token before processing
