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

# Banking as a Service

> Step-by-step walkthrough to give your users fiat accounts with the CaaS API: open the account, receive fiat deposits and send fiat withdrawals.

With Banking as a Service (BaaS), each of your users gets a **fiat account** in their name — for example a CVU in Argentina or a CLABE in Mexico. They fund it with a bank transfer, and you can send their fiat out to their own bank accounts. For request and response details, follow the endpoint link in each step.

> [!NOTE]
>
> Banking as a Service must be enabled for your account. If it is not, these endpoints answer `403` with code `40003` — contact the Ripio team.

## Common setup

**1. Create the end user and approve their KYC**

A fiat account is opened in the user's name with their KYC data, so the user needs an **approved** KYC first. See [Identity verification (KYC)](/crypto-as-a-service/kyc/overview.md).

→ [Create End User](/crypto-as-a-service/end-user/create-end-user.md) · [Create KYC Submission](/crypto-as-a-service/kyc-submissions/create-kyc-submission.md)

**2. Create the fiat account**

Send the `payment_method_type` (e.g. `bank_transfer`). The account is created asynchronously: the response comes back with `status: PROCESSING`, and you receive a `FIAT_ACCOUNT.ENABLED` webhook when it is ready, with the account details in `fiat_payment_instructions` (e.g. the `cvu`). Calling it again for the same user and payment method returns the same account.

→ [Create Fiat Account](/crypto-as-a-service/fiat-accounts/create-fiat-account.md) · [Retrieve Fiat Account](/crypto-as-a-service/fiat-accounts/retrieve-fiat-account.md) · [BaaS Webhooks](/crypto-as-a-service/webhooks/baas-webhooks.md)

## Receive fiat deposits

**1. The user transfers to their fiat account**

Show the user the details from `fiat_payment_instructions`. Any transfer they make to that account is credited to their fiat balance.

**2. Follow the deposit**

You receive a `FIAT_DEPOSIT.COMPLETED` webhook when the deposit is credited. A deposit that exceeds the user's limits is notified as `FIAT_DEPOSIT.BLOCKED_LIMIT_EXCEEDED`, and one that is returned to the sender as `FIAT_DEPOSIT.CANCELLED`.

→ [List Fiat Deposits](/crypto-as-a-service/fiat-deposits/list-fiat-deposits.md) · [Retrieve Fiat Deposit](/crypto-as-a-service/fiat-deposits/retrieve-fiat-deposit.md)

With balance in fiat, the user can [buy crypto](/crypto-as-a-service/guides/trading-integration.md).

## Send fiat withdrawals

**1. Register a beneficiary fiat account**

A beneficiary fiat account is the user's external bank account, where the withdrawals go. Send the `payment_method_type`, the `currency` and the `account_fields` of the destination — in Argentina, `alias_or_cvu_destination`; in Mexico, `clabe_destination`. Ripio checks that the destination exists, and you receive a `BENEFICIARY_FIAT_ACCOUNT.ENABLED` webhook when it can be used.

→ [Create Beneficiary Fiat Account](/crypto-as-a-service/beneficiary-fiat-accounts/create-beneficiary-fiat-account.md) · [List Beneficiary Fiat Accounts](/crypto-as-a-service/beneficiary-fiat-accounts/list-beneficiary-fiat-account.md)

**2. Create the fiat withdrawal**

Send the `end_user_id`, the `beneficiary_fiat_account_id`, the `amount` and an `external_ref`. The balance is debited right away and the withdrawal starts as `PENDING`. Retrying with the same `external_ref` returns the withdrawal already created.

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

**3. Follow the withdrawal**

You receive a `FIAT_WITHDRAWAL` webhook on each status change: `FIAT_WITHDRAWAL.COMPLETED` when the transfer is done, or `FIAT_WITHDRAWAL.CANCELLED` when it could not be sent — in that case the balance is returned to the user.

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

## Common errors

| Code | When | What to do |
| - | - | - |
| `20012` | Not enough fiat balance for the withdrawal | Check the user's balance first |
| `20021` | The end user is banned | The user cannot operate |
| `20030` | The end user's KYC is not approved | Complete [identity verification](/crypto-as-a-service/kyc/overview.md) first |
| `20032` | The payment method is not enabled for your account | Use an enabled `payment_method_type`, or contact the Ripio team |
| `20033` / `20034` | The withdrawal exceeds the user's frequency or amount limits | Wait for the limit period to reset or lower the amount |
| `20035` | The user has no enabled fiat account for that provider | Create the fiat account and wait for `FIAT_ACCOUNT.ENABLED` |

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

## Testing in sandbox

Simulate an incoming transfer with [Simulate Fiat Deposit](/crypto-as-a-service/simulate-fiat-deposit/simulate-fiat-deposit.md): send the `payment_method_type`, the `amount` and the user's account identifier — the `cvu` from `fiat_payment_instructions` in Argentina, or the `clabe` in Mexico. The deposit then goes through the same flow as a real one, including the `FIAT_DEPOSIT.COMPLETED` webhook.


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