Skip to content

Payment type ​

INFO

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

POST /payment-type/create ​

This method allows adding payment-type into the account.

Тело запроса

ПолеТипОбязательноОписание
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.

Тело запроса

ПолеТипОбязательноОписание
_idstringДа
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
{
  "_id": "67b486d242ed76693cd2cc59",
  "name": "string",
  "parent_id": "67b486d242ed76693cd2cc59",
  "transaction_type": "income",
  "user_type": "supplier",
  "can_be_canceled": false
}

Ответ

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

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

Delete a payment-type

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

ПараметрТипОбязательноОписание
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

Тело запроса

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

Ответ

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

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

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

Тело запроса

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

Ответ

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

GET /payment-type/get-deleted ​

Get deleted payment-type ids

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

ПараметрТипОбязательноОписание
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.

Тело запроса

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

Ответ

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


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

Bito 2.0 Integration API