{
  "openapi": "3.0.1",
  "info": {
    "title": "APIkey",
    "description": "###### Основные статусы заказа:\n\n- *preliminary* - клиент переводит средства на наши реквизиты\n- *new* | *frozen* - проверяем поступление средств\n- Результат:\n  - *completed* - заказ обработан (финальный статус)\n  - *deleted* | error - заказ удален, содержит ошибки\n\n###### Последовательность создания заказа:\n1. directions\n2. payment-systems\n3. exchange-rate-calculate\n4. order-props-get\n5. order-create\n6. order-validate\n7. order-pay-info\n8. order-confirm\n\n###### Ошибка\n```\n{\n  \"status\": \"error\",\n  \"msg\": \"Timeout\",\n  \"errcode\": 303,\n  \"errname\": \"SERVER_ERROR\"\n}\n```\n",
    "version": "1.0"
  },
  "tags": [
    {
      "name": "info"
    },
    {
      "name": "callback"
    },
    {
      "name": "order"
    },
    {
      "name": "user"
    },
    {
      "name": "File"
    }
  ],
  "paths": {
    "/api/1/directions/": {
      "get": {
        "summary": "Направления обменов",
        "deprecated": false,
        "description": "",
        "operationId": "get-api-1-directions",
        "tags": [
          "info"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Directions",
            "description": "Example response"
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/exchange-rate-calculate/": {
      "get": {
        "summary": "Вычислить курс обмена",
        "deprecated": false,
        "description": "Вычислить окончательный курс обмена для заявки с учетом скидок и т.п.",
        "operationId": "get-api-1-exchange-rate-calculate",
        "tags": [
          "info"
        ],
        "parameters": [
          {
            "name": "psid1",
            "in": "query",
            "description": "",
            "required": true,
            "example": "",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "psid2",
            "in": "query",
            "description": "",
            "required": true,
            "example": "",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "description": "",
            "required": true,
            "example": "",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "direct",
            "in": "query",
            "description": "",
            "required": false,
            "example": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "coupon_name",
            "in": "query",
            "description": "",
            "required": false,
            "example": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "type": "object",
                      "properties": {
                        "direction": {
                          "$ref": "#/components/schemas/Direction"
                        },
                        "discount": {
                          "type": "object",
                          "properties": {
                            "percent": {
                              "type": "number"
                            },
                            "amount": {
                              "type": "number"
                            },
                            "valute": {
                              "type": "string"
                            }
                          }
                        },
                        "warnings": {
                          "type": "string"
                        },
                        "alert": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/payment-systems/": {
      "get": {
        "summary": "Платежные системы",
        "deprecated": false,
        "description": "",
        "operationId": "get-api-1-payment-systems",
        "tags": [
          "info"
        ],
        "parameters": [
          {
            "name": "std",
            "in": "query",
            "description": "если true, ключ == psid",
            "required": false,
            "example": "",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentSystem",
            "description": "Example response"
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/directions-available/": {
      "get": {
        "summary": "Доступные платежные системы",
        "deprecated": false,
        "description": "Получить доступные платежные системы для обмен",
        "operationId": "get-api-1-directions-available",
        "tags": [
          "info"
        ],
        "parameters": [
          {
            "name": "direct",
            "in": "query",
            "description": "Флаг направления обмена",
            "required": false,
            "example": "",
            "schema": {
              "type": "integer",
              "example": 1
            }
          },
          {
            "name": "psid",
            "in": "query",
            "description": "Идентификатор платежной системы",
            "required": true,
            "example": "",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Directions",
            "description": "Example response"
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/payment-systems-for-receive/": {
      "get": {
        "summary": "Платежные системы на получения (слева)",
        "deprecated": false,
        "description": "",
        "operationId": "get-api-1-payment-systems-for-receive",
        "tags": [
          "info"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentSystem",
            "description": "Example response"
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/payment-systems-for-send/": {
      "get": {
        "summary": "Платежные системы на отдачу (справа)",
        "deprecated": false,
        "description": "",
        "operationId": "get-api-1-payment-systems-for-send",
        "tags": [
          "info"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentSystem",
            "description": "Example response"
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/valutes/": {
      "get": {
        "summary": "Валюты",
        "deprecated": false,
        "description": "",
        "operationId": "get-api-1-valutes",
        "tags": [
          "info"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "precision": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  },
                  "x-examples": {
                    "example-1": {
                      "status": "success",
                      "value": [
                        {
                          "id": "34",
                          "code": "ADA",
                          "name": "Cardano (ADA)",
                          "precision": 8
                        },
                        {
                          "id": "76",
                          "code": "ARCONA",
                          "name": "Arcona",
                          "precision": 6
                        }
                      ]
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/set-callback-url/": {
      "get": {
        "summary": "Поключение уведомлений",
        "deprecated": false,
        "description": "Получать уведомление о смене статуса заявок на указанный url",
        "operationId": "get-api-1-set-callback-url",
        "tags": [
          "callback"
        ],
        "parameters": [
          {
            "name": "callback",
            "in": "query",
            "description": "https://test.host/callback",
            "required": true,
            "example": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "signature",
            "in": "query",
            "description": "secretphrases",
            "required": true,
            "example": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "type": "object",
                      "properties": {
                        "callback": {
                          "type": "string"
                        },
                        "signature": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/test-callback-url/": {
      "get": {
        "summary": "Проверка уведомлений",
        "deprecated": false,
        "description": "Проверка уведомлений",
        "operationId": "get-api-1-test-callback-url",
        "tags": [
          "callback"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Желаемый ответ, если не указан, рандомно",
            "required": false,
            "example": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order_id",
            "in": "query",
            "description": "В ответе придет указаный номер",
            "required": false,
            "example": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vkey",
            "in": "query",
            "description": "Параметр, указывается при создании заявки \"order-created\"",
            "required": false,
            "example": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "x-examples": {
                    "example-1": {
                      "status": "success",
                      "value": {
                        "request": {
                          "type": "order-status",
                          "vkey": "MOEX2145",
                          "param": null,
                          "value": {
                            "psid1": 9,
                            "psid2": 172,
                            "amount1": 105,
                            "amount2": 105,
                            "status": "completed",
                            "order_id": "16037897784326",
                            "msg": "Заявка выполнена"
                          },
                          "test": 1
                        },
                        "response": {
                          "status_code": 200,
                          "body": "OK"
                        }
                      }
                    }
                  },
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "type": "object",
                      "properties": {
                        "request": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string"
                            },
                            "vkey": {
                              "type": "string"
                            },
                            "value": {
                              "type": "object",
                              "properties": {
                                "psid1": {
                                  "type": "integer"
                                },
                                "psid2": {
                                  "type": "integer"
                                },
                                "amount1": {
                                  "type": "integer"
                                },
                                "amount2": {
                                  "type": "integer"
                                },
                                "status": {
                                  "type": "string"
                                },
                                "order_id": {
                                  "type": "string"
                                },
                                "msg": {
                                  "type": "string"
                                }
                              }
                            },
                            "test": {
                              "type": "integer"
                            }
                          }
                        },
                        "response": {
                          "type": "object",
                          "properties": {
                            "status_code": {
                              "type": "integer"
                            },
                            "body": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "example-1": {
                    "summary": "example-1",
                    "value": {
                      "status": "string",
                      "value": {
                        "request": {
                          "type": "string",
                          "vkey": "string",
                          "param": null,
                          "value": {
                            "psid1": 0,
                            "psid2": 0,
                            "amount1": 0,
                            "amount2": 0,
                            "status": "string",
                            "order_id": "string",
                            "msg": "string"
                          },
                          "test": 0
                        },
                        "response": {
                          "status_code": 0,
                          "body": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/order-props-get/": {
      "get": {
        "summary": "Реквизиты заявки",
        "deprecated": false,
        "description": "Получить список реквизитов платежных систем на прием и отдачу.",
        "operationId": "get-api-1-order-props-get",
        "tags": [
          "order"
        ],
        "parameters": [
          {
            "name": "psid1",
            "in": "query",
            "description": "ID направления, откуда клиент переводит средства",
            "required": true,
            "example": "",
            "schema": {
              "type": "integer",
              "example": 12
            }
          },
          {
            "name": "psid2",
            "in": "query",
            "description": "ID направления, куда клиент хочет получить средства",
            "required": true,
            "example": "",
            "schema": {
              "type": "integer",
              "example": 1
            }
          },
          {
            "name": "direct",
            "in": "query",
            "description": "Флаг направления обмена",
            "required": false,
            "example": "",
            "schema": {
              "type": "integer",
              "example": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "$ref": "#/components/schemas/Props"
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/order-create/": {
      "post": {
        "summary": "Создать заявку",
        "deprecated": false,
        "description": "Пример расчета суммы:\n```\nОбмен Сбербанк на Bitcoin psid1=8&psid2=12\nСитуация №1. вы хотите получить 0.01 BTC ровно, in=1&out=0.01&direct=1 .. клиент заплатит(0.01BTC+%)\nСитуация №2. вы хотите что бы клиент потратил ровно 999р Сбербанк\nin=999&out=1&direct=0 Вы получите (999р - % )\n```\n\nВ поле email нужно передавать почту, указаную при получении ключей API\n",
        "operationId": "get-api-1-order-create",
        "tags": [
          "order"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "Order": {
                    "$ref": "#/components/schemas/OrderCreate"
                  },
                  "redirect": {
                    "$ref": "#/components/schemas/OrderRedirect"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "если true, выполнит и вернет статус \"order-confirm\"",
                    "default": false
                  },
                  "pay-info": {
                    "type": "boolean",
                    "description": "Если true, вернет результат метода \"order-pay-info\". Если confirm & pay-info == true, confirm выполнится, результат ответа будет order-pay-info",
                    "default": false
                  },
                  "validate": {
                    "type": "boolean",
                    "description": "Если предусмотрена верификация, вернет метод order-validate",
                    "default": false
                  },
                  "vkey": {
                    "type": "string",
                    "description": "Можно указать номер заявки в Вашей системе, будет приходить в callback"
                  }
                }
              },
              "examples": {
                "example-1": {
                  "value": {
                    "Order": {
                      "HTTP_USER_AGENT": "Mozilla/5.0 (Windows NT 10.1; Win32; x86) AppleWebKit/777.77 (KHTML, like Gecko) Chrome/777.0.7777.77 Safari/777.77",
                      "psid1": 12,
                      "psid2": 1,
                      "in": 0.001,
                      "out": 1,
                      "direct": 0,
                      "agreement": "yes",
                      "coupon_name": "9d6f5d27d",
                      "props": [
                        {
                          "name": "from_acc",
                          "value": "1111222233334444"
                        },
                        {
                          "name": "email",
                          "value": "market@112211111111.id"
                        },
                        {
                          "name": "to_acc",
                          "value": "345ASAqaKsbCeFMt1NUZj8wdsPV9vr222"
                        }
                      ]
                    },
                    "vkey": "external_id"
                  },
                  "summary": "example-1"
                },
                "example-2": {
                  "value": {
                    "Order": {
                      "ip": "string",
                      "HTTP_USER_AGENT": "string",
                      "psid1": 0,
                      "psid2": 0,
                      "in": 0,
                      "out": 0,
                      "direct": 0,
                      "agreement": "string",
                      "props": [
                        {
                          "name": "string",
                          "value": "string"
                        }
                      ]
                    },
                    "redirect": {
                      "success": "string",
                      "error": "string"
                    },
                    "confirm": false,
                    "pay-info": false,
                    "validate": false
                  },
                  "summary": "example-2"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/order-validate/": {
      "get": {
        "summary": "Проверить заявку",
        "deprecated": false,
        "description": "Проверка заявки на корректность введенных данных.\nВ ответе вы можете получить **status:link**, в данном случае нужно отправить клиента по ссылке или открыть ссылку в iframe (можно отловить событие при прохождении верификации и перейти на следующий шаг)\nЕсли вы отправили клиента по ссылке. то необходимо опрашивать /order-validate/ пока он не станет успешным.\nВнимание! не опрашивайте больше часа, иначе это будет бесконечно.",
        "operationId": "get-api-1-order-validate",
        "tags": [
          "order"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "description": "Номер заявки",
            "required": true,
            "example": "",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "x-examples": {
                    "example-1": {
                      "status": "success",
                      "value": {
                        "status": "success",
                        "msg": "Корректная заявка",
                        "field": null,
                        "Order": {}
                      }
                    }
                  },
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "msg": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "Order": {
                          "$ref": "#/components/schemas/Order"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "2": {
                    "summary": "success",
                    "value": {
                      "status": "success",
                      "value": {
                        "status": "success",
                        "msg": "Корректная заявка",
                        "field": "",
                        "Order": {}
                      }
                    }
                  },
                  "card": {
                    "summary": "link",
                    "value": {
                      "status": "success",
                      "value": {
                        "status": "link",
                        "src": "https://site.com/verificaiton?id=123",
                        "Order": {}
                      }
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/order-pay-info/": {
      "get": {
        "summary": "Информация для оплаты по заявке",
        "deprecated": false,
        "description": "Информация для оплаты по заявке",
        "operationId": "get-api-1-order-pay-info",
        "tags": [
          "order"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "description": "Номер заявки",
            "required": true,
            "example": "",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "$ref": "#/components/schemas/OrderPayInfo"
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/order-confirm/": {
      "get": {
        "summary": "Завершение создания заявки",
        "deprecated": false,
        "description": "Подтверждение оплаты и завершение оформления заявки",
        "operationId": "get-api-1-order-confirm",
        "tags": [
          "order"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "description": "Номер заявки",
            "required": true,
            "example": "",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "type": "object",
                      "properties": {
                        "Order": {
                          "$ref": "#/components/schemas/Order"
                        },
                        "Access": {
                          "$ref": "#/components/schemas/UserAccess"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/order-cancel/": {
      "get": {
        "summary": "Отмена оформления заявки",
        "deprecated": false,
        "description": "Отмена оформления заявки",
        "operationId": "get-api-1-order-cancel",
        "tags": [
          "order"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "description": "Номер заявки",
            "required": true,
            "example": "",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "type": "null"
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/order-get/": {
      "get": {
        "summary": "Получить заявку",
        "deprecated": false,
        "description": "Получить объект заявки",
        "operationId": "get-api-1-order-get",
        "tags": [
          "order"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "description": "Номер заявки",
            "required": true,
            "example": "",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/orders-get/": {
      "post": {
        "summary": "Получить заявки",
        "deprecated": false,
        "description": "Получить объекты заявок",
        "operationId": "get-api-1-orders-get",
        "tags": [
          "order"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "page": {
                    "type": "integer"
                  },
                  "limit": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "array",
                    "items": {}
                  },
                  "orders": {
                    "type": "array",
                    "items": {}
                  },
                  "updateAt": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      }
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/2/order-check/": {
      "post": {
        "summary": "order-check",
        "deprecated": false,
        "description": "Привязать чек к заявке",
        "operationId": "post-api-2-order-check",
        "tags": [
          "order"
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "description": "Номер заявки",
            "required": true,
            "example": "",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "file_id",
            "in": "query",
            "description": "File ID полученный через /file-upload/",
            "required": true,
            "example": "",
            "schema": {
              "type": "string",
              "format": "regex",
              "pattern": "^[a-f0-9]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/user-login/": {
      "get": {
        "summary": "user-login",
        "deprecated": false,
        "description": "Авторизация в системе",
        "operationId": "get-api-1-user-login",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "description": "",
            "required": true,
            "example": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "password",
            "in": "query",
            "description": "",
            "required": true,
            "example": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/UserSign",
            "description": "Example response"
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/user-register/": {
      "get": {
        "summary": "Новый пользователь",
        "deprecated": false,
        "description": "",
        "operationId": "get-api-1-user-register",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "description": "",
            "required": false,
            "example": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "password",
            "in": "query",
            "description": "",
            "required": false,
            "example": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "inviter",
            "in": "query",
            "description": "Идентификатор пригласителя",
            "required": false,
            "example": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/UserSign",
            "description": "Example response"
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/user-info/": {
      "get": {
        "summary": "Информация о пользователе",
        "deprecated": false,
        "description": "",
        "operationId": "get-api-1-user-info",
        "tags": [
          "user"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "$ref": "#/components/schemas/User"
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/1/user-change-password/": {
      "get": {
        "summary": "Сменить пароль",
        "deprecated": false,
        "description": "",
        "operationId": "get-api-1-user-change-password",
        "tags": [
          "user"
        ],
        "parameters": [
          {
            "name": "old_password",
            "in": "query",
            "description": "Старый пароль",
            "required": true,
            "example": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "new_password",
            "in": "query",
            "description": "Новый пароль",
            "required": true,
            "example": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "value": {
                      "$ref": "#/components/schemas/UserAccess"
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    },
    "/api/2/file-upload/": {
      "post": {
        "summary": "file-upload",
        "deprecated": false,
        "description": "",
        "operationId": "post-api-2-file-upload",
        "tags": [
          "File"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "example": ""
                  }
                }
              },
              "example": {
                "file": ""
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"status\":\"success\",\"value\":[\"16ba3f59de76e4f1813f2dfe577c5b71\"]}",
            "headers": {}
          }
        },
        "security": [
          {
            "akey": [],
            "skey": [],
            "bkey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Direction": {
        "title": "Direction",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "enabled": {
            "type": "integer"
          },
          "direct": {
            "type": "integer"
          },
          "psid1": {
            "type": "integer"
          },
          "psid2": {
            "type": "integer"
          },
          "in": {
            "type": "string"
          },
          "in_valute": {
            "type": "string"
          },
          "in_name": {
            "type": "string"
          },
          "in_min": {
            "type": "number"
          },
          "in_max": {
            "type": "number"
          },
          "out_min": {
            "type": "number"
          },
          "in_group": {
            "type": "string"
          },
          "out_group": {
            "type": "string"
          },
          "reserve": {
            "type": "string"
          }
        },
        "description": "",
        "x-examples": {
          "example-1": {
            "id": 1,
            "enabled": 1,
            "direct": 0,
            "psid1": 12,
            "psid2": 9,
            "in": "2",
            "in_valute": "BTC",
            "in_name": "Bitcoin",
            "out": "3302925.4",
            "out_valute": "RUR",
            "out_name": "QIWI RUB",
            "in_min": 0.001,
            "in_max": 100,
            "out_min": 0,
            "in_group": "crypto",
            "out_group": "ps",
            "reserve": "12917"
          }
        }
      },
      "Props": {
        "type": "array",
        "x-examples": {
          "example-1": [
            {
              "id": "14382421727721",
              "psid": 0,
              "tag": "input",
              "type": "text",
              "name": "email",
              "label": "Ваш E-mail ящик или Telegram",
              "placeholder": "lksr@protonmail.com",
              "value": null,
              "hidden": 0,
              "readonly": 0,
              "check_empty": 0
            },
            {
              "id": "16104510920592",
              "psid": 1,
              "tag": "input",
              "type": "text",
              "name": "to_acc",
              "label": "На кошелек",
              "placeholder": "Например: U50867651",
              "value": null,
              "hidden": 0,
              "readonly": 0,
              "check_empty": 0
            }
          ]
        },
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "psid": {
              "type": "integer"
            },
            "tag": {
              "type": "string"
            },
            "type": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "label": {
              "type": "string"
            },
            "placeholder": {
              "type": "string"
            },
            "value": {},
            "hidden": {
              "type": "integer"
            },
            "readonly": {
              "type": "integer"
            },
            "check_empty": {
              "type": "integer"
            }
          }
        }
      },
      "OrderRedirect": {
        "type": "object",
        "properties": {
          "success": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "x-examples": {
          "example-1": {
            "success": "https://your.site/success",
            "error": "https://your.site/error"
          }
        }
      },
      "OrderCreate": {
        "type": "object",
        "x-examples": {
          "example-1": {
            "ip": "123.213.21.12",
            "HTTP_USER_AGENT": "Mozilla/5.0 (Windows NT 10.3; Win32; x32) AppleWebKit/500.31 (KHTML, like Gecko) Chrome/1.0.1.67 Safari/500.31",
            "psid1": 12,
            "psid2": 1,
            "in": 1,
            "out": 10,
            "direct": 0,
            "agreement": "yes",
            "props": [
              {
                "name": "email",
                "value": "market@1211233111122.id"
              },
              {
                "name": "from_acc",
                "value": "5234567222223456"
              },
              {
                "name": "from_fio",
                "value": "Иванов Иван Иванович"
              },
              {
                "name": "to_acc",
                "value": "17kYrRDhvNy2Btn8ovnTYaLVeVuMm4jNOo"
              }
            ]
          }
        },
        "properties": {
          "ip": {
            "type": "string"
          },
          "HTTP_USER_AGENT": {
            "type": "string"
          },
          "psid1": {
            "type": "integer"
          },
          "psid2": {
            "type": "integer"
          },
          "in": {
            "type": "number"
          },
          "out": {
            "type": "number"
          },
          "direct": {
            "type": "integer"
          },
          "agreement": {
            "type": "string"
          },
          "props": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Order": {
        "type": "object",
        "x-examples": {
          "example-1": {
            "id": "f:0f:0b:08:e6:0a:37",
            "created": "2022-05-31 17:20:35",
            "updateAt": "2022-05-31 17:20:35",
            "expired": "2022-05-31 17:35:35",
            "psid1": 12,
            "psid2": 1,
            "in": 0.01,
            "out": 299.42,
            "direct": 0,
            "agreement": null,
            "props": [
              {
                "id": "14382421727721",
                "psid": 0,
                "tag": "input",
                "type": "text",
                "name": "email",
                "label": "Ваш E-mail ящик или Telegram",
                "placeholder": "1vw4l@protonmail.com",
                "value": "test@protonmail.com",
                "hidden": 0,
                "readonly": 0,
                "check_empty": 0
              },
              {
                "id": "16104510920592",
                "psid": 1,
                "tag": "input",
                "type": "text",
                "name": "to_acc",
                "label": "На кошелек",
                "placeholder": "Например: U85153664",
                "value": "U12312312",
                "hidden": 0,
                "readonly": 0,
                "check_empty": 0
              }
            ],
            "status": "preliminary",
            "status_title": "Ожидание поступления средств",
            "reason": null,
            "extra": [
              {
                "blockchain_url": "https://www.blockchain.com/btc/address/1DnsNV3zhzZz3K1XadrE23Yb1b84EFH1d2"
              },
              []
            ],
            "vkey": false,
            "rate": [
              1,
              29942
            ],
            "email": "test@protonmail.com",
            "bonus_bestchange_review": {
              "amount": 198,
              "status": false
            },
            "bonus_order_review": {
              "amount": "10",
              "status": false
            },
            "bestchange_src": "http://www.bestchange.ru/"
          }
        },
        "properties": {
          "id": {
            "type": "string"
          },
          "created": {
            "type": "string"
          },
          "updateAt": {
            "type": "string"
          },
          "expired": {
            "type": "string"
          },
          "psid1": {
            "type": "integer"
          },
          "psid2": {
            "type": "integer"
          },
          "in": {
            "type": "number"
          },
          "out": {
            "type": "number"
          },
          "direct": {
            "type": "integer"
          },
          "agreement": {
            "type": "null"
          },
          "props": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "psid": {
                  "type": "integer"
                },
                "tag": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "placeholder": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "hidden": {
                  "type": "integer"
                },
                "readonly": {
                  "type": "integer"
                },
                "check_empty": {
                  "type": "integer"
                }
              }
            }
          },
          "status": {
            "$ref": "#/components/schemas/OrderLocation"
          },
          "status_title": {
            "type": "string"
          },
          "reason": {
            "type": "null"
          },
          "extra": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "blockchain_url": {
                  "type": "string"
                }
              }
            }
          },
          "vkey": {
            "type": "boolean"
          },
          "rate": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "email": {
            "type": "string"
          },
          "bonus_bestchange_review": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer"
              },
              "status": {
                "type": "boolean"
              }
            }
          },
          "bonus_order_review": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string"
              },
              "status": {
                "type": "boolean"
              }
            }
          },
          "bestchange_src": {
            "type": "string"
          }
        }
      },
      "OrderPayInfo": {
        "type": "object",
        "x-examples": {
          "example-1": {
            "info": [
              {
                "title": "Откройте клиент-Bitcoin и сделайте перевод по реквизитам",
                "value": "1nsNV3zhzZz3KhXadrE45Yb1b84EFH1d5",
                "extra": "Кошелек",
                "psid": 12,
                "qr": "<img src=\"data:image/png;base64,\"/>"
              },
              {
                "title": "На сумму",
                "value": 0.01,
                "extra": "BTC",
                "psid": 12
              },
              {
                "title": "Кошелек, куда Вы получаете",
                "value": "U12312312",
                "extra": "Кошелек",
                "psid": 1
              },
              {
                "title": "Сумма зачисления",
                "value": 299.42,
                "extra": "USD",
                "psid": 1
              }
            ],
            "alert": "<ul><li>some alert</li></ul>",
            "SCI": {
              "status": 0,
              "link": null,
              "html": null
            },
            "extra": "<div>some text</div>",
            "redirect": 0,
            "order_id": "f:0f:0b:08:e6:0a:37",
            "pd": [
              {
                "title": "Кошелек",
                "alias": "account",
                "value": "1nsNV3zhzZz3KhXadrE45Yb1b84EFH1d5"
              }
            ]
          }
        },
        "properties": {
          "info": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "extra": {
                  "type": "string"
                },
                "psid": {
                  "type": "integer"
                },
                "qr": {
                  "type": "string"
                }
              }
            }
          },
          "alert": {
            "type": "string"
          },
          "SCI": {
            "type": "object",
            "properties": {
              "status": {
                "type": "integer"
              },
              "link": {},
              "html": {}
            }
          },
          "extra": {
            "type": "string"
          },
          "redirect": {
            "type": "integer"
          },
          "order_id": {
            "type": "string"
          },
          "pd": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "alias": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "discount": {
            "type": "integer"
          },
          "percentage": {
            "type": "number"
          },
          "exchange_amount": {
            "type": "string"
          },
          "verification": {
            "type": "string"
          },
          "email_confirmed": {
            "type": "boolean"
          },
          "account_type": {
            "type": "string"
          },
          "bonus": {
            "type": "integer"
          }
        },
        "x-examples": {
          "example-1": {
            "id": "16540731756427",
            "created": "2022-06-01 11:46:15",
            "email": "test@protonmail.com",
            "discount": 2,
            "percentage": 0.6,
            "exchange_amount": "0",
            "verification": "fatal",
            "email_confirmed": false,
            "account_type": "Individual",
            "bonus": 0
          }
        }
      },
      "UserAccess": {
        "type": "object",
        "x-examples": {
          "example-1": {
            "akey": null,
            "skey": "4105316657947165767079513146"
          }
        },
        "properties": {
          "akey": {
            "type": "string"
          },
          "skey": {
            "type": "string"
          }
        }
      },
      "OrderLocation": {
        "x-examples": {
          "example-1": "new"
        },
        "oneOf": [
          {
            "default": "preliminary",
            "description": "Предварительная"
          },
          {
            "default": "frozen",
            "description": "Ожидает оплаты"
          },
          {
            "properties": {},
            "default": "new",
            "description": "Проверка оплаты",
            "type": "object"
          },
          {
            "properties": {},
            "default": "deleted",
            "description": "Удалена",
            "type": "object"
          },
          {
            "properties": {},
            "default": "error",
            "description": "Содержит ошибки",
            "type": "object"
          },
          {
            "properties": {},
            "default": "completed",
            "description": "Обработана (финальный статус)",
            "type": "object"
          }
        ],
        "type": "string"
      },
      "PaymentSystem": {
        "type": "object",
        "properties": {
          "psid": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "valute": {
            "type": "string"
          },
          "reserve": {
            "type": "integer"
          },
          "with_codes": {
            "type": "integer"
          },
          "group": {
            "type": "string"
          },
          "payin": {
            "type": "integer"
          },
          "payout": {
            "type": "integer"
          }
        },
        "x-examples": {
          "example-1": {
            "psid": 324,
            "name": "BBTC ERC20",
            "valute": "BTC",
            "reserve": 0,
            "with_codes": 0,
            "group": "crypto",
            "payin": 0,
            "payout": 0
          }
        }
      }
    },
    "responses": {
      "PaymentSystem": {
        "description": "Example response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "value": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PaymentSystem"
                  }
                }
              }
            }
          }
        }
      },
      "Directions": {
        "description": "Example response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "value": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Direction"
                  }
                }
              }
            }
          }
        }
      },
      "UserSign": {
        "description": "Example response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "value": {
                  "type": "object",
                  "properties": {
                    "User": {
                      "$ref": "#/components/schemas/User"
                    },
                    "Access": {
                      "$ref": "#/components/schemas/UserAccess"
                    }
                  }
                }
              }
            },
            "examples": {
              "security-telegram": {
                "summary": "security-telegram",
                "value": {
                  "status": "string",
                  "value": {
                    "security": {
                      "template": "fields",
                      "data": {
                        "error": {
                          "status": "error",
                          "msg": "Введите проверочный код:",
                          "field": "telegram"
                        },
                        "action_id": "login",
                        "login": "test@protonmail.com",
                        "props": {
                          "telegram": {
                            "provider": "telegram",
                            "enabled": true,
                            "sendCode": true,
                            "code_expires_in": null,
                            "label": "Проверочный код Telegram:",
                            "placeholder": "Telegram Код",
                            "name": "login_telegram",
                            "_name": "Telegram",
                            "value": ""
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "akey": {
        "name": "akey",
        "type": "apiKey",
        "in": "query",
        "description": "API key"
      },
      "skey": {
        "name": "skey",
        "type": "apiKey",
        "in": "query"
      },
      "bkey": {
        "name": "bkey",
        "type": "apiKey",
        "in": "query",
        "description": ""
      }
    }
  },
  "servers": [],
  "security": [
    {
      "akey": [],
      "skey": [],
      "bkey": []
    }
  ]
}