Skip to content
Markdown

Payment type ​

INFO

Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.

POST /payment-type/create ​

This method allows adding payment-type into the account.

Нужное разрешение: payment_methods · как работают разрешения

Пример запроса

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/payment-type/create' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/payment-type/create', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/payment-type/create",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "name": "string"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/payment-type/create');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Тело запроса

ПолеТипОбязательноОписание
namestringДа
parent_idstringНет
transaction_typestringНетДопустимые значения: income, expense, transfer, exchange, nothing, exchange_method. По умолчанию: "income"
user_typestringНетДопустимые значения: supplier, employee, customer, person, other. По умолчанию: "supplier"
can_be_canceledbooleanНетПо умолчанию: false
json
{
  "name": "string",
  "parent_id": "67b486d242ed76693cd2cc59",
  "transaction_type": "income",
  "user_type": "supplier",
  "can_be_canceled": false
}

Ответ

ПолеТипОписание
_idstring
namestring
short_cutstring
typestringДопустимые значения: cash, card, debt, gift, transfer, terminal, by_balance, by_cashback
is_enabledbooleanПо умолчанию: true
is_defaultbooleanПо умолчанию: false
is_visiblebooleanПо умолчанию: false
created_atstring (date-time)
updated_atstring (date-time)
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "name": "string",
    "short_cut": "string",
    "type": "cash",
    "is_enabled": true,
    "is_default": false,
    "is_visible": false,
    "created_at": "2025-05-01T12:00:00Z",
    "updated_at": "2025-05-01T12:00:00Z"
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /payment-type/update ​

This method allows updating payment-type in the account.

Нужное разрешение: payment_methods · как работают разрешения

Пример запроса

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/payment-type/update' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "_id": "67b486d242ed76693cd2cc59"
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/payment-type/update', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "name": "string",
    "_id": "67b486d242ed76693cd2cc59"
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/payment-type/update",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "name": "string",
        "_id": "67b486d242ed76693cd2cc59",
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "name": "string",
  "_id": "67b486d242ed76693cd2cc59"
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/payment-type/update');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Тело запроса

ПолеТипОбязательноОписание
_idstringДа
namestringДа
parent_idstringНет
can_be_canceledbooleanНетПо умолчанию: false
json
{
  "_id": "67b486d242ed76693cd2cc59",
  "name": "string",
  "parent_id": "67b486d242ed76693cd2cc59",
  "can_be_canceled": false
}

Ответ

Структура ответа совпадает с POST /payment-type/create.

DELETE /payment-type/delete/{id} ​

Delete a payment-type

Нужное разрешение: payment_methods · как работают разрешения

Пример запроса

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

res = requests.request(
    "DELETE",
    "https://api.bito.uz/integration-api/integration/api/v2/payment-type/delete/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/payment-type/delete/6712f0a9c4d1e87b3a0f9911');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY')],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Параметры пути

ПараметрТипОбязательноОписание
idstringДа

Тело запроса

Тело запроса не требуется.

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "ok",
  "time": "2025-05-01T12:00:00Z"
}

POST /payment-type/get-all ​

Get all payment-types

Нужное разрешение: payment_methods · как работают разрешения

Пример запроса

bash
curl -X POST 'https://api.bito.uz/integration-api/integration/api/v2/payment-type/get-all' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "transaction_type": "income",
  "user_type": "supplier",
  "is_visible": false,
  "is_active": true
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/payment-type/get-all', {
  method: 'POST',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "transaction_type": "income",
    "user_type": "supplier",
    "is_visible": false,
    "is_active": true
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "POST",
    "https://api.bito.uz/integration-api/integration/api/v2/payment-type/get-all",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "transaction_type": "income",
        "user_type": "supplier",
        "is_visible": False,
        "is_active": True,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "transaction_type": "income",
  "user_type": "supplier",
  "is_visible": false,
  "is_active": true
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/payment-type/get-all');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Тело запроса

