# Blockchain Deposits

To simplify acceptance of digital assets you can use Deposit SmartApp. Deposit SmartApp will orchestrate automatic forwarding of deposit to related Virtual account.

<figure><img src="/files/xFomqfE8XWGoh2H8oeFC" alt=""><figcaption></figcaption></figure>

Amount received to Virtual account will be diminished for the amount of blockchain fee paid for automatic withdrawal from Deposit account to Ramp account.

## Create Deposit

Use `seal` object to store immutable data about the deposit.

Use `data` object to store variable data about the deposit.

{% hint style="info" %}
Source Deposit account is automatically created.
{% endhint %}

{% hint style="info" %}
Target Virtual account must have related Ramp account assigned.
{% endhint %}

To create Deposit you must provide target Virtual account address or alias.

{% tabs %}
{% tab title="cURL" %}

<pre class="language-shell"><code class="lang-shell"><strong>echo 'Create deposit account'
</strong>
curl --location --request POST 'https://api.orangepill.cloud/v1/apps/deposit \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933dffabb' \
--header 'Content-Type: application/json' \
--data-raw '{
    "destination": {
        "account": "6340be52dffbdb56217f6a7b"
    },
    "asset": "BTC",    
    "seal": {
        "my_signature_field": "my_signature_value"
    },
    "data": {
        "description": "Desposit account for John James"
    }
}'
</code></pre>

{% endtab %}
{% endtabs %}

In response we get new `deposit` with status `PENDING` if validation was succesful. Notice that Deposit account is automatically created for `source`.

```json
{
    "id": "639d2416cd7325b35f409452",
    "source": {
        "account": "634b56217f6a7b0be52dffbd",
        "deposit_address": "bc1q7pna7w7462uruh8m54tcnzspva8xd98wmc546u",
        "owner": "639675ab191e9023f356dfa6"
    },
    "destination": {
        "account": "6340be52dffbdb56217f6a7b",
        "owner": "639675ab191e9023f356dfa6"
    },
    "asset": "BTC",
    "data": {
        "description": "Desposit account for John James"
    },
    "owner": "639675ab191e9023f356dfa6",
    "created_at": 1671242774572,
    "status": "PENDING",
    "error": null
}
```

### Deposit status

<table><thead><tr><th width="161">Status</th><th>Description</th></tr></thead><tbody><tr><td><code>PENDING</code></td><td>Awaiting for first deposit.</td></tr><tr><td><code>PROCESSING</code></td><td>Deposit received, withdrawal and forwarding in process.</td></tr><tr><td><code>DONE</code></td><td>Deposit processing was successful.</td></tr><tr><td><code>FAILED</code></td><td>Deposit creation or processing has failed.</td></tr></tbody></table>

##

{% hint style="info" %}
You can use the same Deposit App to receive multiple deposits. If the Deposit was in status `DONE`, it will change status to `PROCESSING` upon receiving of new deposit.
{% endhint %}

## List deposits

You can apply filters to get list of deposits.

{% tabs %}
{% tab title="cURL" %}

<pre class="language-shell"><code class="lang-shell"><strong>echo 'list deposits with status PENDING'
</strong>
curl --location --request GET 'https://api.orangepill.cloud/v1/apps/deposit?query={"status":"PENDING"}' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json'
</code></pre>

{% endtab %}
{% endtabs %}

In response we get array of `payment` objects.&#x20;

```json
[{
    "id": "639d2416cd7325b35f409452",
    "source": {
        "account": "634b56217f6a7b0be52dffbd",
        "deposit_address": "bc1q7pna7w7462uruh8m54tcnzspva8xd98wmc546u",
        "owner": "639675ab191e9023f356dfa6"
    },
    "destination": {
        "account": "6340be52dffbdb56217f6a7b",
        "owner": "639675ab191e9023f356dfa6"
    },
    "asset": "BTC",
    "data": {
        "description": "Desposit account for John James"
    },
    "owner": "639675ab191e9023f356dfa6",
    "created_at": 1671242774572,
    "status": "PENDING",
    "error": null
}]
```


---

# 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.orangepill.cloud/smartapps/blockchain-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.
