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

# Crypto as a Service Webhooks

> Documentation of Crypto as a Service Webhooks

The B2B API offers a webhook mechanism to notify about events that occur asynchronously. For Crypto as a Service (CaaS), webhooks are used to inform about various platform events including user management actions (banning/unbanning), transaction events (deposits, withdrawals, trades), and automated operations (AutoSwap completions).

### Ban User Webhook

When a user is banned from the platform, a notification will be sent with the following structure:

```json theme={null}
{
  "payload": {
    "reason": "Violated terms & conditions",
    "is_banned": true,
    "updated_at": "2025-09-17T11:00:22.433079Z",
    "status": "BANNED",
    "end_user_id": "test_coelsa_130625_1"
  },
  "event_type": "USER.BANNED",
  "issue_datetime": "2025-09-24T13:41:20.609755Z"
}
```

| Key              | Type      | Description                                                        |
| ---------------- | --------- | ------------------------------------------------------------------ |
| `payload`        | *object*  | Contains the webhook payload data.                                 |
| `reason`         | *string*  | The reason why the user was banned.                                |
| `is_banned`      | *boolean* | Indicates the user's banned status. Will be `true` for ban events. |
| `updated_at`     | *string*  | ISO datetime indicating when the user status was updated.          |
| `end_user_id`    | *string*  | End user's external ref identifier.                                |
| `status`         | *string*  | Current status of the user. Will be `BANNED` for ban events.       |
| `event_type`     | *string*  | Type of event. Will be `USER.BANNED` for ban events.               |
| `issue_datetime` | *string*  | ISO datetime indicating when the webhook was issued.               |

### Unban User Webhook

When a user is unbanned from the platform, a notification will be sent with the following structure:

```json theme={null}
{
  "payload": {
    "reason": "Allowed to operate",
    "is_banned": false,
    "updated_at": "2025-09-17T11:00:34.584949Z",
    "status": "ACTIVE",
    "end_user_id": "test_coelsa_130625_1"
  },
  "event_type": "USER.ACTIVE",
  "issue_datetime": "2025-09-24T13:41:20.609755Z"
}
```

| Key              | Type      | Description                                                           |
| ---------------- | --------- | --------------------------------------------------------------------- |
| `payload`        | *object*  | Contains the webhook payload data.                                    |
| `reason`         | *string*  | The reason why the user was unbanned.                                 |
| `is_banned`      | *boolean* | Indicates the user's banned status. Will be `false` for unban events. |
| `updated_at`     | *string*  | ISO datetime indicating when the user status was updated.             |
| `status`         | *string*  | Current status of the user. Will be `ACTIVE` for unban events.        |
| `end_user_id`    | *string*  | End user's external ref identifier.                                   |
| `event_type`     | *string*  | Type of event. Will be `USER.ACTIVE` for active events.               |
| `issue_datetime` | *string*  | ISO datetime indicating when the webhook was issued.                  |

### Withdrawal Webhook

When a withdrawal is completed, a notification will be sent with the following structure:

```json theme={null}
{
  "payload": {
    "id": "1356b568-e6e6-445a-b9ec-e8dd9a2839fd",
    "hash": "0xa56fd57368d4776d6a3f9703729c5cb4e91a70c27212bb4bf248f89f63338959",
    "amount": "0.000200000000000000",
    "status": "COMPLETED",
    "txn_id": "3ee05362-0249-4bcc-a41c-e1a2a56c87fd",
    "network": "ETHEREUM",
    "op_type": "WITHDRAWAL",
    "created_at": "2024-01-11T19:43:11.229494Z",
    "create_date": "2024-01-11T19:43:11.229494Z",
    "end_user_id": "438ea6b0d5ca0ae7601ac7acc84d57f7a3f56fac7f66d5a59429c1c636f1af1c",
    "currency_code": "ETH",
    "confirmation_date": "2024-01-11T19:43:26.881527Z",
    "address_destination": "0x6f2777420B02bF41F7e2dd62112bDEE230778B3e"
  },
  "event_type": "WITHDRAWAL.COMPLETED",
  "issue_datetime": "2025-09-24T13:41:20.609755Z"
}
```

