> ## 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.

# Deposits & withdrawals

> Step-by-step walkthrough to receive crypto into your users' balances and send it to external wallets with the CaaS API.

Your users receive crypto on-chain through **deposit addresses** that Ripio generates for them, and send it out with **withdrawals** to any external address. For request and response details, follow the endpoint link in each step.

Both flows start from the same setup as trading: an access token, an [end user](/crypto-as-a-service/end-user/create-end-user.md) and, to withdraw, an [approved KYC](/crypto-as-a-service/kyc/overview.md).

## Deposits

**1. Create a deposit address**

Request an address for the end user on a `network` enabled for your account (e.g. `ETHEREUM`). Calling it again returns the same address.

The response is a **list**: networks of the same family share an address, so one EVM address is returned for every EVM network enabled for your account. On networks where addresses are shared between users, the response also includes a `memo` that identifies the user — show it to them, since a deposit without it can't be credited to them.

→ [Create Address for End User](/crypto-as-a-service/addresses/create-address-for-end-user.md) · [List End User's Addresses](/crypto-as-a-service/addresses/list-end-users-addresses.md)

**2. The user sends crypto to the address**

Ripio detects the deposit on-chain and credits the user's balance once it is confirmed.

**3. Follow the deposit**

Each status change of the deposit is notified with a `DEPOSIT` webhook; the final one for a credited deposit is `DEPOSIT.COMPLETED`. You can also poll the deposits list — to catch up on changes, sort by `updated_at` and filter by update date.

→ [List Deposits](/crypto-as-a-service/deposits/list-deposits.md) · [Retrieve Deposit](/crypto-as-a-service/deposits/retrieve-deposit.md) · [Crypto as a Service Webhooks](/crypto-as-a-service/webhooks/crypto-as-a-service-webhooks.md)

### Auto-swap addresses

An auto-swap address is a deposit address that converts every deposit into an asset preset for your account and **withdraws the result to a `target_address`**. It runs at the best market price once the deposit is confirmed, with trading and withdrawal fees deducted before sending. Each run is notified with an `AUTOSWAP.UPDATE` webhook.

→ [Create Auto Swap Address](/crypto-as-a-service/auto-swap-addresses/create-auto-swap-address-for-end-user.md) · [List Auto Swap Addresses](/crypto-as-a-service/auto-swap-addresses/list-end-users-auto-swap-addresses.md) · [Update target\_address](/crypto-as-a-service/auto-swap-addresses/update-target_address-of-endusers-autoswap-address.md)

> [!NOTE]
>
> Creating an auto-swap address that already exists returns it without changing its `target_address`. To change the destination, use the update endpoint.

## Withdrawals

**1. Get a withdrawal fee**

Request a fee for the `currency` and `network` of the withdrawal. The fee is held for a short time (see `expires_at`) and does not depend on the amount.

→ [Create Withdrawal Fee](/crypto-as-a-service/withdrawals/create-withdrawal-fee.md)

**2. Create the withdrawal**

Send the `end_user`, `currency`, `network`, destination `address`, `amount`, an `external_ref`, and the fee's `id` as `withdrawal_fee`. `currency` and `network` must match the ones of the fee.

* `amount` is what the destination receives. The user's balance is debited `amount` plus the fee (`debited_amount`).
* On networks that use a memo (Ripple, Stellar, TON and similar), `memo` is mandatory; on the others it is rejected.
* `external_ref` is unique per account: retrying with the same one returns the withdrawal already created instead of sending a second one.

→ [Create Withdrawal](/crypto-as-a-service/withdrawals/create-withdrawal.md)

**3. Follow the withdrawal**

Each status change is notified with a `WITHDRAWAL` webhook; `WITHDRAWAL.COMPLETED` comes with the on-chain `hash`. You can also retrieve it or list the withdrawals.

→ [Retrieve Withdrawal](/crypto-as-a-service/withdrawals/retrieve-withdrawal.md) · [List Withdrawals](/crypto-as-a-service/withdrawals/list-withdrawals.md)

## Webhooks and missed notifications

Deposits, withdrawals and auto-swaps are notified through IPN webhooks. Use `message_id` to deduplicate: the same operation is notified several times as its status advances. If your endpoint was down, recover what you missed from the IPN messages history.

→ [Webhooks Introduction](/crypto-as-a-service/webhooks/introduction.md) · [List IPN Messages](/crypto-as-a-service/ipn-messages/list-ipn-messages.md)

## Common errors

| Code | When | What to do |
| - | - | - |
| `20027` | The withdrawal fee expired | Request a new fee and create the withdrawal right away |
| `20029` | The destination address is not valid for the network | Check the address and the `network` |
| `20030` | The end user's KYC is not approved | Complete [identity verification](/crypto-as-a-service/kyc/overview.md) first |
| `20036` | The amount is below the minimum for the network | Increase the amount |
| `20037` | No auto-swap address exists for that network | Create the auto-swap address first |
| `40007` | The network is not allowed for that currency | Use a network enabled for the currency |

The full list is in [Error handling](/crypto-as-a-service/errors/error-handling.md).

## Testing in sandbox

* Deposit addresses are created on test networks (for example `ETHEREUM_SEPOLIA`); send test funds to them to credit an end user.
* Register your webhook URL with the [IPN Webhooks](/crypto-as-a-service/ipn-webhooks/create-ipn-webhook.md) endpoints, available only in sandbox. In production, ask the Ripio team to configure it.
* To check that your endpoint receives and parses notifications, send a test message with [Create Deposit IPN Notification for Testing](/crypto-as-a-service/deposit-ipn/create-deposit-ipn-notification-for-testing.md). It sends a fixed sample message only: it does not create a deposit or credit any balance.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.