Skip to content
View as Markdown

Currency ​

INFO

Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.

GET /currency/get-all ​

Get all currencies

Required permission: currency · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/currency/get-all' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/currency/get-all', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/currency/get-all",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/currency/get-all');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Request body

No request body.

Response

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "completely_deleted": false,
      "code": "string",
      "created_at": "2025-05-01T12:00:00Z",
      "is_deleted": false,
      "is_main": false,
      "name": "string",
      "side": "start",
      "symbol": "string",
      "updated_at": "2025-05-01T12:00:00Z",
      "values": {
        "to_currency_id": "string",
        "value": 0,
        "name": "string",
        "numerator": 0,
        "denominator": 0
      }
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}

GET /currency/get-main ​

Get the main (default) currency of the tenant.

Required permission: currency · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/currency/get-main' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/currency/get-main', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/currency/get-main",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/currency/get-main');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Request body

No request body.

Response

FieldTypeDescription
completely_deletedboolean
codestring
created_atstring (date-time)
is_deletedboolean
is_mainboolean
namestring
sidestringOne of: start, end
symbolstring
updated_atstring (date-time)
valuesobject
values.to_currency_idstring
values.valuenumber
values.namestring
values.numeratornumber
values.denominatornumber
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "completely_deleted": false,
    "code": "string",
    "created_at": "2025-05-01T12:00:00Z",
    "is_deleted": false,
    "is_main": false,
    "name": "string",
    "side": "start",
    "symbol": "string",
    "updated_at": "2025-05-01T12:00:00Z",
    "values": {
      "to_currency_id": "string",
      "value": 0,
      "name": "string",
      "numerator": 0,
      "denominator": 0
    }
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /currency/get-by-id/{id} ​

Get a currency by its _id.

Required permission: currency · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/currency/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/currency/get-by-id/6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/currency/get-by-id/6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/currency/get-by-id/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Path parameters

ParameterTypeRequiredDescription
idstringYes

Request body

No request body.

Response

Same response shape as GET /currency/get-main.

GET /currency/get-to-local ​

Get the conversion rate from a source currency to the local (main) currency.

Required permission: currency · how permissions work

Example request

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/currency/get-to-local?currency_id=6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/currency/get-to-local?currency_id=6712f0a9c4d1e87b3a0f9911', {
  method: 'GET',
  headers: { 'api-key': process.env.BITO_API_KEY },
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "GET",
    "https://api.bito.uz/integration-api/integration/api/v2/currency/get-to-local?currency_id=6712f0a9c4d1e87b3a0f9911",
    headers={"api-key": os.environ["BITO_API_KEY"]},
)
print(res.json())
php
<?php
$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/currency/get-to-local?currency_id=6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Query parameters

ParameterTypeRequiredDescription
currency_idstringYes
amountnumberNo

Request body

No request body.

Response

FieldTypeDescription
from_currency_idstring
to_currency_idstring
ratenumber
converted_amountnumber
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "from_currency_id": "string",
    "to_currency_id": "string",
    "rate": 0,
    "converted_amount": 0
  },
  "time": "2025-05-01T12:00:00Z"
}

This page is generated from the OpenAPI spec.

Bito 2.0 Integration API