# Currency methods

## Currency object

<table><thead><tr><th width="232">Name</th><th width="106">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>string</td><td>The unique system identifier of a currency, matching the ISO code.</td></tr><tr><td><code>blockchain_name</code></td><td>string</td><td><p>The name of a blockchain, for example: <code>Bitcoin</code>.</p><p>The value is filled in by default only for coins. For other currencies, the value is an empty string.</p></td></tr><tr><td><code>iso</code></td><td>number</td><td>The ISO code of a currency.</td></tr><tr><td><code>name</code></td><td>string</td><td>The name of a currency, for example: <code>Bitcoin</code>.</td></tr><tr><td><code>alpha</code></td><td>string</td><td>The alphabetic code of a currency, for example: <code>BTC</code>.</td></tr><tr><td><code>alias</code></td><td>string or null</td><td>The alternative identifier used to identify similar currencies in different blockchains.</td></tr><tr><td><code>tags</code></td><td>string</td><td>The tags assigned via the B2BINPAY Back Office.</td></tr><tr><td><code>exp</code></td><td>number</td><td>The currency precision, that is the number of digits after the decimal separator.</td></tr><tr><td><code>confirmation_blocks</code></td><td>number or null</td><td><p>For cryptocurrencies, the default number of blocks needed to send a callback.</p><p>For fiat currencies, <code>null</code>.</p></td></tr><tr><td><code>minimal_transfer_amount</code></td><td>string</td><td>The minimum possible amount of transfers.</td></tr><tr><td><code>block_delay</code></td><td>number</td><td><p>For cryptocurrencies, the estimated block mining time, in seconds.</p><p>For fiat currencies, <code>0</code>.</p></td></tr><tr><td><code>parent</code></td><td>object</td><td><p><em>For tokens only.</em></p><p>The parent currency of a token, in the same blockchain. For other currencies, returns <code>"data": null</code>.</p><p>The object contains the string <code>id</code> field matching the parent currency ISO code.</p></td></tr></tbody></table>

#### Currency object example

```json
{
  "type": "currency",
  "id": "2015",
  "attributes": {
    "blockchain_name": "",
    "iso": 2015,
    "name": "TetherUS",
    "alpha": "USDT-ETH",
    "alias": "USDT",
    "tags": "",
    "exp": 6,
    "confirmation_blocks": 3,
    "minimal_transfer_amount": "25.000000",
    "block_delay": 75
  },
  "relationships": {
    "parent": {
      "data": {
        "type": "currency",
        "id": "1002"
      }
    }
  }
}
```

***

## Get currency

### Request

<mark style="color:green;">`GET`</mark> `[base]/currency/`<mark style="color:blue;">`{id}`</mark>

<table><thead><tr><th width="135">Name</th><th width="106">Type</th><th width="100">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>string</td><td>No</td><td>The unique system identifier of a currency, matching the ISO code.</td></tr></tbody></table>

Filtering by object parameters can be applied according to the [JSON API Specification](https://jsonapi.org/format/#query-parameters-families).

#### Request example

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

```sh
curl --request GET \
--url [base]/currency/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = '[base]/currency/'

headers = {
  'Authorization': 'Bearer <token>',
  'Content-Type': 'application/vnd.api+json',
}

requests.get(url, headers=headers)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;

$client = new GuzzleHttp\Client();
try {
  $res = $client->get('[base]/currency/', [
    'headers' => [
      'Authorization' => 'Bearer <token>',
      'Content-Type' => 'application/vnd.api+json',
    ],
  ]);
  echo $res->getBody();
} catch (RequestException $e) {}
```

{% endtab %}
{% endtabs %}

### Response

In case of success, the response body contains a [currency object](#currency-object) or an array of objects (if the `id` wasn’t specified).

The wallets list is paginated and the default page size is 10. You can adjust pagination according to the [JSON API Specification](https://jsonapi.org/format/#query-parameters-families).

#### Response codes

<table><thead><tr><th width="134">HTTP code</th><th width="274">Application code</th><th width="170">Description</th><th>Suggested action</th></tr></thead><tbody><tr><td><mark style="color:green;"><code>200</code></mark></td><td>—</td><td>The request succeeded.</td><td>—</td></tr><tr><td><mark style="color:red;"><code>401</code></mark></td><td>2007: No active account found with the given credentials</td><td>Incorrect credentials.</td><td>Send correct credentials.</td></tr><tr><td><mark style="color:red;"><code>404</code></mark></td><td>404: Not found</td><td>The currency with the given <code>id</code> wasn’t found.</td><td>Send a correct <code>id</code>.</td></tr><tr><td><mark style="color:red;"><code>500</code></mark></td><td>—</td><td>Internal server error.</td><td>Try again later.</td></tr><tr><td><mark style="color:red;"><code>502</code></mark></td><td>—</td><td>Bad gateway.</td><td>Try again later.</td></tr><tr><td><mark style="color:red;"><code>503</code></mark></td><td>—</td><td>Service unavailable.</td><td>Try again later.</td></tr><tr><td><mark style="color:red;"><code>504</code></mark></td><td>—</td><td>Gateway timeout.</td><td>Try again later.</td></tr><tr><td><mark style="color:red;"><code>5xx</code></mark></td><td>—</td><td>Other server errors.</td><td>Try again later.</td></tr></tbody></table>
