> ## Documentation Index
> Fetch the complete documentation index at: https://pay-docs.holdstation.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Balance Change Webhook

> Receive real-time notifications when your prefund balance changes.

## Webhook Event

| Event Type                         | Delivery URL                                                                | Description                                                                        |
| ---------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `pay.partner.fund-balance-changed` | Partner-level webhook ([set here](/api-reference/partners/set-webhook-url)) | Triggered when a partner fund balance changes (deposit, withdraw, or compensation) |

## Overview

When a partner's prefund balance changes due to an on-chain deposit, a withdrawal, or a manual compensation, Holdstation Pay sends a `pay.partner.fund-balance-changed` event to the URL configured via [Set Partner Webhook URL](/api-reference/partners/set-webhook-url).

## HTTP Headers

```
Content-Type: application/json
User-Agent: HSPay-Webhook-Dispatcher/1.0
X-HSPay-Event-Topic: pay.partner.fund-balance-changed
X-HSPay-Event-Signature: base64_encoded_ed25519_signature
```

## Payload Example

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "topic": "pay.partner.fund-balance-changed",
  "ts": "2024-01-15T10:30:00Z",
  "payload": {
    "partner_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "token": "USDT",
    "pre_balance": "1000.000000",
    "post_balance": "1500.000000",
    "change_amount": "500.000000",
    "change_type": 1,
    "fund_log_id": 42
  }
}
```

## `change_type` values

| Value | Name         | Description                          |
| ----- | ------------ | ------------------------------------ |
| `1`   | `DEPOSIT`    | On-chain deposit credited to fund    |
| `2`   | `WITHDRAW`   | Withdrawal deducted from fund        |
| `3`   | `COMPENSATE` | Manual compensation credited to fund |

## Signature Verification

The `X-HSPay-Event-Signature` header is computed exactly the same way as for order webhooks — verify it with your **Webhook Checksum Key** (see [Webhook Verification](/guides/webhooks/orders-webhook#webhook-verification)).