| Key                   | Type     | Description                                                              |
| --------------------- | -------- | ------------------------------------------------------------------------ |
| `payload`             | *object* | Contains the webhook payload data.                                       |
| `id`                  | *string* | Unique identifier for the withdrawal.                                    |
| `hash`                | *string* | Transaction hash on the blockchain.                                      |
| `amount`              | *string* | Amount withdrawn in the specified currency.                              |
| `status`              | *string* | Status of the withdrawal. Will be `COMPLETED` for completed withdrawals. |
| `txn_id`              | *string* | Internal transaction identifier.                                         |
| `network`             | *string* | Blockchain network used for the withdrawal.                              |
| `op_type`             | *string* | Operation type. Will be `WITHDRAWAL` for withdrawal events.              |
| `created_at`          | *string* | ISO datetime indicating when the withdrawal was created.                 |
| `create_date`         | *string* | ISO datetime indicating when the withdrawal was created.                 |
| `end_user_id`         | *string* | End user's external ref identifier.                                      |
| `currency_code`       | *string* | Currency code of the withdrawn asset.                                    |
| `confirmation_date`   | *string* | ISO datetime indicating when the withdrawal was confirmed.               |
| `address_destination` | *string* | Destination address for the withdrawal.                                  |
| `event_type`          | *string* | Type of event. Will be `WITHDRAWAL.COMPLETED` for completed withdrawals. |
| `issue_datetime`      | *string* | ISO datetime indicating when the webhook was issued.                     |

### Deposit Webhook

When a deposit is completed, a notification will be sent with the following structure:

```json theme={null}
{
  "payload": {
    "id": "fa42ad82-5854-4b62-bc1f-fe27b51f856d",
    "hash": "0xb8762f8ed09c0d38762522a233b2168ce7e6acbadab51b80fabf19ea32e030d9",
    "index": 0,
    "amount": "0.000200000000000000",
    "reason": "",
    "status": "COMPLETED",
    "txn_id": "ea297b09-08d7-4ce1-a2d4-f463fc0866f4",
    "network": "ETHEREUM",
    "op_type": "DEPOSIT",
    "created_at": "2024-01-12T08:51:22.126231Z",
    "is_blocked": false,
    "risk_score": null,
    "create_date": "2024-01-12T08:51:22.126231Z",
    "end_user_id": "438ea6b0d5ca0ae7601ac7acc84d57f7a3f56fac7f66d5a59429c1c636f1af1c",
    "currency_code": "ETH",
    "confirmation_date": "2024-01-12T08:54:56.740701Z",
    "address_destination": "0x6f2777420B02bF41F7e2dd62112bDEE230778B3e"
  },
  "event_type": "DEPOSIT.COMPLETED",
  "issue_datetime": "2025-09-24T13:41:20.609755Z"
}
```

| Key                   | Type      | Description                                                        |
| --------------------- | --------- | ------------------------------------------------------------------ |
| `payload`             | *object*  | Contains the webhook payload data.                                 |
| `id`                  | *string*  | Unique identifier for the deposit.                                 |
| `hash`                | *string*  | Transaction hash on the blockchain.                                |
| `index`               | *number*  | Transaction output index.                                          |
| `amount`              | *string*  | Amount deposited in the specified currency.                        |
| `reason`              | *string*  | Additional reason of the blocked deposit.                          |
| `status`              | *string*  | Status of the deposit. Will be `COMPLETED` for completed deposits. |
| `txn_id`              | *string*  | Internal transaction identifier.                                   |
| `network`             | *string*  | Blockchain network used for the deposit.                           |
| `op_type`             | *string*  | Operation type. Will be `DEPOSIT` for deposit events.              |
| `created_at`          | *string*  | ISO datetime indicating when the deposit was created.              |
| `is_blocked`          | *boolean* | Indicates if the deposit is blocked.                               |
| `risk_score`          | *number*  | Risk assessment score for the deposit (can be null).               |
| `create_date`         | *string*  | ISO datetime indicating when the deposit was created.              |
| `end_user_id`         | *string*  | End user's external ref identifier.                                |
| `currency_code`       | *string*  | Currency code of the deposited asset.                              |
| `confirmation_date`   | *string*  | ISO datetime indicating when the deposit was confirmed.            |
| `address_destination` | *string*  | Destination address for the deposit.                               |
| `event_type`          | *string*  | Type of event. Will be `DEPOSIT.COMPLETED` for completed deposits. |
| `issue_datetime`      | *string*  | ISO datetime indicating when the webhook was issued.               |

