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

# deposit

> Subscribe to real-time notifications of deposit events for your account

This topic is responsible for notifying the user when a fiat or cryptocurrency deposit occurs.

<Warning>
  This is an authenticated stream. You must provide a valid ticket from authentication to subscribe.
</Warning>

## Subscription Request

<ParamField body="method" type="string" required>
  Subscribe method. Must be `subscribe`
</ParamField>

<ParamField body="topics" type="array" required>
  Array of topics to subscribe to. Must include `deposit`

  Example: `["deposit"]`
</ParamField>

<ParamField body="ticket" type="string" required>
  Ticket created using the endpoint POST [https://api.ripio.com/trade/ticket](https://api.ripio.com/trade/ticket)
</ParamField>

## Stream Response

<ResponseField name="id" type="integer">
  Message identifier
</ResponseField>

<ResponseField name="topic" type="string">
  Topic name (always `deposit`)
</ResponseField>

<ResponseField name="timestamp" type="integer">
  Server timestamp in milliseconds
</ResponseField>

<ResponseField name="body" type="object">
  Deposit details object

  <Expandable title="Deposit Details">
    <ResponseField name="id" type="string">
      Deposit identifier
    </ResponseField>

    <ResponseField name="user_id" type="string">
      Your user ID
    </ResponseField>

    <ResponseField name="amount" type="number">
      Deposit amount
    </ResponseField>

    <ResponseField name="currency_code" type="string">
      Currency code (e.g., ETH, BTC, BRL)
    </ResponseField>

    <ResponseField name="status" type="string">
      Deposit status: `pending`, `confirmed`, `failed`
    </ResponseField>

    <ResponseField name="is_internal" type="boolean">
      Whether this is an internal transfer between BitcoinTrade accounts
    </ResponseField>

    <ResponseField name="hash" type="string">
      Transaction hash (for blockchain deposits) or internal transfer ID
    </ResponseField>

    <ResponseField name="address" type="string">
      Deposit address where funds were received
    </ResponseField>

    <ResponseField name="network" type="string">
      Blockchain network (e.g., bitcoin, ethereum, bitcoincash)
    </ResponseField>

    <ResponseField name="create_date" type="string">
      Deposit creation datetime (ISO 8601 format)
    </ResponseField>

    <ResponseField name="update_date" type="string">
      Last update datetime (ISO 8601 format)
    </ResponseField>

    <ResponseField name="confirmation_date" type="string">
      Confirmation datetime (when deposit was finalized)
    </ResponseField>
  </Expandable>
</ResponseField>

## Subscription Example

```json theme={null}
{
  "method": "subscribe",
  "topics": [
    "deposit"
  ],
  "ticket": "97794B95-AFE7-454F-81B0-9109112548C2"
}
```

## Stream Response Example - Cryptocurrency Deposit

```json theme={null}
{
  "id": 10,
  "topic": "deposit",
  "timestamp": 1673271591764,
  "body": {
    "id": "08799ECC-F6B1-498E-B89C-2A05E6A181B9",
    "user_id": "5B6A43AE-8012-402D-966F-87CF64689535",
    "amount": 1,
    "currency_code": "ETH",
    "status": "confirmed",
    "is_internal": false,
    "hash": "0x79704c92b31061b8f51e26486d6454aff3e3c58aa0d51f0f803d6fd063be8100",
    "address": "3PQhyXH1EZs1bZ23ZafqQDyeViqxn5KdXN",
    "network": "ethereum",
    "create_date": "2023-01-09T13:39:24.057Z",
    "update_date": "2023-01-09T13:39:25.001Z",
    "confirmation_date": "2023-01-09T13:39:25.001Z"
  }
}
```

## Stream Response Example - Fiat Deposit

```json theme={null}
{
  "id": 11,
  "topic": "deposit",
  "timestamp": 1673271591764,
  "body": {
    "id": "08799ECC-F6B1-498E-B89C-2A05E6A181B9",
    "user_id": "5B6A43AE-8012-402D-966F-87CF64689535",
    "amount": 1000,
    "currency_code": "BRL",
    "status": "confirmed",
    "is_internal": true,
    "hash": null,
    "address": null,
    "network": null,
    "create_date": "2023-01-09T13:39:24.057Z",
    "update_date": "2023-01-09T13:39:25.001Z",
    "confirmation_date": "2023-01-09T13:39:25.001Z"
  }
}
```

## Deposit Status Lifecycle

```
pending → confirmed
    ↓
  failed
```

* **pending**: Deposit received but not yet confirmed
* **confirmed**: Deposit finalized and added to your balance
* **failed**: Deposit failed and was not credited

## Deposit Types

### External Deposits

* From external blockchain addresses
* Include transaction hash
* May take time to confirm (network dependent)
* Bitcoin: \~10 minutes (6 confirmations)
* Ethereum: \~2 minutes (12 confirmations)

### Internal Transfers

* Between BitcoinTrade accounts
* No blockchain involved
* Confirm immediately
* Marked with `is_internal: true`

## Key Fields

| Field              | Description                       |
| ------------------ | --------------------------------- |
| **amount**         | How much was deposited            |
| **currency\_code** | What was deposited                |
| **status**         | Current state of deposit          |
| **hash**           | Transaction ID on blockchain      |
| **network**        | Which blockchain network          |
| **is\_internal**   | Whether it's an internal transfer |

## Blockchain Networks

| Network      | Code        | Currency |
| ------------ | ----------- | -------- |
| Bitcoin      | bitcoin     | BTC      |
| Ethereum     | ethereum    | ETH      |
| Bitcoin Cash | bitcoincash | BCH      |
| And others   | -           | -        |

## Timing by Currency

| Currency | Type     | Typical Confirmation |
| -------- | -------- | -------------------- |
| BTC      | External | 10-30 minutes        |
| ETH      | External | 2-5 minutes          |
| BCH      | External | 3-10 minutes         |
| BRL      | Internal | Immediate            |
| Others   | Variable | Variable             |

## Usage Notes

* **Authentication Required**: Requires valid ticket from WebSocket authentication
* **Real-time Updates**: Receive notification when deposit is received
* **Multiple Notifications**: Receive updates as status changes (pending → confirmed)
* **Complete Info**: All deposit details provided
* **Address Stored**: Can view which address was used

## Pending vs Confirmed

* **Pending**: Received but not yet verified on blockchain
* **Confirmed**: Fully confirmed and added to balance
* **Recommended**: Wait for confirmed status before trading

## Use Cases

* **Balance Updates**: Get notified when deposits arrive
* **Fund Tracking**: Monitor incoming funds
* **Deposit Confirmation**: Confirm deposit success
* **Accounting**: Record deposits for bookkeeping
* **Alert System**: Notify users of large deposits
* **Fund Reconciliation**: Reconcile with bank records
