API Цифрового Кооператива (1)

Download OpenAPI specification:Download

License: MIT

Auth

Authentication

Register as user

Request Body schema: application/json
name
required
string
email
required
string <email>

must be unique

password
required
string <password> >= 8 characters

At least one number and one letter

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "user": {
    },
  • "tokens": {
    }
}

Login

Request Body schema: application/json
email
required
string <email>
password
required
string <password>

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "user": {
    },
  • "tokens": {
    }
}

Logout

Request Body schema: application/json
refreshToken
required
string

Responses

Request samples

Content type
application/json
{
  • "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1ZWJhYzUzNDk1NGI1NDEzOTgwNmMxMTIiLCJpYXQiOjE1ODkyOTg0ODQsImV4cCI6MTU4OTMwMDI4NH0.m1U63blB0MLej_WfB7yC2FTMnCziif9X8yzwDEfJXAg"
}

Response samples

Content type
application/json
{
  • "code": 404,
  • "message": "Not found"
}

Refresh auth tokens

Request Body schema: application/json
refreshToken
required
string

Responses

Request samples

Content type
application/json
{
  • "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1ZWJhYzUzNDk1NGI1NDEzOTgwNmMxMTIiLCJpYXQiOjE1ODkyOTg0ODQsImV4cCI6MTU4OTMwMDI4NH0.m1U63blB0MLej_WfB7yC2FTMnCziif9X8yzwDEfJXAg"
}

Response samples

Content type
application/json
{
  • "access": {
    },
  • "refresh": {
    }
}

Forgot password

An email will be sent to reset password.

Request Body schema: application/json
email
required
string <email>

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "code": 404,
  • "message": "Not found"
}

Reset password

query Parameters
token
required
string

The reset password token

Request Body schema: application/json
password
required
string <password> >= 8 characters

At least one number and one letter

Responses

Request samples

Content type
application/json
{
  • "password": "password1"
}

Response samples

Content type
application/json
{
  • "code": 401,
  • "message": "Password reset failed"
}

Send verification email

An email will be sent to verify email.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "code": 401,
  • "message": "Please authenticate"
}

verify email

query Parameters
token
required
string

The verify email token

Responses

Response samples

Content type
application/json
{
  • "code": 401,
  • "message": "verify email failed"
}

Orders

Управление платежами

Обработка IPN уведомления

Маршрут для обработки IPN уведомления.

Responses

Создание регистрационного платежа

Маршрут для создания регистрационного платежа.

Authorizations:
bearerAuth
Request Body schema: application/json
username
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "string"
}

Response samples

Content type
application/json
{
  • "order_id": 0,
  • "confirmation_token": "string"
}

Создание депозита в кошелёк

Маршрут для создания депозита.

Authorizations:
bearerAuth
Request Body schema: application/json
username
required
string
quantity
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "string",
  • "quantity": "string"
}

Response samples

Content type
application/json
{
  • "order_id": 0,
  • "confirmation_token": "string"
}

Users

Управление пользователями

Создать пользователя

Только администраторы могут создавать новых пользователей.

Authorizations:
bearerAuth
Request Body schema: application/json
email
required
string <email>
password
required
string
role
required
string
Enum: "user" "admin"
public_key
required
string
username
required
string
referer
string = 12 characters
type
required
string
Enum: "individual" "entrepreneur" "organization"
object (IIndividualData)
object (IOrganizationData)
object (IEntrepreneurData)

Responses

Request samples

Content type
application/json
{
  • "email": "[email protected]",
  • "password": "string",
  • "role": "user",
  • "public_key": "string",
  • "username": "string",
  • "referer": "stringstring",
  • "type": "individual",
  • "individual_data": {
    },
  • "organization_data": {
    },
  • "entrepreneur_data": {
    }
}

Response samples

Content type
application/json
{
  • "username": "string",
  • "status": "created",
  • "is_registered": true,
  • "type": "individual",
  • "public_key": "string",
  • "referer": "string",
  • "email": "[email protected]",
  • "role": "string",
  • "is_email_verified": true,
  • "private_data": {
    }
}

Получить всех пользователей

Только администратор может получить всех пользователей

Authorizations:
bearerAuth
query Parameters
username
string

Системное имя пользователя

role
string

Роль пользователя

sortBy
string

Сортировка по полю в формате field:desc/asc (например, name:asc)

limit
integer >= 1
Default: 10

Максимальное количество пользователей

page
integer >= 1
Default: 1

Номер страницы

Responses

Response samples

Content type
application/json
{
  • "results": [
    ],
  • "page": 1,
  • "limit": 10,
  • "totalPages": 1,
  • "totalResults": 1
}

Получить пользователя

Авторизованные пользователи могут получать только свою собственную информацию. Только администраторы могут получать информацию о других пользователях.

Authorizations:
bearerAuth
path Parameters
username
required
string

Идентификатор пользователя

Responses

Response samples

Content type
application/json
{
  • "username": "string",
  • "status": "created",
  • "is_registered": true,
  • "type": "individual",
  • "public_key": "string",
  • "referer": "string",
  • "email": "[email protected]",
  • "role": "string",
  • "is_email_verified": true,
  • "private_data": {
    }
}

Обновить пользователя

Только администраторы могут обновлять информацию о других пользователях.

Authorizations:
bearerAuth
path Parameters
username
required
string

Системное имя пользователя

Request Body schema: application/json
email
string <email>

должен быть уникальным

password
string <password> >= 8 characters

Минимум одна цифра и одна буква

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "username": "string",
  • "status": "created",
  • "is_registered": true,
  • "type": "individual",
  • "public_key": "string",
  • "referer": "string",
  • "email": "[email protected]",
  • "role": "string",
  • "is_email_verified": true,
  • "private_data": {
    }
}