> ## Documentation Index
> Fetch the complete documentation index at: https://rain-sandbox-trial.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# onchainRefund.created

> Webhook triggered when an on-chain refund is created and processing begins

<Update label="v1.1.0" description="minor update">
  ### amountUnit field added

  | Field        | Type     | Description                           |
  | ------------ | -------- | ------------------------------------- |
  | `amountUnit` | `string` | The unit of `amount`. Always `cents`. |
</Update>

<Update label="v1.0.0" description="initial release">
  ### onchainRefund.created webhook

  Added the `onchainRefund.created` webhook. Rain triggers this webhook when it creates an on-chain refund and begins processing, returning stablecoin to the cardholder's destination. Rain sends this event to on-chain refund enabled or Real Time Funding enabled tenants.

  #### Payload Fields

  | Field                  | Type                | Description                                                                                                                                                 |
  | ---------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `id`                   | `string`            | Webhook ID                                                                                                                                                  |
  | `resource`             | `string`            | Always `"onchainRefund"`                                                                                                                                    |
  | `action`               | `string`            | Always `"created"`                                                                                                                                          |
  | `version`              | `string`            | The webhook version                                                                                                                                         |
  | `body.id`              | `string`            | Unique identifier for the on-chain refund                                                                                                                   |
  | `body.transactionId`   | `string`            | ID of the refund transaction this refund settles                                                                                                            |
  | `body.userId`          | `string` (optional) | ID of the cardholder receiving the refund. Omitted when not associated with a user                                                                          |
  | `body.amount`          | `number`            | Refund amount in minor units (cents)                                                                                                                        |
  | `body.asset`           | `string`            | Stablecoin being returned (e.g., `USDC`)                                                                                                                    |
  | `body.chainId`         | `string`            | Decimal chain ID the refund settles on (e.g., `84532` for Base Sepolia)                                                                                     |
  | `body.destinationKind` | `string`            | Where the refund is sent. `AUTHPULL_SOURCE` returns funds to the cardholder's source wallet; `COLLATERAL_CONTRACT` returns funds to the collateral contract |
  | `body.status`          | `string`            | Lifecycle status of the refund. New refunds start as `PENDING`                                                                                              |
  | `body.createdAt`       | `string`            | ISO 8601 timestamp when the refund was created                                                                                                              |

  #### Example Payload

  ```json theme={null}
  {
      "id": "b7c8d9e0-f1a2-4b3c-8d4e-5f6a7b8c9d0e",
      "resource": "onchainRefund",
      "action": "created",
      "version": "1.0.0",
      "body": {
          "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
          "transactionId": "d4e5f6a7-b8c9-0123-def0-234567890123",
          "userId": "e5f6a7b8-c9d0-1234-ef01-345678901234",
          "amount": 2599,
          "asset": "USDC",
          "chainId": "84532",
          "destinationKind": "COLLATERAL_CONTRACT",
          "status": "PENDING",
          "createdAt": "2026-02-13T10:30:00.000Z"
      }
  }
  ```
</Update>