ПолеТипОбязательноОписание
transaction_typestringНетДопустимые значения: income, expense, transfer, exchange, nothing, exchange_method
user_typestringНетДопустимые значения: supplier, employee, customer, person, other
is_visiblebooleanНетПо умолчанию: false
is_activebooleanНетПо умолчанию: true
json
{
  "transaction_type": "income",
  "user_type": "supplier",
  "is_visible": false,
  "is_active": true
}

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    {
      "_id": "string",
      "name": "string",
      "short_cut": "string",
      "type": "cash",
      "is_enabled": true,
      "is_default": false,
      "is_visible": false,
      "created_at": "2025-05-01T12:00:00Z",
      "updated_at": "2025-05-01T12:00:00Z"
    }
  ],
  "time": "2025-05-01T12:00:00Z"
}

GET /payment-type/get-by-id/{id} ​

Get payment-type using its _id

Нужное разрешение: payment_methods · как работают разрешения

Пример запроса

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/payment-type/get-by-id/6712f0a9c4d1e87b3a0f9911' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/payment-type/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/payment-type/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/payment-type/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);

Параметры пути

ПараметрТипОбязательноОписание
idstringДа

Тело запроса

Тело запроса не требуется.

Ответ

Структура ответа совпадает с POST /payment-type/create.

GET /payment-type/get-deleted ​

Get deleted payment-type ids

Нужное разрешение: payment_methods · как работают разрешения

Пример запроса

bash
curl -X GET 'https://api.bito.uz/integration-api/integration/api/v2/payment-type/get-deleted?deleted_at=DELETED_AT' \
  -H "api-key: $BITO_API_KEY"
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/payment-type/get-deleted?deleted_at=DELETED_AT', {
  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/payment-type/get-deleted?deleted_at=DELETED_AT",
    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/payment-type/get-deleted?deleted_at=DELETED_AT');
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);

Параметры запроса

ПараметрТипОбязательноОписание
deleted_atstringДа

Тело запроса

Тело запроса не требуется.

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": [
    "string"
  ],
  "time": "2025-05-01T12:00:00Z"
}

PUT /payment-type/set-state ​

This method allows setActive payment-type in the account.

Нужное разрешение: payment_methods · как работают разрешения

Пример запроса

bash
curl -X PUT 'https://api.bito.uz/integration-api/integration/api/v2/payment-type/set-state' \
  -H "api-key: $BITO_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "_id": "67b486d242ed76693cd2cc59",
  "is_active": true
}'
js
const res = await fetch('https://api.bito.uz/integration-api/integration/api/v2/payment-type/set-state', {
  method: 'PUT',
  headers: { 'api-key': process.env.BITO_API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "_id": "67b486d242ed76693cd2cc59",
    "is_active": true
  }),
})
const { code, data } = await res.json()
python
import os
import requests

res = requests.request(
    "PUT",
    "https://api.bito.uz/integration-api/integration/api/v2/payment-type/set-state",
    headers={"api-key": os.environ["BITO_API_KEY"]},
    json={
        "_id": "67b486d242ed76693cd2cc59",
        "is_active": True,
    },
)
print(res.json())
php
<?php
$body = <<<'JSON'
{
  "_id": "67b486d242ed76693cd2cc59",
  "is_active": true
}
JSON;

$ch = curl_init('https://api.bito.uz/integration-api/integration/api/v2/payment-type/set-state');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => ['api-key: ' . getenv('BITO_API_KEY'), 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);

Тело запроса

ПолеТипОбязательноОписание
is_activebooleanДаПо умолчанию: true
_idstringДа
json
{
  "is_active": true,
  "_id": "67b486d242ed76693cd2cc59"
}

Ответ

Структура ответа совпадает с POST /payment-type/create.


Эта страница сгенерирована из спецификации OpenAPI.

Bito 2.0 Integration API