### Trade Webhook

When a trade is completed, a notification will be sent with the following structure:

```json theme={null}
{
  "payload": {
    "id": "09035e55-c8d2-4740-ab10-a32f04003fed",
    "rate": "102290.08391854",
    "status": "COMPLETED",
    "txn_id": "5e7e1bf3-8870-4672-8feb-10ebc8cfe21e",
    "op_type": "BUY",
    "quote_id": "0e3d93c5-f7cc-4c52-9281-3d6657e171e4",
    "base_asset": "LTC",
    "base_amount": "0.01759701",
    "charged_fee": "35.29409033",
    "create_date": "2023-11-01T15:46:28.835186Z",
    "end_user_id": "END_USER_5",
    "market_rate": "100284.39599857",
    "quote_asset": "ARS",
    "external_ref": "test",
    "quote_amount": "1800.00000000"
  },
  "event_type": "TRADE.COMPLETED",
  "issue_datetime": "2025-09-24T13:41:20.609755Z"
}
```

| Key              | Type     | Description                                                    |
| ---------------- | -------- | -------------------------------------------------------------- |
| `payload`        | *object* | Contains the webhook payload data.                             |
| `id`             | *string* | Unique identifier for the trade.                               |
| `rate`           | *string* | Exchange rate used for the trade.                              |
| `status`         | *string* | Status of the trade. Will be `COMPLETED` for completed trades. |
| `txn_id`         | *string* | Internal transaction identifier.                               |
| `op_type`        | *string* | Operation type (e.g., `BUY`, `SELL`).                          |
| `quote_id`       | *string* | Identifier of the quote used for the trade.                    |
| `base_asset`     | *string* | Base asset currency code.                                      |
| `base_amount`    | *string* | Amount of the base asset.                                      |
| `charged_fee`    | *string* | Fee charged for the trade.                                     |
| `create_date`    | *string* | ISO datetime indicating when the trade was created.            |
| `end_user_id`    | *string* | End user's external ref identifier.                            |
| `market_rate`    | *string* | Market rate at the time of the trade.                          |
| `quote_asset`    | *string* | Quote asset currency code.                                     |
| `external_ref`   | *string* | External reference identifier.                                 |
| `quote_amount`   | *string* | Amount of the quote asset.                                     |
| `event_type`     | *string* | Type of event. Will be `TRADE.COMPLETED` for completed trades. |
| `issue_datetime` | *string* | ISO datetime indicating when the webhook was issued.           |

### AutoSwap Webhook

When an AutoSwap is completed, a notification will be sent with the following structure:

