Webhook

Webhook

Webhooks allow BillHive to send real-time notifications to your application when specific events occur in your account.

Overview

When an event is triggered in BillHive, a webhook sends an HTTP POST request to your configured endpoint with the event data. This enables you to automate workflows, sync data, and respond to changes instantly.

Setting Up Webhooks

To configure a webhook:

  1. Navigate to Settings > Webhooks in your BillHive dashboard.
  2. Click Add Webhook Endpoint.
  3. Enter your endpoint URL.
  4. Select the events you want to subscribe to.
  5. Save the configuration.

Supported Events

EventDescription
invoice.createdTriggered when a new invoice is created
invoice.paidTriggered when an invoice is paid
subscription.createdTriggered when a new subscription is created
subscription.cancelledTriggered when a subscription is cancelled
subscription.renewedTriggered when a subscription is renewed
payment.successTriggered when a payment is successfully processed
payment.failedTriggered when a payment fails
customer.createdTriggered when a new customer is created
customer.updatedTriggered when customer details are updated

Webhook Payload

Each webhook request includes a JSON payload with the following structure:

{
  "event": "invoice.paid",
  "timestamp": "2025-01-15T10:30:00Z",
  "data": {
    // Event-specific data
  }
}

Verifying Webhooks

To ensure the authenticity of incoming webhooks, BillHive includes a signature in the request headers. Verify this signature using your webhook secret before processing the payload.

Retry Policy

If your endpoint returns a non-2xx response, BillHive will retry the webhook delivery up to 5 times with exponential backoff.