# Virtual Currencies

## Deploy new Virtual Currency

To deploy new Virtual Currency you need to define unique name, inital supply, base currency and rate.

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

```shell
echo 'Issue new virtual currency named MY_USD'

curl --location --request POST 'https://api.orangepill.cloud/v1/currencies \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffdb' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "MY_USD",
    "supply": "1000",
    "base": "USD",
    "rate": "1",
    "currency": "USD"
    "symbol":"$",
    "symbol_url":"https://my-cdn.com/my-dollar-sign.svg",
    "sub_unit": ["cent", "cents"],
    
}'
```

{% endtab %}
{% endtabs %}

In response you will receive new Virtual Currency with reference to newly created Account with supply issued.

```json
{
    "id": "63a52711fc21ce5d7b34d9f5",
    "name": "MY_USD",
    "supply": "1000",
    "base": "USD",
    "rate": 1,
    "country": "US",
    "currency": "USD",
    "owner": "639675ab191e9023f356dfa6",
    "created_at": 1671767825114,
    "active": true,
    "deleted": false,
    "account": "63a52711fc21ce5d7b34d9f6",
    "symbol":"$",
    "symbol_url":"https://my-cdn.com/my-dollar-sign.svg",
    "sub_unit": ["cent", "cents"],
}
```

## Issue new supply

New supply can be issued on account holding Virtual Currency.

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

```shell
echo 'Issue new supply for virtual currency with id 63a52711fc21ce5d7b34d9f5'

curl --location --request POST 'https://api.orangepill.cloud/v1/currencies/63a52711fc21ce5d7b34d9f5/issue \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffdb' \
--header 'Content-Type: application/json' \
--data-raw '{
    "account": "63a633e84ab7d02420b732ae",
    "amount": "520.35"
}'
```

{% endtab %}
{% endtabs %}

In response you will get Virttual Currency details with list of issue and destroy operations in object `issuing`.

```json
{
    "id": "63a633e84ab7d02420b732ad",
    "name": "MY_USD",
    "supply": "1000",
    "base": "USD",
    "rate": 1,
    "country": "US",
    "currency": "USD",
    "account": "63a633e84ab7d02420b732ae",
    "issuing": [
        {
            "operation": "issue",
            "amount": "520.35",
            "account": "63a633e84ab7d02420b732ae",
            "reference": "63a633e8210e23efb8e2837f"
        }
    ],
    "owner": "639675ab191e9023f356dfa6",
    "created_at": 1671836648605,
    "updated_at": 1671836888327,
    "active": true,
    "deleted": false
}
```

## Destroy a supply

You can destroy total supply of Virtual Currency on Account.&#x20;

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

```shell
echo 'Destroy supply for virtual currency with id 63a52711fc21ce5d7b34d9f5'

curl --location --request POST 'https://api.orangepill.cloud/v1/currencies/63a52711fc21ce5d7b34d9f5/destroy \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffdb' \
--header 'Content-Type: application/json' \
--data-raw '{
    "account": "63a633e84ab7d02420b732ae",
    "amount": "100"
}'
```

{% endtab %}
{% endtabs %}

In response you will get Virtual Currency details with list of issue and destroy operations in object `issuing`.

```json
{
    "id": "63a633e84ab7d02420b732ad",
    "name": "MY_USD",
    "supply": "1000",
    "base": "USD",
    "rate": 1,
    "country": "US",
    "currency": "USD",
    "account": "63a633e84ab7d02420b732ae",
    "issuing": [
        {
            "operation": "issue",
            "amount": "520.35",
            "account": "63a633e84ab7d02420b732ae",
            "reference": "63a633e8210e23efb8e2837f"
        },
        {
            "operation": "destroy",
            "amount": "100",
            "account": "63a633e84ab7d02420b732ae",
            "reference": "6461b9d5-a813-4b90-93b2-f5ad510a9eb5"
        }
    ],
    "owner": "639675ab191e9023f356dfa6",
    "created_at": 1671836648605,
    "updated_at": 1671836888327,
    "active": true,
    "deleted": false
}
```


---

# 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/orangepill-api/virtual-currencies.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.