```json theme={null}
{
  "payload": {
    "id": "819ceb14-e74a-4e08-96ff-cb8e2a3e4cac",
    "trade": {
        "id": "09035e55-c8d2-4740-ab10-a32f04003fed",
        "rate": "102290.08391854",
        "status": "COMPLETED",
        "txn_id": "5e7e1bf3-8870-4672-8feb-10ebc8cfe21e",
        "op_type": "BUY",
        "quote_id": "0e3d93c5-f7cc-4c52-9281-3d6657e171e4",
        "base_asset": "ETH",
        "base_amount": "0.01759701",
        "charged_fee": "35.29409033",
        "create_date": "2023-11-01T15:46:28.835186Z",
        "end_user_id": "END_USER_5",
        "market_rate": "100284.39599857",
        "quote_asset": "LTC",
        "external_ref": "test",
        "quote_amount": "1800.00000000"
    },
    "deposit": {
        "id": "c6bf5da2-6db0-4673-9220-431f460b5c26",
        "hash": "0x085601b3af8ba7a7fc067dec4f5ee1dbbe516093028479a03f3c4d8d7bb25422",
        "index": 0,
        "amount": "0.000200000000000000",
        "reason": "",
        "status": "PENDING",
        "txn_id": "e3b7c5f0-4c81-4a9d-8c65-fb135f25cab6",
        "network": "ETHEREUM",
        "op_type": "DEPOSIT",
        "created_at": "2024-01-11T19:33:30.643088Z",
        "is_blocked": false,
        "risk_score": null,
        "create_date": "2024-01-11T19:33:30.643088Z",
        "end_user_id": "438ea6b0d5ca0ae7601ac7acc84d57f7a3f56fac7f66d5a59429c1c636f1af1c",
        "auto_swap_id": "819ceb14-e74a-4e08-96ff-cb8e2a3e4cac",
        "currency_code": "ETH",
        "confirmation_date": "2024-01-11T19:40:35.621612Z",
        "address_destination": "0x6f2777420B02bF41F7e2dd62112bDEE230778B3e"
    },
    "withdrawal": {
        "id": "1356b568-e6e6-445a-b9ec-e8dd9a2839fd",
        "hash": "0xa56fd57368d4776d6a3f9703729c5cb4e91a70c27212bb4bf248f89f63338959",
        "amount": "0.000200000000000000",
        "status": "COMPLETED",
        "txn_id": "3ee05362-0249-4bcc-a41c-e1a2a56c87fd",
        "network": "ETHEREUM",
        "op_type": "WITHDRAWAL",
        "created_at": "2024-01-11T19:43:11.229494Z",
        "create_date": "2024-01-11T19:43:11.229494Z",
        "end_user_id": "438ea6b0d5ca0ae7601ac7acc84d57f7a3f56fac7f66d5a59429c1c636f1af1c",
        "currency_code": "LTC",
        "confirmation_date": "2024-01-11T19:43:26.881527Z",
        "address_destination": "0x6f2777420B02bF41F7e2dd62112bDEE230778B3e"
    },
    "create_date": "2025-03-21T19:23:19.099723Z",
    "update_date": "2025-03-21T19:23:19.099760Z",
    "auto_swap_id": "819ceb14-e74a-4e08-96ff-cb8e2a3e4cac",
    "error_reason": null
  },
  "event_type": "AUTOSWAP.UPDATE",
  "issue_datetime": "2025-09-24T13:41:20.609755Z"
}
```

| Key              | Type     | Description                                                       |
| ---------------- | -------- | ----------------------------------------------------------------- |
| `payload`        | *object* | Contains the webhook payload data.                                |
| `id`             | *string* | Unique identifier for the AutoSwap.                               |
| `trade`          | *object* | Trade object containing all trade-related information.            |
| `deposit`        | *object* | Deposit object containing all deposit-related information.        |
| `withdrawal`     | *object* | Withdrawal object containing all withdrawal-related information.  |
| `create_date`    | *string* | ISO datetime indicating when the AutoSwap was created.            |
| `update_date`    | *string* | ISO datetime indicating when the AutoSwap was last updated.       |
| `auto_swap_id`   | *string* | Unique identifier for the AutoSwap operation.                     |
| `error_reason`   | *string* | Error reason if the AutoSwap failed (can be null).                |
| `event_type`     | *string* | Type of event. Will be `AUTOSWAP.UPDATE` for completed AutoSwaps. |
| `issue_datetime` | *string* | ISO datetime indicating when the webhook was issued.              |

The nested `trade`, `deposit`, and `withdrawal` objects contain the same fields as their respective individual webhook payloads described above.
