Webhooks
Build custom integrations using SendTreat webhooks.
What Are Webhooks?
Webhooks allow you to receive real-time notifications when events occur in SendTreat. Instead of polling our API, we'll send HTTP POST requests to your endpoint when events happen.
Available Events
order.placedTriggered when a new order is placed
order.shippedTriggered when an order is shipped
order.deliveredTriggered when an order is delivered
order.failedTriggered when an order fails
subscription.createdTriggered when a subscription is created
subscription.updatedTriggered when a subscription is updated
automation.triggeredTriggered when an automation fires
Webhook Payload Example
{
"event": "order.delivered",
"timestamp": "2024-03-19T15:30:00Z",
"data": {
"orderId": "ORD-12345",
"status": "delivered",
"recipient": {
"name": "John Doe",
"email": "john@example.com"
},
"treat": {
"id": "treat_123",
"name": "Golden Hour Dessert Box"
},
"deliveredAt": "2024-03-19T15:25:00Z"
}
}Setting Up Webhooks
- Create an endpoint in your application to receive webhook events
- Configure your webhook URL in the SendTreat dashboard
- Select which events you want to receive
- Verify webhook signature to ensure authenticity
- Handle webhook events in your application
Security
All webhook requests include a signature header that you can verify to ensure the request came from SendTreat:
X-SendTreat-Signature: sha256=...
Ready to Get Started?
Configure webhooks in your dashboard or contact us for enterprise webhook support.