# Deposits

### Fiat Deposit via Bank Transfer

{% hint style="info" %}
This flow also applies to UR Peer Transfers - fiat transfers between 2 `live` UR accounts.
{% endhint %}

This flow enables a fully verified (`Live`) user to fund their UR account from an external, third-party bank account (e.g., their primary bank).

:information\_source: Note: Deposits can only be made from same-name bank accounts.

<table><thead><tr><th>Flow</th><th width="350.0859375">Details</th><th>Responsibility of</th></tr></thead><tbody><tr><td>Prerequisite: User is <code>Live</code></td><td>The user's status must be <code>Live</code> to access this feature. Your UI should only show the "Deposit" option to <code>Live</code> users.</td><td>Partner</td></tr><tr><td><ol><li>User Clicks "Deposit"</li></ol></td><td>The user selects "Deposit" and chooses "Bank Transfer" from within your app.</td><td>Partner</td></tr><tr><td><ol start="2"><li>Partner Fetches Account Details</li></ol></td><td>Your backend, which must be authorized, calls UR's API to retrieve the user's personal bank account details (IBAN, BIC, Bank Name).</td><td>Partner</td></tr><tr><td><ol start="3"><li>Partner Displays Account Details</li></ol></td><td>Your app's frontend displays the user's unique IBAN and transfer instructions (e.g., "Only send EUR or CHF to this account").</td><td>Partner</td></tr><tr><td><ol start="4"><li>User Initiates External Transfer</li></ol></td><td>The user leaves your app, logs into their external bank app (e.g., UBS, Revolut), and initiates a SEPA/SWIFT transfer to the IBAN provided.</td><td>User</td></tr><tr><td><ol start="5"><li>UR Receives Funds &#x26; Notifies Partner</li></ol></td><td>When the funds arrive (hours or days later), UR's banking core identifies the receiving IBAN, credits the user's account balance, and sends a <code>payment.received</code> webhook to your backend.<br><br>Alternatively, you may monitor on-chain transactions specific to said user.</td><td>UR -> Partner</td></tr><tr><td><ol start="6"><li>Partner Updates User</li></ol></td><td><ul><li>Your backend receives the webhook, verifies the details, and updates the user's balance in your system.</li><li>You should send a push notification or in-app update to inform the user (e.g., "Your €100.00 deposit has arrived.").</li></ul></td><td>Partner</td></tr></tbody></table>

{% @mermaid/diagram content="sequenceDiagram
participant User (on Partner App)
participant Partner (Frontend)
participant Partner (Backend)
participant UR (Backend)
participant User (at External Bank)
participant UR (Banking Core)

```
Note over User (on Partner App), UR (Banking Core): Prerequisite: User status is "Live"

User (on Partner App)->>Partner (Frontend): 1. Clicks "Deposit"
Partner (Frontend)->>Partner (Backend): 2. Request Account Details
Partner (Backend)->>UR (Backend): 3. GET /v1/users/{id}/accounts (using auth_token)
UR (Backend)-->>Partner (Backend): 4. Return {"iban": "CH...", "bic": "...", ...}
Partner (Backend)-->>Partner (Frontend): 5. Send Account Details
Partner (Frontend)->>User (on Partner App): 6. Display IBAN & Bank Details

User (on Partner App)-->>User (at External Bank): 7. (User goes to their other bank's app)
User (at External Bank)->>UR (Banking Core): 8. Initiates SEPA/SWIFT transfer

Note over User (at External Bank), UR (Banking Core): ...Hours or days later...

UR (Banking Core)->>UR (Backend): 9. Funds received for user's IBAN
UR (Backend)->>UR (Backend): 10. Credit User's Account Balance
UR (Backend)->>Partner (Backend): 11. Webhook: payment.received (amount, currency, user_id)

Partner (Backend)-->>Partner (Frontend): 12. Update UI (e.g., via WebSocket)
Partner (Frontend)->>User (on Partner App): 13. Show "Deposit Received" & Updated Balance" %}
```

### Crypto-to-Fiat Conversion (Offramp)

<table><thead><tr><th width="189.90625">Flow</th><th width="371.5859375">Details</th><th>Responsibility of</th></tr></thead><tbody><tr><td>1. Initiate Off-ramp</td><td>The user taps "Cash Out" for 1 ETH on your app.</td><td>Partner</td></tr><tr><td>2. Internal Debit</td><td>Your backend deducts 1 ETH from the user's custodial balance.</td><td>Partner</td></tr><tr><td>3. Request Quote</td><td>Your backend calls the liquidity provider API to request a real-time conversion quote for 1 ETH to EUR.</td><td>Partner</td></tr><tr><td>4. Source Liquidity</td><td>The liquidity provider API gets a live, executable price.</td><td>UR / Partner</td></tr><tr><td>5. Provide Quote</td><td>The liquidity provider API returns a firm, time-limited quote (e.g., "€1900.00, valid for 30s") to your backend.</td><td>UR -> Partner</td></tr><tr><td>6. Confirm Quote</td><td>Your frontend displays the quote, and the user taps "Confirm."</td><td>Partner</td></tr><tr><td>7. Execute Trade</td><td>Your backend calls the liquidity provider API with the unique <code>quote_id</code> to execute the trade.</td><td>Partner</td></tr><tr><td>8. Settle Trade</td><td><p>UR performs an atomic sequence:</p><p>a. Debits 1 ETH from <em>Partner's</em> corporate crypto account.</p><p>b. Sells 1 ETH via the liquidity provider.</p><p>c. Credits the resulting €1900.00 to the <em>end-user's</em> UR account.</p></td><td>UR</td></tr><tr><td>9. Notify User</td><td>UR sends a <code>payment.received</code> webhook. Your backend updates the user's UI and sends a push notification.</td><td>UR -> Partner -> User</td></tr></tbody></table>

{% @mermaid/diagram content="sequenceDiagram
participant User on Partner Platform
participant Partner Platform Backend
participant UR API
participant Liquidity Provider API

```
User on Partner Platform->> Partner Platform Backend: 1. Initiates "Cash Out" (e.g., 1,000 USDC)
activate Partner Platform Backend

Partner Platform Backend->> Partner Platform Backend: 2. Debits User's Custodial Balance

Partner Platform Backend->>UR API: 3. Requests Quote for 1,000 USDC -> EUR
activate UR API

UR API->>Liquidity Provider API: 4. Gets Live Price
activate Liquidity Provider API
Liquidity Provider API-->>UR API: 5. Returns Price
deactivate Liquidity Provider API

UR API-->> Partner Platform Backend: 6. Returns Firm Quote (Expires in 30s)
deactivate UR API
deactivate Partner Platform Backend

User on Partner Platform->> Partner Platform Backend: 7. Confirms Quote in UI
activate Partner Platform Backend

Partner Platform Backend->>UR API: 8. Executes Trade with Quote ID
activate UR API

note right of UR API: 9. Executes Atomic Sequence
UR API->>UR API: a) Debits Partner Platform's USDC Acct
UR API->>Liquidity Provider API: b) Sells USDC for EUR
UR API->>UR API: c) Credits User's UR EUR Acct

UR API-->>User on Partner Platform: 10. Sends Notification: "€863.00 deposited"
deactivate UR API
deactivate Partner Platform Backend
```

" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ur.app/concepts/deposits.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
