Webhooks

Build custom integrations using SendTreat webhooks.

API Documentation

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.placed

Triggered when a new order is placed

order.shipped

Triggered when an order is shipped

order.delivered

Triggered when an order is delivered

order.failed

Triggered when an order fails

subscription.created

Triggered when a subscription is created

subscription.updated

Triggered when a subscription is updated

automation.triggered

Triggered 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

  1. Create an endpoint in your application to receive webhook events
  2. Configure your webhook URL in the SendTreat dashboard
  3. Select which events you want to receive
  4. Verify webhook signature to ensure authenticity
  5. 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.

Configure WebhooksContact Support