> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.bitbybit.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook Events

> Complete catalog of available webhook event types

## Event Types

### Customer Events

#### customer.created

Triggered when a new customer is created via the Open API.

```json theme={null}
{
  "id": "cust_abc123",
  "email": "john@example.com",
  "phoneNumber": "+6281234567890",
  "firstName": "John",
  "lastName": "Doe",
  "imageUrl": null,
  "tags": ["new-customer"],
  "addresses": [
    {
      "id": "addr_xyz",
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+6281234567890",
      "address1": "Jl. Sudirman No. 1",
      "city": "Jakarta",
      "province": "DKI Jakarta",
      "country": "ID",
      "zip": "10110"
    }
  ],
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}
```

#### customer.updated

Triggered when a customer's details are updated.

```json theme={null}
{
  "id": "cust_abc123",
  "email": "john.updated@example.com",
  "phoneNumber": "+6281234567890",
  "firstName": "John",
  "lastName": "Doe",
  "imageUrl": null,
  "tags": ["vip"],
  "addresses": [],
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-16T08:00:00.000Z"
}
```

#### customer.deleted

Triggered when a customer is deleted.

```json theme={null}
{
  "id": "cust_abc123"
}
```

### Order Events

#### order.created

Triggered when a new order is created.

```json theme={null}
{
  "id": "order_def456",
  "orderId": "ORD-001",
  "orderNumber": "1001",
  "status": "active",
  "fulfillmentStatus": "unfulfilled",
  "financialStatus": "pending",
  "total": 150000,
  "currency": null,
  "customer": {
    "id": "cust_abc123",
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@example.com",
    "phoneNumber": "+6281234567890"
  },
  "lineItems": [
    {
      "id": "li_001",
      "quantity": 2,
      "price": 75000,
      "title": "Premium T-Shirt"
    }
  ],
  "shippingAddress": {
    "firstName": "John",
    "lastName": "Doe",
    "address1": "Jl. Sudirman No. 1",
    "city": "Jakarta",
    "province": "DKI Jakarta",
    "country": "ID",
    "zip": "10110"
  },
  "tags": [],
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}
```

#### order.updated

Triggered when an order status is updated.

```json theme={null}
{
  "id": "order_def456",
  "orderId": "ORD-001",
  "status": "active",
  "fulfillmentStatus": "fulfilled",
  "financialStatus": "paid",
  "total": 150000,
  "customer": {
    "id": "cust_abc123",
    "firstName": "John",
    "lastName": "Doe"
  },
  "lineItems": [],
  "tags": [],
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-16T14:00:00.000Z"
}
```

### Product Events

#### product.created

Triggered when a new product is created.

```json theme={null}
{
  "id": "prod_ghi789",
  "productId": "PROD-001",
  "name": "Premium T-Shirt",
  "description": "High-quality cotton t-shirt",
  "media": null,
  "status": null,
  "variants": [
    {
      "id": "var_001",
      "key": "Default",
      "price": 75000,
      "inventorySku": "TSH-001"
    }
  ],
  "options": [],
  "tags": ["apparel"],
  "types": [],
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z"
}
```

#### product.updated

Triggered when a product is updated.

```json theme={null}
{
  "id": "prod_ghi789",
  "productId": "PROD-001",
  "name": "Premium T-Shirt (Updated)",
  "description": "Updated description",
  "variants": [],
  "options": [],
  "tags": [],
  "types": [],
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-17T09:00:00.000Z"
}
```

#### product.deleted

Triggered when a product is deleted.

```json theme={null}
{
  "id": "prod_ghi789"
}
```

### Message Events

#### message.received

Triggered when an inbound message is received from a customer.

```json theme={null}
{
  "messageId": "msg_jkl012",
  "from": "+6281234567890",
  "body": "Hi, I have a question about my order",
  "source": "WHATSAPP_META",
  "receivedAt": "2024-01-15T10:30:00.000Z"
}
```

#### message.status.updated

Triggered when an outbound message delivery status changes.

```json theme={null}
{
  "messageId": "msg_mno345",
  "status": "sent",
  "to": "+6281234567890",
  "templateName": "order_confirmation"
}
```

## Event Headers

Every webhook delivery includes these headers:

| Header                         | Description                                           |
| ------------------------------ | ----------------------------------------------------- |
| `X-BitByBit-Webhook-Id`        | Unique event ID (use for deduplication)               |
| `X-BitByBit-Webhook-Event`     | Event type in dot notation (e.g., `customer.created`) |
| `X-BitByBit-Webhook-Timestamp` | Unix timestamp when the event was generated           |
| `X-BitByBit-Webhook-Signature` | HMAC-SHA256 signature for verification                |
| `User-Agent`                   | Always `BitByBit-Webhooks/1.0`                        |
| `Content-Type`                 | Always `application/json`                             |
