{
  "openapi": "3.0.3",
  "info": {
    "title": "Client REST API",
    "version": "1.0.0",
    "description": "Generated Swagger/OpenAPI description for the client REST API documentation section."
  },
  "servers": [
    {
      "url": "https://{broker_domain}",
      "variables": {
        "broker_domain": {
          "default": "example.com",
          "description": "Broker or deployment domain."
        }
      }
    }
  ],
  "tags": [
    {
      "name": "account"
    },
    {
      "name": "alert"
    },
    {
      "name": "auth"
    },
    {
      "name": "cashier"
    },
    {
      "name": "copytrade"
    },
    {
      "name": "customer"
    },
    {
      "name": "kyc"
    },
    {
      "name": "market"
    },
    {
      "name": "notify"
    },
    {
      "name": "prop"
    },
    {
      "name": "script"
    },
    {
      "name": "settings"
    },
    {
      "name": "stats"
    },
    {
      "name": "trade"
    }
  ],
  "paths": {
    "/account/me": {
      "get": {
        "tags": [
          "account"
        ],
        "summary": "Get Account Profile",
        "description": "Returns profile and margin information for the currently authenticated account.",
        "operationId": "get_account_me",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "id": 1001,
                  "login": 1001,
                  "currency": "USD",
                  "group": "STD-1",
                  "comment": "VIP account",
                  "enable": 1,
                  "enable_read_only": 0,
                  "enable_change_password": 1,
                  "leverage": 100,
                  "avatar": "",
                  "email": "user@example.com",
                  "name": "John Doe",
                  "phone": "+35700000000",
                  "address": "Street 1",
                  "city": "Limassol",
                  "country": "CY",
                  "zipcode": "3010",
                  "regdate": 1713000000,
                  "prevbalance": 1200.5,
                  "prevmonthbalance": 1100.0,
                  "balance": 1500.0,
                  "storage": -12.5,
                  "commission": -3.2,
                  "credit": 0.0,
                  "margin": 250.0,
                  "margin_free": 1250.0,
                  "margin_level": 600.0,
                  "equity": 1484.3
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "account/GetAccountMe.md"
      },
      "put": {
        "tags": [
          "account"
        ],
        "summary": "Update Account Profile",
        "description": "Updates non-trading profile fields for an account.",
        "operationId": "put_account_me",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "integer",
                    "description": "Account login. Optional for SESSION_USER; recommended for SESSION_CUSTOMER with multiple accounts"
                  },
                  "name": {
                    "type": "string",
                    "description": "Account display name. Max length 128"
                  },
                  "avatar": {
                    "type": "string",
                    "description": "Public account avatar reference returned by POST /upload with purpose=account_avatar, for example {uuid}. Legacy generated avatars can use {uuid}.svg. Max length 4096"
                  },
                  "phone": {
                    "type": "string",
                    "description": "Phone number. Max length 64"
                  },
                  "address": {
                    "type": "string",
                    "description": "Address. Max length 256"
                  },
                  "city": {
                    "type": "string",
                    "description": "City. Max length 128"
                  },
                  "state": {
                    "type": "string",
                    "description": "State or region. Max length 128"
                  },
                  "country": {
                    "type": "string",
                    "description": "Country. Max length 128"
                  },
                  "zipcode": {
                    "type": "string",
                    "description": "ZIP or postal code. Max length 32"
                  },
                  "user_color": {
                    "type": "string",
                    "description": "User color marker. Max length 32"
                  }
                }
              },
              "example": {
                "login": 1001,
                "name": "John Doe",
                "avatar": "8e68414e-0e3f-48dd-b7b8-f5be9e26d4f7",
                "phone": "+35700000000",
                "city": "Limassol",
                "country": "CY"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "login": 1001,
                  "avatar": "8e68414e-0e3f-48dd-b7b8-f5be9e26d4f7",
                  "name": "John Doe",
                  "phone": "+35700000000",
                  "address": "Street 1",
                  "city": "Limassol",
                  "state": "",
                  "country": "CY",
                  "zipcode": "3010",
                  "user_color": "#ffffff",
                  "update_time": 1777564800
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Account was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "account/UpdateAccountProfile.md"
      }
    },
    "/balance/me": {
      "get": {
        "tags": [
          "account"
        ],
        "summary": "Get Balance Snapshot",
        "description": "Returns balance and margin snapshot for an account login.",
        "operationId": "get_balance_me",
        "parameters": [
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Account login"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "balance": 1500.0,
                  "credit": 0.0,
                  "profit": 12.3,
                  "commission": -3.2,
                  "storage": -12.5,
                  "margin": 250.0,
                  "margin_free": 1250.0,
                  "margin_level": 600.0,
                  "equity": 1496.6,
                  "level_type": 0,
                  "leverage": 100
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "account/GetBalanceMe.md"
      }
    },
    "/upload": {
      "post": {
        "tags": [
          "account"
        ],
        "summary": "Upload Account Avatar",
        "description": "Uploads an account avatar image through the common upload flow and stores it as",
        "operationId": "post_upload",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "purpose": {
                    "type": "string",
                    "description": "Must be account_avatar"
                  },
                  "file": {
                    "type": "string",
                    "description": "Avatar image file. Allowed extensions: png, jpg, jpeg, webp, gif"
                  }
                },
                "required": [
                  "purpose",
                  "file"
                ]
              },
              "example": {
                "uploaded": [
                  {
                    "uuid": "8e68414e-0e3f-48dd-b7b8-f5be9e26d4f7",
                    "file_name": "8e68414e-0e3f-48dd-b7b8-f5be9e26d4f7.png",
                    "original_name": "avatar.png",
                    "content_type": "image/png",
                    "file_size": 18425,
                    "scope": 3,
                    "purpose": "account_avatar"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "avatar": "8e68414e-0e3f-48dd-b7b8-f5be9e26d4f7"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "account/UploadAccountAvatar.md"
      }
    },
    "/price_alert": {
      "post": {
        "tags": [
          "alert"
        ],
        "summary": "Create Price Alert",
        "description": "Creates a new price alert for the current user.",
        "operationId": "post_price_alert",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "integer",
                    "description": "Trading account login linked to the authenticated customer"
                  },
                  "symbol": {
                    "type": "string",
                    "description": "Alert symbol"
                  },
                  "indicator_name": {
                    "type": "string",
                    "description": "Display name / source label"
                  },
                  "message": {
                    "type": "string",
                    "description": "Custom message shown on trigger"
                  },
                  "side": {
                    "type": "integer",
                    "description": "Price source: 0=Bid, 1=Ask"
                  },
                  "condition": {
                    "type": "integer",
                    "description": "Trigger type"
                  },
                  "target_price": {
                    "type": "number",
                    "description": "Required only for level/crossing conditions"
                  },
                  "channel_low": {
                    "type": "number",
                    "description": "Lower bound for channel conditions"
                  },
                  "channel_high": {
                    "type": "number",
                    "description": "Upper bound for channel conditions"
                  },
                  "move_threshold": {
                    "type": "number",
                    "description": "Threshold for moving conditions"
                  },
                  "repeat_mode": {
                    "type": "integer",
                    "description": "0=once, 1=repeat"
                  },
                  "expires_at": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Expiration timestamp, 0 = no expiration"
                  },
                  "reference_price": {
                    "type": "number",
                    "description": "Reference price for moving conditions"
                  },
                  "reference_time": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Reference price timestamp"
                  },
                  "comment": {
                    "type": "string",
                    "description": "Internal comment"
                  }
                },
                "required": [
                  "symbol",
                  "side",
                  "condition",
                  "repeat_mode"
                ]
              },
              "example": {
                "structure": [
                  "id"
                ],
                "rows": [
                  [
                    101
                  ]
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "login": 100020,
                  "symbol": "EURUSD",
                  "indicator_name": "Price Alert",
                  "message": "EUR breakout",
                  "side": 0,
                  "condition": 12,
                  "target_price": 1.1,
                  "channel_low": 0,
                  "channel_high": 0,
                  "move_threshold": 0,
                  "repeat_mode": 0,
                  "expires_at": 0,
                  "reference_price": 1.095,
                  "reference_time": 1775400000,
                  "comment": "My alert"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "alert/AddAlert.md"
      },
      "put": {
        "tags": [
          "alert"
        ],
        "summary": "Update Price Alert",
        "description": "Updates an existing price alert for the current user.",
        "operationId": "put_price_alert",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "integer",
                    "description": "Trading account login linked to the authenticated customer"
                  },
                  "id": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Alert identifier"
                  },
                  "status": {
                    "type": "integer",
                    "description": "New alert status"
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "structure": [
                  "id"
                ],
                "rows": [
                  [
                    101
                  ]
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "id"
                  ],
                  "rows": [
                    [
                      101
                    ]
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Alert not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "alert/UpdateAlert.md"
      }
    },
    "/price_alert/{id}": {
      "delete": {
        "tags": [
          "alert"
        ],
        "summary": "Delete Price Alert",
        "description": "Deletes an existing price alert for the current user.",
        "operationId": "delete_price_alert_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "id"
                  ],
                  "rows": [
                    [
                      101
                    ]
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Alert not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "alert/DeleteAlert.md"
      }
    },
    "/price_alert/log/{id}": {
      "delete": {
        "tags": [
          "alert"
        ],
        "summary": "Delete Price Alert Log",
        "description": "Deletes one trigger log entry for the current user.",
        "operationId": "delete_price_alert_log_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "data": "OK"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Log record not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "alert/DeletePriceAlertLog.md"
      }
    },
    "/price_alert/logs/clear": {
      "delete": {
        "tags": [
          "alert"
        ],
        "summary": "Delete All Price Alert Logs",
        "description": "Deletes all trigger log entries for the current user.",
        "operationId": "delete_price_alert_logs_clear",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "data": "OK"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "alert/DeletePriceAlertLogs.md"
      }
    },
    "/price_alert/list": {
      "get": {
        "tags": [
          "alert"
        ],
        "summary": "Get Price Alerts",
        "description": "Returns the current user's price alerts.",
        "operationId": "get_price_alert_list",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "id",
                    "login",
                    "symbol",
                    "indicator_name",
                    "message",
                    "side",
                    "condition",
                    "target_price",
                    "channel_low",
                    "channel_high",
                    "move_threshold",
                    "status",
                    "repeat_mode",
                    "created_at",
                    "updated_at",
                    "expires_at",
                    "triggered_at",
                    "triggered_price",
                    "reference_price",
                    "reference_time",
                    "comment"
                  ],
                  "rows": [
                    [
                      101,
                      100020,
                      "EURUSD",
                      "Price Alert",
                      "EUR breakout",
                      0,
                      0,
                      1.1,
                      0,
                      0,
                      0,
                      0,
                      0,
                      1775400000,
                      1775400000,
                      0,
                      0,
                      0,
                      1.095,
                      1775400000,
                      "My alert"
                    ]
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "alert/GetAlertsByLogin.md"
      }
    },
    "/price_alert/logs": {
      "get": {
        "tags": [
          "alert"
        ],
        "summary": "Get Price Alert Logs",
        "description": "Returns the current user's trigger history for price alerts.",
        "operationId": "get_price_alert_logs",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "id",
                    "alert_id",
                    "login",
                    "symbol",
                    "indicator_name",
                    "message",
                    "side",
                    "condition",
                    "target_price",
                    "triggered_price",
                    "triggered_at",
                    "comment"
                  ],
                  "rows": [
                    [
                      1,
                      101,
                      100020,
                      "EURUSD",
                      "Price Alert",
                      "EUR breakout",
                      0,
                      12,
                      1.1,
                      1.1002,
                      1775401000,
                      "My alert"
                    ]
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "alert/GetPriceAlertLogs.md"
      }
    },
    "/sign/in": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Sign In",
        "description": "Authenticates a user account and returns profile fields plus JWT token in __token.",
        "operationId": "post_sign_in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "integer",
                    "description": "Account login ID"
                  },
                  "password": {
                    "type": "string",
                    "description": "Account password"
                  }
                },
                "required": [
                  "login",
                  "password"
                ]
              },
              "example": {
                "login": 100001,
                "password": "your-strong-password"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "error": "INVALID_DATA",
                  "message": "password must be at least 6 characters"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "402": {
            "description": "User exists but is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Account group is missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "auth/signin.md"
      }
    },
    "/password": {
      "put": {
        "tags": [
          "auth"
        ],
        "summary": "Update Account Password",
        "description": "Updates an existing user's password.",
        "operationId": "put_password",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "integer",
                    "description": "User account login"
                  },
                  "password": {
                    "type": "string",
                    "description": "New account password"
                  }
                },
                "required": [
                  "login",
                  "password"
                ]
              },
              "example": {
                "login": 100001,
                "password": "new-strong-password"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "error": "UPDATE_PASSWORD_ERROR",
                  "message": "<formatted internal error>"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "auth/update-account-password.md"
      }
    },
    "/cashier/deposit": {
      "post": {
        "tags": [
          "cashier"
        ],
        "summary": "<span class=\"post badge\">POST</span> Create Cashier Deposit",
        "description": "CreateCashierDeposit",
        "operationId": "post_cashier_deposit",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "transaction": {
                    "id": 15,
                    "customer_id": 5,
                    "login": 2000009,
                    "type": 0,
                    "provider": "stripe",
                    "method": "card",
                    "provider_payment_id": "pi_123",
                    "amount": 250.0,
                    "currency": "USD",
                    "account_currency": "USD",
                    "converted_amount": 250.0,
                    "conversion_rate": 1.0,
                    "status": 1,
                    "failure_reason": "",
                    "idempotency_key": "0f9bb0e7-642d-4b70-b458-62e3993c7d2d",
                    "comment": "",
                    "metadata_json": "{}",
                    "created_time": 1779270000,
                    "updated_time": 1779270000
                  },
                  "payment": {
                    "provider_payment_id": "pi_123",
                    "redirect_url": "https://provider.example/pay/pi_123",
                    "instructions_json": "{}",
                    "raw_response_json": "{}",
                    "status": 1,
                    "failure_reason": ""
                  },
                  "next_action": "REDIRECT"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Customer record was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Duplicate idempotency_key for the same customer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "cashier/CreateCashierDeposit.md"
      }
    },
    "/cashier/withdrawal": {
      "post": {
        "tags": [
          "cashier"
        ],
        "summary": "<span class=\"post badge\">POST</span> Create Cashier Withdrawal",
        "description": "CreateCashierWithdrawal",
        "operationId": "post_cashier_withdrawal",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "integer",
                    "description": "Trading account login owned by the authenticated customer"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Positive withdrawal amount"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Must match account currency"
                  },
                  "idempotency_key": {
                    "type": "string",
                    "description": "Customer-scoped idempotency key"
                  },
                  "comment": {
                    "type": "string",
                    "description": "Customer comment"
                  },
                  "metadata_json": {
                    "type": "string",
                    "description": "Additional metadata JSON string"
                  }
                },
                "required": [
                  "login",
                  "amount",
                  "currency"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "cashier/CreateCashierWithdrawal.md"
      }
    },
    "/cashier/methods": {
      "get": {
        "tags": [
          "cashier"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Cashier Methods",
        "description": "GetCashierMethods",
        "operationId": "get_cashier_methods",
        "parameters": [
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Query parameter from documented endpoint URL."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "rows": [
                    {
                      "provider_config_id": 1,
                      "provider": "stripe",
                      "method": "card",
                      "brand": "ion4",
                      "currency": "USD",
                      "country": "",
                      "payment_mode": "redirect",
                      "display_name": "Stripe",
                      "description": "Card payments",
                      "min_amount": 10.0,
                      "max_amount": 5000.0,
                      "sandbox": 0,
                      "sort_index": 100,
                      "override_id": 0,
                      "override_mode": 0
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Customer record was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "cashier/GetCashierMethods.md"
      }
    },
    "/cashier/transactions": {
      "get": {
        "tags": [
          "cashier"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Cashier Transactions",
        "description": "GetCashierTransactions",
        "operationId": "get_cashier_transactions",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page size. Defaults to 100"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Pagination offset. Defaults to 0"
          },
          {
            "name": "login",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Trading account login owned by the authenticated customer"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "AND filters"
          },
          {
            "name": "whereNot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Negative filters"
          },
          {
            "name": "whereIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Include-by-list filters"
          },
          {
            "name": "whereNotIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Exclude-by-list filters"
          },
          {
            "name": "whereBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Range filters"
          },
          {
            "name": "whereNotBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Negative range filters"
          },
          {
            "name": "orderBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Sort expression"
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": ""
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": ""
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": ""
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": ""
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": ""
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "method",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "currency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "provider_payment_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "approved_time",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": ""
          },
          {
            "name": "processed_time",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": ""
          },
          {
            "name": "created_time",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "description": ""
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "rows": [
                    {
                      "id": 15,
                      "customer_id": 5,
                      "login": 2000009,
                      "type": 0,
                      "provider": "stripe",
                      "method": "card",
                      "provider_payment_id": "pi_123",
                      "amount": 250.0,
                      "currency": "USD",
                      "account_currency": "USD",
                      "converted_amount": 250.0,
                      "conversion_rate": 1.0,
                      "status": 1,
                      "failure_reason": "",
                      "idempotency_key": "0f9bb0e7-642d-4b70-b458-62e3993c7d2d",
                      "comment": "",
                      "metadata_json": "{}",
                      "source": 0,
                      "approved_by": 0,
                      "approved_time": 0,
                      "processed_by": 0,
                      "processed_time": 0,
                      "reject_reason": "",
                      "created_time": 1779270000,
                      "updated_time": 1779270000
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "cashier/GetCashierTransactions.md"
      }
    },
    "/cashier/webhook/{provider}": {
      "post": {
        "tags": [
          "cashier"
        ],
        "summary": "<span class=\"post badge\">POST</span> Process Cashier Webhook",
        "description": "ProcessCashierWebhook",
        "operationId": "post_cashier_webhook_provider",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "event": {
                    "id": 21,
                    "provider": "praxis",
                    "event_id": "evt_123",
                    "transaction_id": 15,
                    "provider_payment_id": "px-15-1779270000",
                    "payload_json": "{\"event_id\":\"evt_123\",\"status\":\"approved\"}",
                    "headers_json": "{\"X-Signature\":\"...\"}",
                    "signature_status": 1,
                    "processing_status": 1,
                    "failure_reason": "",
                    "created_time": 1779270100,
                    "processed_time": 1779270100
                  },
                  "transaction": {
                    "id": 15,
                    "status": 3,
                    "provider_payment_id": "px-15-1779270000"
                  },
                  "data": "OK",
                  "duplicate": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "cashier/ProcessCashierWebhook.md"
      }
    },
    "/copytrade/follower": {
      "post": {
        "tags": [
          "copytrade"
        ],
        "summary": "CreateCopyTradeFollower",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "post_copytrade_follower",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "login": 100002,
                  "enabled": 1,
                  "manual_trading_mode": 1,
                  "max_master_count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "copytrade/CreateCopyTradeFollower.md"
      }
    },
    "/copytrade/master": {
      "post": {
        "tags": [
          "copytrade"
        ],
        "summary": "CreateCopyTradeMaster",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "post_copytrade_master",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "login": 100001,
                  "enabled": 1,
                  "strategy_name": "Conservative FX",
                  "description": "Low risk major pairs strategy",
                  "visibility": "public",
                  "allowed_follower_modes": 2,
                  "show_trade_history": 1,
                  "show_followers": 1,
                  "reward_policy": {
                    "reward_type": 1,
                    "billing_period": "monthly",
                    "fee_percent": 20,
                    "hwm_enabled": 1
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "copytrade/CreateCopyTradeMaster.md"
      }
    },
    "/copytrade/subscription": {
      "post": {
        "tags": [
          "copytrade"
        ],
        "summary": "CreateCopyTradeSubscription",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "post_copytrade_subscription",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "master_login": 100001,
                  "follower_login": 100002,
                  "enabled": 1,
                  "status": 0,
                  "copy_mode": 0,
                  "volume_mode": 1,
                  "risk_multiplier": 1,
                  "fixed_volume": 0,
                  "copy_sl": 1,
                  "copy_tp": 1,
                  "copy_partial_close": 1,
                  "copy_pending_orders": 0,
                  "copy_existing_positions": 0,
                  "reverse_direction": 0,
                  "max_volume": 0,
                  "min_volume": 0,
                  "max_positions": 0,
                  "symbols_mode": 0,
                  "symbols": ""
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "copytrade/CreateCopyTradeSubscription.md"
      }
    },
    "/copytrade/follower/{id}": {
      "delete": {
        "tags": [
          "copytrade"
        ],
        "summary": "DeleteCopyTradeFollower",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "delete_copytrade_follower_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Follower was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "copytrade/DeleteCopyTradeFollower.md"
      },
      "put": {
        "tags": [
          "copytrade"
        ],
        "summary": "UpdateCopyTradeFollower",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "put_copytrade_follower_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "enabled": 1,
                  "manual_trading_mode": 1,
                  "max_master_count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Follower was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "copytrade/UpdateCopyTradeFollower.md"
      }
    },
    "/copytrade/master/{id}": {
      "delete": {
        "tags": [
          "copytrade"
        ],
        "summary": "DeleteCopyTradeMaster",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "delete_copytrade_master_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Master was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "copytrade/DeleteCopyTradeMaster.md"
      },
      "put": {
        "tags": [
          "copytrade"
        ],
        "summary": "UpdateCopyTradeMaster",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "put_copytrade_master_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "strategy_name": "Conservative FX v2",
                  "enabled": 1,
                  "visibility": "public",
                  "allowed_follower_modes": 0,
                  "show_trade_history": 1,
                  "show_followers": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Master was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "copytrade/UpdateCopyTradeMaster.md"
      }
    },
    "/copytrade/subscription/{id}": {
      "delete": {
        "tags": [
          "copytrade"
        ],
        "summary": "DeleteCopyTradeSubscription",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "delete_copytrade_subscription_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "deleted": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Subscription was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "copytrade/DeleteCopyTradeSubscription.md"
      },
      "put": {
        "tags": [
          "copytrade"
        ],
        "summary": "UpdateCopyTradeSubscription",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "put_copytrade_subscription_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "enabled": 1,
                  "status": 0,
                  "risk_multiplier": 0.5,
                  "copy_sl": 1,
                  "copy_tp": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Subscription was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "copytrade/UpdateCopyTradeSubscription.md"
      }
    },
    "/copytrade/trade-links": {
      "get": {
        "tags": [
          "copytrade"
        ],
        "summary": "GetCopyTradeLinks",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "get_copytrade_trade_links",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "id",
                    "subscription_id",
                    "master_login",
                    "follower_login",
                    "master_order",
                    "follower_order",
                    "symbol",
                    "cmd",
                    "volume",
                    "state",
                    "created_time",
                    "updated_time"
                  ],
                  "rows": [
                    [
                      1,
                      10,
                      100001,
                      100002,
                      50001,
                      60001,
                      "EURUSD",
                      0,
                      10000,
                      0,
                      1778160000,
                      1778160000
                    ]
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "copytrade/GetCopyTradeLinks.md"
      }
    },
    "/copytrade/master/followers": {
      "get": {
        "tags": [
          "copytrade"
        ],
        "summary": "GetCopyTradeMasterFollowersByFilter",
        "description": "Requires an authenticated session. The endpoint is public for authorized users,",
        "operationId": "get_copytrade_master_followers",
        "parameters": [
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Copy master account login"
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Page size. Maximum 50000"
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Page offset"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard where filters"
          },
          {
            "name": "whereNot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard negative filters"
          },
          {
            "name": "whereIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard include-by-list filters"
          },
          {
            "name": "whereNotIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard exclude-by-list filters"
          },
          {
            "name": "whereBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard range filters"
          },
          {
            "name": "whereNotBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard negative range filters"
          },
          {
            "name": "orderBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Sort definition"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "subscription_id",
                    "master_login",
                    "follower_login",
                    "follower_email",
                    "subscribed_time",
                    "status",
                    "enabled",
                    "copied_trades",
                    "pnl",
                    "volume"
                  ],
                  "rows": [
                    [
                      501,
                      100001,
                      200045,
                      "jo***@example.com",
                      1778160000,
                      0,
                      1,
                      14,
                      245.75,
                      1400
                    ]
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "login is not a copy trading master",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "copytrade/GetCopyTradeMasterFollowersByFilter.md"
      }
    },
    "/copytrade/master/stats": {
      "get": {
        "tags": [
          "copytrade"
        ],
        "summary": "GetCopyTradeMasterStats",
        "description": "Requires an authenticated customer, manager, dealer, or CRM session.",
        "operationId": "get_copytrade_master_stats",
        "parameters": [
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Copy master account login"
          },
          {
            "name": "period",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Statistics period. Allowed values: 7D, 30D, 90D, 365D"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "login": 100001,
                  "period": "30D",
                  "currency": "USD",
                  "pnl": 1250.75,
                  "roi": 18.42,
                  "equity_start": 10000,
                  "equity_end": 11250.75,
                  "trades": 42,
                  "profit_trades": 28,
                  "loss_trades": 14,
                  "win_rate": 66.67,
                  "avg_pnl_per_trade": 29.78,
                  "max_drawdown": 8.15,
                  "followers": 12,
                  "weekly_trades": 7,
                  "avg_holding_time": 3600,
                  "last_trade_time": 1777564800,
                  "sharp_ratio": 0.3,
                  "sortino_ratio": 0.2,
                  "profit_per_symbol": [
                    {
                      "symbol": "EURUSD",
                      "profit": 820.5,
                      "orders": 12,
                      "volume": 1500
                    },
                    {
                      "symbol": "XAUUSD",
                      "profit": -120.25,
                      "orders": 4,
                      "volume": 300
                    }
                  ],
                  "pnl_history": [
                    {
                      "time": 1777564800,
                      "pnl": 0,
                      "roi": 0
                    },
                    {
                      "time": 1777651200,
                      "pnl": 150.25,
                      "roi": 1.5
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "login is not a copy trading master",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "copytrade/GetCopyTradeMasterStats.md"
      }
    },
    "/copytrade/master/trades": {
      "get": {
        "tags": [
          "copytrade"
        ],
        "summary": "GetCopyTradeMasterTradesByFilter",
        "description": "Requires an authenticated session. The endpoint is public for authorized users,",
        "operationId": "get_copytrade_master_trades",
        "parameters": [
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Copy master account login"
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Page size. Maximum 50000"
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Page offset"
          },
          {
            "name": "tradeType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "0 all trading records, 1 open trades, 2 closed trades, 3 pending trades, 4 finance trades. Finance records are still excluded by this endpoint"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard where filters"
          },
          {
            "name": "whereNot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard negative filters"
          },
          {
            "name": "whereIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard include-by-list filters"
          },
          {
            "name": "whereNotIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard exclude-by-list filters"
          },
          {
            "name": "whereBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard range filters"
          },
          {
            "name": "whereNotBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard negative range filters"
          },
          {
            "name": "orderBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Sort definition"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "order",
                    "login",
                    "cmd",
                    "state",
                    "symbol",
                    "reason",
                    "volume",
                    "open_time",
                    "close_time",
                    "open_price",
                    "close_price",
                    "sl",
                    "tp",
                    "profit",
                    "net_profit",
                    "commission",
                    "storage",
                    "digits",
                    "expiration"
                  ],
                  "rows": [
                    [
                      345001,
                      100001,
                      0,
                      3,
                      "EURUSD",
                      0,
                      100,
                      1778160000,
                      1778246400,
                      1.0845,
                      1.0912,
                      1.078,
                      1.092,
                      67.0,
                      61.5,
                      -3.5,
                      -2.0,
                      5,
                      0
                    ]
                  ],
                  "count": 1,
                  "total_profit": 67.0,
                  "total_net_profit": 61.5,
                  "total_storage": -2.0,
                  "total_commission": -3.5,
                  "total_volume": 100
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "login is not a copy trading master",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "copytrade/GetCopyTradeMasterTradesByFilter.md"
      }
    },
    "/copytrade/masters": {
      "get": {
        "tags": [
          "copytrade"
        ],
        "summary": "GetCopyTradeMasters",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "get_copytrade_masters",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page size. Default 100, maximum 500"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Page offset. Default 0"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard where filters"
          },
          {
            "name": "whereNot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard negative filters"
          },
          {
            "name": "whereIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard include-by-list filters"
          },
          {
            "name": "whereNotIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard exclude-by-list filters"
          },
          {
            "name": "whereBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard range filters"
          },
          {
            "name": "whereNotBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard negative range filters"
          },
          {
            "name": "orderBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Sort definition"
          },
          {
            "name": "stats_period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Statistics period. Allowed values: 7D, 30D, 90D, 365D. Default 30D"
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Alias for stats_period"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "rows": [
                    {
                      "id": 1,
                      "login": 100001,
                      "enabled": 1,
                      "strategy_name": "Conservative FX",
                      "description": "Low risk major pairs strategy",
                      "visibility": "public",
                      "allowed_follower_modes": 2,
                      "show_trade_history": 1,
                      "show_followers": 1,
                      "created_time": 1778160000,
                      "updated_time": 1778160000,
                      "stats": {
                        "period": "30D",
                        "period_days": 30,
                        "roi": 8.42,
                        "pnl": 1240.5,
                        "win_rate": 61.54,
                        "max_drawdown": 7.8,
                        "avg_pnl_per_trade": 47.71,
                        "trades": 26,
                        "pnl_history": [
                          0,
                          120.5,
                          85.5,
                          85.5,
                          165.75
                        ]
                      }
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "copytrade/GetCopyTradeMasters.md"
      }
    },
    "/copytrade/my": {
      "get": {
        "tags": [
          "copytrade"
        ],
        "summary": "GetCopyTradeMy",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "get_copytrade_my",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "masters": [],
                  "followers": []
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "copytrade/GetCopyTradeMy.md"
      }
    },
    "/copytrade/rewards": {
      "get": {
        "tags": [
          "copytrade"
        ],
        "summary": "GetCopyTradeRewards",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "get_copytrade_rewards",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "id",
                    "subscription_id",
                    "master_login",
                    "follower_login",
                    "payout_account_login",
                    "reward_type",
                    "source_order",
                    "charge_order",
                    "payout_order",
                    "period_from",
                    "period_to",
                    "base_amount",
                    "fee_amount",
                    "currency",
                    "state",
                    "failure_reason",
                    "created_time",
                    "updated_time"
                  ],
                  "rows": [
                    [
                      1,
                      10,
                      100001,
                      100002,
                      100001,
                      3,
                      123456,
                      123457,
                      123458,
                      1778160000,
                      1780838400,
                      1000,
                      200,
                      "USD",
                      2,
                      "",
                      1780838400,
                      1780838400
                    ]
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "copytrade/GetCopyTradeRewards.md"
      }
    },
    "/copytrade/subscriptions": {
      "get": {
        "tags": [
          "copytrade"
        ],
        "summary": "GetCustomerSubscriptionsByFilter",
        "description": "Requires SESSION_CUSTOMER.",
        "operationId": "get_copytrade_subscriptions",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Page size. Maximum 50000."
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Zero-based row offset."
          },
          {
            "name": "master_login",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Shortcut filter for master account login."
          },
          {
            "name": "master_account",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Alias of master_login."
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard table filter conditions."
          },
          {
            "name": "whereNot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard negative filter conditions."
          },
          {
            "name": "whereIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard IN filter conditions."
          },
          {
            "name": "whereNotIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard NOT IN filter conditions."
          },
          {
            "name": "whereBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard range filter conditions."
          },
          {
            "name": "whereNotBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Standard negative range filter conditions."
          },
          {
            "name": "orderBy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Sort expression, for example [[\"updated_time\", \"desc\"]]."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "id",
                    "master_login",
                    "follower_login",
                    "enabled",
                    "status",
                    "copy_mode",
                    "volume_mode",
                    "risk_multiplier",
                    "fixed_volume",
                    "copy_sl",
                    "copy_tp",
                    "copy_partial_close",
                    "copy_pending_orders",
                    "copy_existing_positions",
                    "reverse_direction",
                    "max_volume",
                    "min_volume",
                    "max_positions",
                    "symbols_mode",
                    "symbols",
                    "created_time",
                    "updated_time"
                  ],
                  "rows": [
                    [
                      12,
                      10001,
                      20002,
                      1,
                      0,
                      0,
                      1,
                      1.5,
                      0,
                      1,
                      1,
                      1,
                      0,
                      0,
                      0,
                      0,
                      0,
                      5,
                      0,
                      "",
                      1766400000,
                      1766486400
                    ]
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "copytrade/GetCustomerSubscriptionsByFilter.md"
      }
    },
    "/customer/auth/login": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "AuthCustomer",
        "description": "Authenticates a customer and returns customer profile, linked accounts, and __token.",
        "operationId": "post_customer_auth_login",
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "customer_id": 1,
                  "email": "client@example.com",
                  "full_name": "John Smith",
                  "first_name": "John",
                  "last_name": "Smith",
                  "status": 0,
                  "phone": "+35700000000",
                  "preferred_language": "en",
                  "brand": "default",
                  "deposit_allowed": 1,
                  "withdrawal_allowed": 1,
                  "desk": "EU",
                  "manager_id": 10,
                  "last_login_time": 1777600000,
                  "otp_enabled": 1,
                  "accounts": [
                    {
                      "login": 100001,
                      "customer_id": 1,
                      "enable": 1,
                      "leverage": 100,
                      "group": "standard",
                      "name": "John Smith",
                      "email": "client@example.com"
                    }
                  ],
                  "__token": "..."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "customer/AuthCustomer.md"
      }
    },
    "/customer/auth/otp/check": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "CheckCustomerOTP",
        "description": "Checks the current customer OTP code.",
        "operationId": "post_customer_auth_otp_check",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "data": "OK"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "customer/CheckCustomerOTP.md"
      }
    },
    "/customer/registration": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "CustomerRegistration",
        "description": "Registers a new customer profile.",
        "operationId": "post_customer_registration",
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "registered": true,
                  "customer": {
                    "customer_id": 1,
                    "email": "client@example.com",
                    "first_name": "John",
                    "last_name": "Smith",
                    "full_name": "John Smith",
                    "status": 0,
                    "enable": 1,
                    "deposit_allowed": 1,
                    "withdrawal_allowed": 1,
                    "brand": "default",
                    "created_time": 1777600000,
                    "updated_time": 1777600000
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "409": {
            "description": "Email is already registered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "customer/CustomerRegistration.md"
      }
    },
    "/customer/account/groups": {
      "get": {
        "tags": [
          "customer"
        ],
        "summary": "GetCustomerAccountGroups",
        "description": "Returns public trading groups that the authenticated customer can use for self-service account opening.",
        "operationId": "get_customer_account_groups",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "available": false,
                  "kyc_required": true,
                  "kyc_required_level": 1,
                  "block_reason": "KYC_REQUIRED"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Customer was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "customer/GetCustomerAccountGroups.md"
      }
    },
    "/customer/auth/otp": {
      "get": {
        "tags": [
          "customer"
        ],
        "summary": "GetCustomerOTP",
        "description": "Generates a new TOTP setup secret and provisioning URI.",
        "operationId": "get_customer_auth_otp",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "otp_url": "otpauth://totp/ION%20Trader:client%40example.com?secret=JBSWY3DPEHPK3PXP&issuer=ION%20Trader&algorithm=SHA1&digits=6&period=30",
                  "secret": "JBSWY3DPEHPK3PXP",
                  "algorithm": "SHA1",
                  "digits": 6,
                  "period": 30
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "customer/GetCustomerOTP.md"
      },
      "delete": {
        "tags": [
          "customer"
        ],
        "summary": "ResetCustomerOTP",
        "description": "Disables customer OTP after verifying the current code.",
        "operationId": "delete_customer_auth_otp",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "otp_enabled": 0
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "customer/ResetCustomerOTP.md"
      },
      "put": {
        "tags": [
          "customer"
        ],
        "summary": "SetCustomerOTP",
        "description": "Enables or replaces customer OTP after verifying the setup code.",
        "operationId": "put_customer_auth_otp",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "otp_enabled": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "customer/SetCustomerOTP.md"
      }
    },
    "/customer/me": {
      "get": {
        "tags": [
          "customer"
        ],
        "summary": "GetCustomerSelf",
        "description": "Returns the authenticated customer profile and linked trading accounts.",
        "operationId": "get_customer_me",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "customer": {
                    "customer_id": 1,
                    "email": "client@example.com",
                    "full_name": "John Smith",
                    "status": 0,
                    "enable": 1,
                    "deposit_allowed": 1,
                    "withdrawal_allowed": 1,
                    "brand": "default"
                  },
                  "accounts": [
                    {
                      "login": 100001,
                      "customer_id": 1,
                      "enable": 1,
                      "leverage": 100,
                      "group": "standard",
                      "name": "John Smith",
                      "email": "client@example.com",
                      "phone": "+35700000000"
                    }
                  ],
                  "accounts_count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Customer was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "customer/GetCustomerSelf.md"
      }
    },
    "/customer/session/accounts": {
      "get": {
        "tags": [
          "customer"
        ],
        "summary": "GetCustomerSessionAccounts",
        "description": "Returns trading accounts linked to the authenticated customer.",
        "operationId": "get_customer_session_accounts",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "accounts": [
                    {
                      "login": 100001,
                      "customer_id": 1,
                      "enable": 1,
                      "leverage": 100,
                      "group": "standard",
                      "name": "John Smith",
                      "email": "client@example.com"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "customer/GetCustomerSessionAccounts.md"
      }
    },
    "/customer/account/open": {
      "post": {
        "tags": [
          "customer"
        ],
        "summary": "OpenCustomerAccount",
        "description": "Creates a trading account linked to the authenticated customer.",
        "operationId": "post_customer_account_open",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "error": "KYC_REQUIRED",
                  "message": "Account opening is not allowed for this group",
                  "kyc_required": true,
                  "kyc_required_level": 1,
                  "kyc_status": 2,
                  "kyc_current_level": 0,
                  "kyc_profile_id": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "customer/OpenCustomerAccount.md"
      }
    },
    "/customer/kyc/documents": {
      "post": {
        "tags": [
          "kyc"
        ],
        "summary": "CustomerAddKycDocument",
        "description": "Requires SESSION_CUSTOMER token.",
        "operationId": "post_customer_kyc_documents",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "document": {
                    "id": 1,
                    "customer_id": 100,
                    "kyc_id": 1,
                    "step_id": 10,
                    "brand": "default",
                    "type": "passport",
                    "status": 0,
                    "file_id": "2d8b3e5c-5b02-43f4-8b31-1a1cc33c7d12",
                    "file_name": "passport.pdf",
                    "content_type": "application/pdf",
                    "file_size": 245000,
                    "checksum": "..."
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "KYC profile was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "kyc/CustomerAddKycDocument.md"
      },
      "get": {
        "tags": [
          "kyc"
        ],
        "summary": "CustomerGetKycDocuments",
        "description": "Optional query parameter:",
        "operationId": "get_customer_kyc_documents",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "rows": [
                    {
                      "id": 1,
                      "customer_id": 100,
                      "kyc_id": 1,
                      "step_id": 10,
                      "brand": "default",
                      "type": "passport",
                      "status": 0,
                      "file_id": "2d8b3e5c-5b02-43f4-8b31-1a1cc33c7d12",
                      "file_name": "passport.pdf",
                      "content_type": "application/pdf",
                      "file_size": 245000,
                      "checksum": "..."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "kyc/CustomerGetKycDocuments.md"
      }
    },
    "/customer/kyc": {
      "get": {
        "tags": [
          "kyc"
        ],
        "summary": "CustomerGetKycStatus",
        "description": "Requires SESSION_CUSTOMER token.",
        "operationId": "get_customer_kyc",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "profile": {
                    "id": 1,
                    "customer_id": 100,
                    "brand": "default",
                    "status": 2,
                    "current_level": 0,
                    "required_level": 1,
                    "risk_level": 0,
                    "created_time": 1778160000,
                    "updated_time": 1778160000
                  },
                  "steps": [
                    {
                      "id": 10,
                      "customer_id": 100,
                      "kyc_id": 1,
                      "brand": "default",
                      "template_id": 1,
                      "level": 1,
                      "code": "proof_id",
                      "name": "Proof of identity",
                      "step_type": 0,
                      "required": 1,
                      "status": 0,
                      "requirements": {},
                      "form_schema": {},
                      "answers": {}
                    }
                  ],
                  "documents": [
                    {
                      "id": 1,
                      "customer_id": 100,
                      "kyc_id": 1,
                      "step_id": 10,
                      "brand": "default",
                      "type": "passport",
                      "status": 0,
                      "file_id": "2d8b3e5c-5b02-43f4-8b31-1a1cc33c7d12",
                      "file_name": "passport.pdf",
                      "content_type": "application/pdf",
                      "file_size": 245000,
                      "checksum": "..."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "kyc/CustomerGetKycStatus.md"
      }
    },
    "/customer/kyc/steps/{id}": {
      "get": {
        "tags": [
          "kyc"
        ],
        "summary": "CustomerGetKycStep",
        "description": "Requires SESSION_CUSTOMER token.",
        "operationId": "get_customer_kyc_steps_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "step": {
                    "id": 10,
                    "customer_id": 100,
                    "kyc_id": 1,
                    "brand": "default",
                    "template_id": 1,
                    "level": 1,
                    "code": "proof_id",
                    "name": "Proof of identity",
                    "step_type": 0,
                    "required": 1,
                    "status": 0,
                    "requirements": {},
                    "form_schema": {},
                    "answers": {}
                  },
                  "documents": [
                    {
                      "id": 1,
                      "customer_id": 100,
                      "kyc_id": 1,
                      "step_id": 10,
                      "brand": "default",
                      "type": "passport",
                      "status": 0,
                      "file_id": "2d8b3e5c-5b02-43f4-8b31-1a1cc33c7d12",
                      "file_name": "passport.pdf",
                      "content_type": "application/pdf",
                      "file_size": 245000,
                      "checksum": "..."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Step was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "kyc/CustomerGetKycStep.md"
      }
    },
    "/customer/kyc/steps/{id}/submit": {
      "post": {
        "tags": [
          "kyc"
        ],
        "summary": "CustomerSubmitKycStep",
        "description": "Requires SESSION_CUSTOMER token.",
        "operationId": "post_customer_kyc_steps_id_submit",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "step": {
                    "id": 10,
                    "status": 1,
                    "answers": {
                      "first_name": "John",
                      "country": "CY",
                      "employment_status": "employed"
                    },
                    "submitted_time": 1778160000,
                    "updated_time": 1778160000
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Step was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "kyc/CustomerSubmitKycStep.md"
      }
    },
    "/market/watch": {
      "post": {
        "tags": [
          "market"
        ],
        "summary": "Add Market Watch",
        "description": "Adds a symbol to market watch for the effective login and returns a snapshot for that symbol.",
        "operationId": "post_market_watch",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Trading symbol to add"
                  },
                  "login": {
                    "type": "integer",
                    "description": "Target account login for staff sessions"
                  }
                },
                "required": [
                  "symbol"
                ]
              },
              "example": {
                "EURUSD": {
                  "symbol": "EURUSD",
                  "price1d": -0.12,
                  "high": 1.10523,
                  "low": 1.10211,
                  "prices": [
                    1.10312,
                    1.10344,
                    1.10301
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "EURUSD": {
                    "symbol": "EURUSD",
                    "price1d": -0.12,
                    "high": 1.10523,
                    "low": 1.10211,
                    "prices": [
                      1.10312,
                      1.10344,
                      1.10301
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "market/AddMarketWatch.md"
      },
      "delete": {
        "tags": [
          "market"
        ],
        "summary": "Delete Market Watch",
        "description": "Deletes a symbol from market watch for the effective login.",
        "operationId": "delete_market_watch",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Trading symbol to remove"
                  },
                  "login": {
                    "type": "integer",
                    "description": "Target account login for staff sessions"
                  }
                },
                "required": [
                  "symbol"
                ]
              },
              "example": {
                "data": "OK"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "data": "OK"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "market/DelMarketWatch.md"
      },
      "put": {
        "tags": [
          "market"
        ],
        "summary": "Update Market Watch",
        "description": "Updates visual metadata for a market watch symbol.",
        "operationId": "put_market_watch",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Market watch symbol"
                  },
                  "sort_index": {
                    "type": "integer",
                    "description": "New display order"
                  },
                  "color": {
                    "type": "string",
                    "description": "New color tag"
                  },
                  "login": {
                    "type": "integer",
                    "description": "Target account login for staff sessions"
                  }
                },
                "required": [
                  "symbol"
                ]
              },
              "example": {
                "data": "OK"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "data": "OK"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Symbol is not present in market watch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "market/UpdMarketWatch.md"
      }
    },
    "/quotes/candles": {
      "get": {
        "tags": [
          "market"
        ],
        "summary": "GetChartData",
        "description": "GET https://{some_domain}/quotes/candles",
        "operationId": "get_quotes_candles",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Internal symbol name"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Range start as Unix timestamp in seconds"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Range end as Unix timestamp in seconds"
          },
          {
            "name": "frame",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Candle timeframe, for example 1M, 5M, 1H, 1D"
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Accepted by validation, currently not used by the handler"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "open",
                    "high",
                    "low",
                    "close",
                    "volume",
                    "time"
                  ],
                  "data": [
                    [
                      1.1,
                      1.102,
                      1.099,
                      1.1015,
                      1200,
                      1712448000
                    ],
                    [
                      1.1015,
                      1.105,
                      1.1,
                      1.1045,
                      980,
                      1712451600
                    ]
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "market/GetChartData.md"
      }
    },
    "/market": {
      "get": {
        "tags": [
          "market"
        ],
        "summary": "Get Market Info",
        "description": "Returns the full market map available for a specific account login.",
        "operationId": "get_market",
        "parameters": [
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Target account login"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "assets": {
                    "EURUSD": {
                      "symbol": "EURUSD",
                      "description": "Euro vs US Dollar",
                      "currency": "USD",
                      "margin_currency": "USD",
                      "quote_currency": "USD",
                      "group": "Forex",
                      "digits": 5,
                      "trade": 1,
                      "spread": 20,
                      "swap_enable": 1,
                      "margin_divider": 1.0,
                      "contract_size": 100000,
                      "ask": 1.10501,
                      "bid": 1.10498,
                      "market_state": 1,
                      "market_reason": 0,
                      "lot_min": 1,
                      "lot_max": 10000,
                      "lot_step": 1,
                      "sessions": []
                    }
                  },
                  "groups": [
                    "Forex",
                    "Metals"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Account group not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "market/GetMarketInfo.md"
      }
    },
    "/market/short/list": {
      "get": {
        "tags": [
          "market"
        ],
        "summary": "Get Market Short List",
        "description": "Returns a compact list of market assets available for a specific account, plus visible symbol groups.",
        "operationId": "get_market_short_list",
        "parameters": [
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Account login ID"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "assets": {
                    "structure": [
                      "symbol",
                      "description",
                      "currency",
                      "margin_currency",
                      "quote_currency",
                      "group",
                      "digits",
                      "trade",
                      "spread",
                      "spread_balance",
                      "swap_enable",
                      "margin_divider",
                      "margin_mode",
                      "stops_level",
                      "contract_size",
                      "long_only",
                      "ask",
                      "bid",
                      "point",
                      "tick_value",
                      "tick_size",
                      "market_state",
                      "market_reason",
                      "lot_min",
                      "lot_max",
                      "lot_step",
                      "comm_base",
                      "comm_type",
                      "exchange",
                      "category",
                      "industry",
                      "sector",
                      "shareholders",
                      "market_cap",
                      "price1d",
                      "icon"
                    ],
                    "rows": [
                      [
                        "EURUSD",
                        "Euro vs US Dollar",
                        "USD",
                        "USD",
                        "USD",
                        "Forex",
                        5,
                        1,
                        20,
                        10,
                        1,
                        1.0,
                        0,
                        0,
                        100000,
                        0,
                        1.10501,
                        1.10498,
                        1e-05,
                        10.0,
                        1e-05,
                        1,
                        0,
                        1,
                        10000,
                        1,
                        0.0,
                        0,
                        "FOREX",
                        "Currencies",
                        "FX Majors",
                        "Spot FX",
                        0,
                        0,
                        -0.15,
                        "/icons/eurusd.svg"
                      ]
                    ]
                  },
                  "groups": [
                    "Forex",
                    "Crypto",
                    "Stocks"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "User group not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "market/GetMarketShortList.md"
      }
    },
    "/market/symbol": {
      "get": {
        "tags": [
          "market"
        ],
        "summary": "Get Market Symbol",
        "description": "Returns extended details for a single symbol in the context of a specific user/group (permissions, margins, lots, commissions, analytics).",
        "operationId": "get_market_symbol",
        "parameters": [
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "User account login ID"
          },
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Symbol code (for example, EURUSD)"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "error": "SYMBOL_NOT_ALLOWED"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "User group not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "market/GetMarketSymbol.md"
      }
    },
    "/market/watch/list": {
      "get": {
        "tags": [
          "market"
        ],
        "summary": "Get Market Watch",
        "description": "Returns market watch entries for the effective login.",
        "operationId": "get_market_watch_list",
        "parameters": [
          {
            "name": "prefix",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Request context/prefix"
          },
          {
            "name": "login",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Target account login for staff sessions"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "assets": {
                    "EURUSD": {
                      "symbol": "EURUSD",
                      "sort_index": 1,
                      "color": "#22AA66",
                      "market_state": 1,
                      "market_reason": 0,
                      "price1d": -0.12,
                      "high": 1.10523,
                      "low": 1.10211,
                      "prices": [
                        1.10312,
                        1.10344,
                        1.10301
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "market/GetMarketWatch.md"
      }
    },
    "/notify/all": {
      "delete": {
        "tags": [
          "notify"
        ],
        "summary": "<span class=\"delete badge\">DELETE</span> Delete All Notifications",
        "description": "Deletes all notifications that belong to the authenticated client account.",
        "operationId": "delete_notify_all",
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "data": "OK"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "notify/DeleteAllNotify.md"
      }
    },
    "/notify": {
      "delete": {
        "tags": [
          "notify"
        ],
        "summary": "<span class=\"delete badge\">DELETE</span> Delete Notification",
        "description": "Deletes a notification that belongs to the authenticated client account.",
        "operationId": "delete_notify",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "Notification ID"
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 101
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "data": "OK"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "notify/DeleteNotify.md"
      },
      "put": {
        "tags": [
          "notify"
        ],
        "summary": "<span class=\"put badge\">PUT</span> Update Notification Status",
        "description": "Updates notification status for the authenticated client account.",
        "operationId": "put_notify",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "Notification ID"
                  },
                  "status": {
                    "type": "integer",
                    "description": "New notification status"
                  }
                },
                "required": [
                  "id",
                  "status"
                ]
              },
              "example": {
                "id": 101,
                "status": 2
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {}
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "notify/UpdateNotify.md"
      }
    },
    "/notify/list": {
      "get": {
        "tags": [
          "notify"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Notifications",
        "description": "Returns notifications for the authenticated client account.",
        "operationId": "get_notify_list",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Maximum number of rows to return"
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Pagination offset"
          },
          {
            "name": "filter",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Text filter applied to notification message"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "structure": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Ordered field list used in each row"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Notification rows"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "structure": [
                    "id",
                    "token",
                    "message",
                    "create_time",
                    "open_time",
                    "exp_time",
                    "type",
                    "status",
                    "level",
                    "description",
                    "data"
                  ],
                  "rows": [
                    [
                      101,
                      "MARGIN_CALL",
                      "Margin call: Your margin level is below threshold",
                      1734312345,
                      0,
                      0,
                      2,
                      1,
                      1,
                      "Margin threshold warning",
                      {
                        "level": 87.2
                      }
                    ]
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "notify/GetNotifyList.md"
      }
    },
    "/notify/read-all": {
      "put": {
        "tags": [
          "notify"
        ],
        "summary": "<span class=\"put badge\">PUT</span> Read All Notifications",
        "description": "Marks all notifications of the authenticated client account as READ.",
        "operationId": "put_notify_read_all",
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "data": "OK"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "notify/ReadAllNotify.md"
      }
    },
    "/prop/challenge/buy": {
      "post": {
        "tags": [
          "prop"
        ],
        "summary": "<span class=\"post badge\">POST</span> Buy Prop Challenge",
        "description": "Buys and activates a prop challenge in one request.",
        "operationId": "post_prop_challenge_buy",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "program_id": {
                    "type": "integer",
                    "description": "Active prop program id"
                  },
                  "payer_login": {
                    "type": "integer",
                    "description": "Customer account used as payer"
                  },
                  "idempotency_key": {
                    "type": "string",
                    "description": "Retry key that prevents duplicate purchases"
                  }
                },
                "required": [
                  "program_id",
                  "payer_login"
                ]
              },
              "example": {
                "accepted": true,
                "idempotent": false,
                "purchase": {
                  "id": 10,
                  "program_id": 1,
                  "customer_id": 5,
                  "payer_login": 100001,
                  "account_login": 2000100,
                  "status": 3,
                  "status_name": "active",
                  "next_action": "OPEN_CHALLENGE",
                  "can_retry": false,
                  "can_cancel": false,
                  "amount": 499.0,
                  "currency": "USD",
                  "conversion_rate": 1.0,
                  "amount_account_currency": 499.0,
                  "comment": "PROP_CHALLENGE_PURCHASE_ACTIVE",
                  "idempotency_key": "3c68d3bf-d42c-4a6d-9a4c-80d5c3439f44",
                  "payment_status": "paid",
                  "activation_status": "active",
                  "failure_reason": "",
                  "created_time": 1778160000,
                  "updated_time": 1778160000
                },
                "challenge": {
                  "id": 12,
                  "purchase_id": 10,
                  "program_id": 1,
                  "customer_id": 5,
                  "account_login": 2000100,
                  "current_phase_index": 1,
                  "status": 1,
                  "start_time": 1778160000,
                  "end_time": 0,
                  "created_time": 1778160000,
                  "updated_time": 1778160000
                },
                "account": {
                  "login": 2000100,
                  "group": "PROP-DEMO-100K",
                  "brand": "brand-a",
                  "currency": "USD",
                  "leverage": 100,
                  "enable": 1,
                  "customer_id": 5
                },
                "temporary_password": "a1b2c3d4e5f6",
                "must_change_password": true,
                "payment_order": 500100,
                "initial_balance_order": 500101
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "accepted": true,
                  "idempotent": false,
                  "purchase": {
                    "id": 10,
                    "program_id": 1,
                    "customer_id": 5,
                    "payer_login": 100001,
                    "account_login": 2000100,
                    "status": 3,
                    "status_name": "active",
                    "next_action": "OPEN_CHALLENGE",
                    "can_retry": false,
                    "can_cancel": false,
                    "amount": 499.0,
                    "currency": "USD",
                    "conversion_rate": 1.0,
                    "amount_account_currency": 499.0,
                    "comment": "PROP_CHALLENGE_PURCHASE_ACTIVE",
                    "idempotency_key": "3c68d3bf-d42c-4a6d-9a4c-80d5c3439f44",
                    "payment_status": "paid",
                    "activation_status": "active",
                    "failure_reason": "",
                    "created_time": 1778160000,
                    "updated_time": 1778160000
                  },
                  "challenge": {
                    "id": 12,
                    "purchase_id": 10,
                    "program_id": 1,
                    "customer_id": 5,
                    "account_login": 2000100,
                    "current_phase_index": 1,
                    "status": 1,
                    "start_time": 1778160000,
                    "end_time": 0,
                    "created_time": 1778160000,
                    "updated_time": 1778160000
                  },
                  "account": {
                    "login": 2000100,
                    "group": "PROP-DEMO-100K",
                    "brand": "brand-a",
                    "currency": "USD",
                    "leverage": 100,
                    "enable": 1,
                    "customer_id": 5
                  },
                  "temporary_password": "a1b2c3d4e5f6",
                  "must_change_password": true,
                  "payment_order": 500100,
                  "initial_balance_order": 500101
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "prop/BuyPropChallenge.md"
      }
    },
    "/prop/challenges": {
      "get": {
        "tags": [
          "prop"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get My Prop Challenges",
        "description": "Returns prop purchases and challenges for the authenticated customer.",
        "operationId": "get_prop_challenges",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "purchases": [
                    {
                      "id": 10,
                      "program_id": 1,
                      "customer_id": 5,
                      "payer_login": 100001,
                      "account_login": 2000100,
                      "status": 3,
                      "status_name": "active",
                      "next_action": "OPEN_CHALLENGE",
                      "can_retry": false,
                      "can_cancel": false,
                      "amount": 499.0,
                      "currency": "USD",
                      "conversion_rate": 1.0,
                      "amount_account_currency": 499.0,
                      "comment": "PROP_CHALLENGE_PURCHASE_ACTIVE",
                      "payment_status": "paid",
                      "activation_status": "active",
                      "failure_reason": "",
                      "created_time": 1778160000,
                      "updated_time": 1778160000
                    }
                  ],
                  "challenges": [
                    {
                      "id": 1,
                      "purchase_id": 10,
                      "program_id": 1,
                      "customer_id": 5,
                      "account_login": 200001,
                      "current_phase_index": 1,
                      "status": 1,
                      "start_time": 1778160000,
                      "end_time": 1780752000,
                      "created_time": 1778160000,
                      "updated_time": 1778160000
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "prop/GetMyPropChallenges.md"
      }
    },
    "/prop/challenges/{id}": {
      "get": {
        "tags": [
          "prop"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Prop Challenge",
        "description": "Returns a customer-owned prop challenge with runtime phase state, latest metric snapshot and latest rule breach.",
        "operationId": "get_prop_challenges_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "challenge": {
                    "id": 1,
                    "purchase_id": 10,
                    "program_id": 1,
                    "customer_id": 5,
                    "account_login": 2000100,
                    "current_phase_index": 1,
                    "status": 1,
                    "start_time": 1778160000,
                    "end_time": 0,
                    "created_time": 1778160000,
                    "updated_time": 1778160000
                  },
                  "purchase": {},
                  "program": {},
                  "phases": [
                    {
                      "id": 1,
                      "challenge_id": 1,
                      "program_id": 1,
                      "phase_index": 1,
                      "phase_type": 0,
                      "account_group": "PROP_DEMO_USD",
                      "account_login": 2000100,
                      "initial_balance": 100000,
                      "initial_equity": 100000,
                      "final_balance": 0,
                      "final_equity": 0,
                      "status": 1,
                      "status_name": "active",
                      "start_time": 1778160000,
                      "end_time": 0,
                      "created_time": 1778160000,
                      "updated_time": 1778160000,
                      "latest_metric": {
                        "balance": 100000,
                        "equity": 104500,
                        "profit_target": 4.5,
                        "daily_loss": 0,
                        "total_loss": 0,
                        "trading_days": 3
                      },
                      "progress": {
                        "profit_pct": 4.5,
                        "profit_target_pct": 8,
                        "profit_target_progress_pct": 56.25,
                        "daily_loss_pct": 0,
                        "daily_loss_limit_pct": 5,
                        "total_loss_pct": 0,
                        "total_loss_limit_pct": 10,
                        "trading_days": 3,
                        "min_trading_days": 5,
                        "max_trading_days": 30,
                        "max_positions": 10
                      }
                    }
                  ],
                  "current_phase": {},
                  "latest_metric": {},
                  "latest_breach": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "prop/GetPropChallenge.md"
      }
    },
    "/prop/challenges/{id}/breaches": {
      "get": {
        "tags": [
          "prop"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Prop Challenge Breaches",
        "description": "Returns rule breaches for a customer-owned prop challenge. Rows are ordered from newest to oldest.",
        "operationId": "get_prop_challenges_id_breaches",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Default 100, max 1000"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Default 0"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "rows": [
                    {
                      "id": 15,
                      "challenge_id": 1,
                      "account_login": 2000100,
                      "rule_code": "MAX_TOTAL_LOSS",
                      "message": "Maximum total loss exceeded",
                      "payload_json": "{}",
                      "created_time": 1778163600
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "prop/GetPropChallengeBreaches.md"
      }
    },
    "/prop/challenges/{id}/metrics": {
      "get": {
        "tags": [
          "prop"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Prop Challenge Metrics",
        "description": "Returns runtime metric snapshots for a customer-owned prop challenge. Rows are ordered from newest to oldest.",
        "operationId": "get_prop_challenges_id_metrics",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Default 100, max 1000"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Default 0"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "rows": [
                    {
                      "id": 100,
                      "challenge_id": 1,
                      "account_login": 2000100,
                      "balance": 100000,
                      "equity": 104500,
                      "profit_target": 4.5,
                      "daily_loss": 0,
                      "total_loss": 0,
                      "trading_days": 3,
                      "created_time": 1778163600
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "prop/GetPropChallengeMetrics.md"
      }
    },
    "/prop/programs/{id}": {
      "get": {
        "tags": [
          "prop"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Prop Program",
        "description": "Returns one active prop trading program with nested steps.",
        "operationId": "get_prop_programs_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "id": 1,
                  "brand": "default",
                  "name": "Evaluation 100K",
                  "display_name": "Evaluation 100K",
                  "description": "Two phase evaluation",
                  "short_description": "Two phase evaluation",
                  "price": 499.0,
                  "price_currency": "USD",
                  "price_label": "USD 499.000000",
                  "profit_split": 0.8,
                  "status": 0,
                  "sort_index": 100,
                  "steps": [
                    {
                      "phase_index": 1,
                      "phase_type": 0,
                      "name": "Evaluation",
                      "account_group": "PROP_DEMO_USD",
                      "initial_balance": 100000,
                      "duration_days": 30,
                      "max_daily_loss_pct": 5,
                      "max_total_loss_pct": 10,
                      "max_daily_profit_pct": 0,
                      "profit_target_pct": 8,
                      "profit_split": 0,
                      "min_trading_days": 5,
                      "max_trading_days": 30,
                      "max_positions": 10
                    },
                    {
                      "phase_index": 2,
                      "phase_type": 1,
                      "name": "Funded",
                      "account_group": "PROP_REAL_USD",
                      "initial_balance": 100000,
                      "duration_days": 30,
                      "max_daily_loss_pct": 5,
                      "max_total_loss_pct": 10,
                      "max_daily_profit_pct": 5,
                      "profit_target_pct": 0,
                      "profit_split": 0.8,
                      "min_trading_days": 0,
                      "max_trading_days": 30,
                      "max_positions": 10
                    }
                  ],
                  "created_time": 1778160000,
                  "updated_time": 1778160000
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "prop/GetPropProgram.md"
      }
    },
    "/prop/programs/{id}/payer-accounts": {
      "get": {
        "tags": [
          "prop"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Prop Program Payer Accounts",
        "description": "Returns customer accounts with eligibility information for a specific prop",
        "operationId": "get_prop_programs_id_payer_accounts",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "rows": [
                    {
                      "login": 100001,
                      "currency": "USD",
                      "balance": 1200,
                      "eligible": true,
                      "block_reason": null,
                      "block_reason_message": null
                    },
                    {
                      "login": 100002,
                      "currency": "EUR",
                      "balance": 800,
                      "eligible": false,
                      "block_reason": "CURRENCY_CONVERSION_REQUIRED",
                      "block_reason_message": "Program and payer account currencies must match"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "prop/GetPropProgramPayerAccounts.md"
      }
    },
    "/prop/programs": {
      "get": {
        "tags": [
          "prop"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Prop Programs",
        "description": "Returns active prop trading programs available for purchase in the trading terminal.",
        "operationId": "get_prop_programs",
        "parameters": [
          {
            "name": "brand",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter by brand"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "rows": [
                    {
                      "id": 1,
                      "brand": "default",
                      "name": "Evaluation 100K",
                      "display_name": "Evaluation 100K",
                      "description": "Two phase evaluation",
                      "short_description": "Two phase evaluation",
                      "price": 499.0,
                      "price_currency": "USD",
                      "price_label": "USD 499.000000",
                      "profit_split": 0.8,
                      "status": 0,
                      "sort_index": 100,
                      "steps": [
                        {
                          "phase_index": 1,
                          "phase_type": 0,
                          "name": "Evaluation",
                          "account_group": "PROP_DEMO_USD",
                          "initial_balance": 100000,
                          "duration_days": 30,
                          "max_daily_loss_pct": 5,
                          "max_total_loss_pct": 10,
                          "max_daily_profit_pct": 0,
                          "profit_target_pct": 8,
                          "profit_split": 0,
                          "min_trading_days": 5,
                          "max_trading_days": 30,
                          "max_positions": 10
                        },
                        {
                          "phase_index": 2,
                          "phase_type": 1,
                          "name": "Funded",
                          "account_group": "PROP_REAL_USD",
                          "initial_balance": 100000,
                          "duration_days": 30,
                          "max_daily_loss_pct": 5,
                          "max_total_loss_pct": 10,
                          "max_daily_profit_pct": 5,
                          "profit_target_pct": 0,
                          "profit_split": 0.8,
                          "min_trading_days": 0,
                          "max_trading_days": 30,
                          "max_positions": 10
                        }
                      ],
                      "created_time": 1778160000,
                      "updated_time": 1778160000
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "prop/GetPropPrograms.md"
      }
    },
    "/prop/purchases/{id}": {
      "get": {
        "tags": [
          "prop"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Prop Purchase",
        "description": "Returns one customer prop purchase with linked program details and related",
        "operationId": "get_prop_purchases_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "purchase": {
                    "id": 10,
                    "program_id": 1,
                    "customer_id": 5,
                    "payer_login": 100001,
                    "account_login": 2000100,
                    "status": 3,
                    "status_name": "active",
                    "next_action": "OPEN_CHALLENGE",
                    "can_retry": false,
                    "can_cancel": false,
                    "amount": 499,
                    "currency": "USD",
                    "conversion_rate": 1,
                    "amount_account_currency": 499,
                    "comment": "PROP_CHALLENGE_PURCHASE_ACTIVE",
                    "idempotency_key": "3c68d3bf-d42c-4a6d-9a4c-80d5c3439f44",
                    "payment_status": "paid",
                    "activation_status": "active",
                    "failure_reason": "",
                    "created_time": 1778160000,
                    "updated_time": 1778160000
                  },
                  "program": {},
                  "challenges": [
                    {
                      "id": 12,
                      "purchase_id": 10,
                      "program_id": 1,
                      "customer_id": 5,
                      "account_login": 2000100,
                      "current_phase_index": 1,
                      "status": 1,
                      "start_time": 1778160000,
                      "end_time": 0,
                      "created_time": 1778160000,
                      "updated_time": 1778160000
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "prop/GetPropPurchase.md"
      }
    },
    "/prop/challenge/preview": {
      "post": {
        "tags": [
          "prop"
        ],
        "summary": "<span class=\"post badge\">POST</span> Preview Prop Challenge",
        "description": "Validates whether the authenticated customer can buy a prop challenge with the",
        "operationId": "post_prop_challenge_preview",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "program_id": {
                    "type": "integer",
                    "description": "Prop program id"
                  },
                  "payer_login": {
                    "type": "integer",
                    "description": "Customer account used as payer"
                  }
                },
                "required": [
                  "program_id",
                  "payer_login"
                ]
              },
              "example": {
                "can_buy": true,
                "price": 499,
                "currency": "USD",
                "payer_balance": 1200,
                "amount_account_currency": 499,
                "conversion_rate": 1,
                "warnings": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "can_buy": false,
                  "reason": "NOT_ENOUGH_FUNDS",
                  "message": "Not enough funds",
                  "required_amount": 499,
                  "available_balance": 120,
                  "block_reason_message": "Not enough funds"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "prop/PreviewPropChallenge.md"
      }
    },
    "/script": {
      "post": {
        "tags": [
          "script"
        ],
        "summary": "AddScript",
        "description": "POST https://{some_domain}/script",
        "operationId": "post_script",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Script name"
                  },
                  "script": {
                    "type": "string",
                    "description": "Script source code"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description"
                  },
                  "kind": {
                    "type": "string",
                    "description": "indicator, robot, strategy, widget"
                  },
                  "language": {
                    "type": "string",
                    "description": "stscript, javascript"
                  },
                  "visibility": {
                    "type": "string",
                    "description": "private, public. Terminal MVP sends private only; public is reserved for future publishing flows."
                  },
                  "autostart": {
                    "type": "integer",
                    "description": "0 or 1"
                  },
                  "enabled": {
                    "type": "integer",
                    "description": "0 or 1"
                  },
                  "login": {
                    "type": "integer",
                    "description": "Target login for staff sessions"
                  }
                },
                "required": [
                  "name",
                  "script",
                  "kind",
                  "language",
                  "visibility"
                ]
              },
              "example": {
                "id": 42,
                "login": 1001,
                "name": "My MA",
                "script": "input length = 20",
                "description": "simple moving average",
                "kind": "indicator",
                "language": "stscript",
                "visibility": "private",
                "autostart": 0,
                "enabled": 1,
                "created_time": 1777196331,
                "updated_time": 1777196331
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "id": 42,
                  "login": 1001,
                  "name": "My MA",
                  "script": "input length = 20",
                  "description": "simple moving average",
                  "kind": "indicator",
                  "language": "stscript",
                  "visibility": "private",
                  "autostart": 0,
                  "enabled": 1,
                  "created_time": 1777196331,
                  "updated_time": 1777196331
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "script/AddScript.md"
      },
      "delete": {
        "tags": [
          "script"
        ],
        "summary": "DelScript",
        "description": "DELETE https://{some_domain}/script",
        "operationId": "delete_script",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "Script ID"
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 42,
                "login": 1001,
                "name": "My MA",
                "script": "input length = 20",
                "description": "simple moving average",
                "kind": "indicator",
                "language": "stscript",
                "visibility": "private",
                "autostart": 0,
                "enabled": 1,
                "created_time": 1777196331,
                "updated_time": 1777197000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "id": 42,
                  "login": 1001,
                  "name": "My MA",
                  "script": "input length = 20",
                  "description": "simple moving average",
                  "kind": "indicator",
                  "language": "stscript",
                  "visibility": "private",
                  "autostart": 0,
                  "enabled": 1,
                  "created_time": 1777196331,
                  "updated_time": 1777197000
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "script/DeleteScript.md"
      },
      "put": {
        "tags": [
          "script"
        ],
        "summary": "UpdScript",
        "description": "PUT https://{some_domain}/script",
        "operationId": "put_script",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "Script ID"
                  },
                  "name": {
                    "type": "string",
                    "description": "Script name"
                  },
                  "script": {
                    "type": "string",
                    "description": "Script source code"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description"
                  },
                  "kind": {
                    "type": "string",
                    "description": "indicator, robot, strategy, widget"
                  },
                  "language": {
                    "type": "string",
                    "description": "stscript, javascript"
                  },
                  "visibility": {
                    "type": "string",
                    "description": "private, public"
                  },
                  "autostart": {
                    "type": "integer",
                    "description": "0 or 1"
                  },
                  "enabled": {
                    "type": "integer",
                    "description": "0 or 1"
                  }
                },
                "required": [
                  "id",
                  "name",
                  "script",
                  "kind",
                  "language",
                  "visibility"
                ]
              },
              "example": {
                "id": 42,
                "login": 1001,
                "name": "My MA v2",
                "script": "input length = 50",
                "description": "updated version",
                "kind": "indicator",
                "language": "stscript",
                "visibility": "public",
                "autostart": 1,
                "enabled": 1,
                "created_time": 1777196331,
                "updated_time": 1777197000
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "id": 42,
                  "login": 1001,
                  "name": "My MA v2",
                  "script": "input length = 50",
                  "description": "updated version",
                  "kind": "indicator",
                  "language": "stscript",
                  "visibility": "public",
                  "autostart": 1,
                  "enabled": 1,
                  "created_time": 1777196331,
                  "updated_time": 1777197000
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "script/UpdateScript.md"
      }
    },
    "/script/{id}": {
      "get": {
        "tags": [
          "script"
        ],
        "summary": "GetScript",
        "description": "GET https://{some_domain}/script/{id}",
        "operationId": "get_script_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Path parameter."
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "id": 42,
                  "login": 1001,
                  "name": "MorningScalper",
                  "script": "print('hi')",
                  "description": "simple moving average",
                  "kind": "indicator",
                  "language": "stscript",
                  "visibility": "public",
                  "autostart": 1,
                  "enabled": 1,
                  "created_time": 1777196331,
                  "updated_time": 1777196331
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Script not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "script/GetScript.md"
      }
    },
    "/scripts": {
      "get": {
        "tags": [
          "script"
        ],
        "summary": "GetScripts",
        "description": "GET https://{some_domain}/scripts",
        "operationId": "get_scripts",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "me, public, or all"
          },
          {
            "name": "login",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Target login for staff sessions"
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "indicator, robot, strategy, widget"
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "stscript, javascript"
          },
          {
            "name": "visibility",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "private, public"
          },
          {
            "name": "enabled",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "0 or 1"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "rows": [
                    {
                      "id": 42,
                      "login": 1001,
                      "name": "MorningScalper",
                      "script": "print('hi')",
                      "description": "simple moving average",
                      "kind": "indicator",
                      "language": "stscript",
                      "visibility": "private",
                      "autostart": 1,
                      "enabled": 1,
                      "created_time": 1777196331,
                      "updated_time": 1777196331
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "script/GetScriptsByLogin.md"
      }
    },
    "/stats/close/summary": {
      "get": {
        "tags": [
          "stats"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get Closed Trade Summary",
        "description": "Returns aggregated closed-trade statistics grouped by symbol for the authenticated client login within the requested time range.",
        "operationId": "get_stats_close_summary",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Start UNIX timestamp"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "End UNIX timestamp"
          },
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Client account login"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "structure": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Ordered field list used in each row"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Per-symbol summary rows"
                    },
                    "info": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Aggregate totals for the requested period"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "structure": [
                    "symbol",
                    "orders",
                    "buylots",
                    "selllots",
                    "buyprice",
                    "sellprice",
                    "profit"
                  ],
                  "rows": [
                    [
                      "EURUSD",
                      12,
                      4.5,
                      3.0,
                      1.0821,
                      1.0834,
                      125.7
                    ],
                    [
                      "XAUUSD",
                      3,
                      1.0,
                      1.0,
                      2315.5,
                      2321.0,
                      -42.0
                    ]
                  ],
                  "info": {
                    "total_close_orders": 15,
                    "total_close_profit": 83.7
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "stats/GetCloseTradeSummaryLogin.md"
      }
    },
    "/stats/roi": {
      "get": {
        "tags": [
          "stats"
        ],
        "summary": "<span class=\"get badge\">GET</span> Get ROI Statistics",
        "description": "Returns account equity history for the authenticated client login within the requested time range.",
        "operationId": "get_stats_roi",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Start UNIX timestamp"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "End UNIX timestamp"
          },
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Client account login"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "structure": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Ordered field list used in each row"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Equity history rows"
                    },
                    "info": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Aggregate info for the requested period"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "structure": [
                    "create_time",
                    "balance",
                    "equity",
                    "profit",
                    "margin",
                    "margin_free"
                  ],
                  "rows": [
                    [
                      1733011200,
                      1000.0,
                      1025.5,
                      25.5,
                      100.0,
                      925.5
                    ],
                    [
                      1733014800,
                      1000.0,
                      1012.0,
                      12.0,
                      80.0,
                      932.0
                    ]
                  ],
                  "info": {
                    "max_equity": 1025.5,
                    "min_equity": 1012.0
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "stats/GetRoiByLogin.md"
      }
    },
    "/trade/cancel/group": {
      "delete": {
        "tags": [
          "trade"
        ],
        "summary": "CancelGroupPendingTrade",
        "description": "DELETE https://{some_domain}/trade/cancel/group",
        "operationId": "delete_trade_cancel_group",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "integer",
                    "description": "User account login ID whose pending orders will be cancelled"
                  },
                  "symbol": {
                    "type": "string",
                    "description": "Symbol filter (e.g. EURUSD)"
                  }
                },
                "required": [
                  "login"
                ]
              },
              "example": {
                "rows": [
                  {
                    "accepted": true,
                    "order": 123456,
                    "state": 9,
                    "login": 1001,
                    "symbol": "EURUSD",
                    "cmd": 2,
                    "volume": 100
                  }
                ],
                "matched": 1,
                "cancelled": 1,
                "failed": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "rows": [
                    {
                      "accepted": true,
                      "order": 123456,
                      "state": 9,
                      "login": 1001,
                      "symbol": "EURUSD",
                      "cmd": 2,
                      "volume": 100
                    },
                    {
                      "accepted": true,
                      "order": 123457,
                      "state": 9,
                      "login": 1001,
                      "symbol": "EURUSD",
                      "cmd": 3,
                      "volume": 100
                    }
                  ],
                  "matched": 2,
                  "cancelled": 2,
                  "failed": 0
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "No matching pending trades found for the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Matching orders were found, but none were accepted for cancellation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "trade/CancelGroupPendingTrade.md"
      }
    },
    "/trade/cancel": {
      "delete": {
        "tags": [
          "trade"
        ],
        "summary": "Cancel Pending Trade",
        "description": "Cancels a pending order for the authenticated client account.",
        "operationId": "delete_trade_cancel",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order": {
                    "type": "integer",
                    "description": "Pending order ID"
                  }
                },
                "required": [
                  "order"
                ]
              },
              "example": {
                "accepted": true,
                "order": 123456,
                "state": 9
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "accepted": true,
                  "order": 123456,
                  "state": 9
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "trade/CancelPendingTrade.md"
      }
    },
    "/trade/close/group": {
      "delete": {
        "tags": [
          "trade"
        ],
        "summary": "CloseGroupTrade",
        "description": "DELETE https://{some_domain}/trade/close/group",
        "operationId": "delete_trade_close_group",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "integer",
                    "description": "User account login ID whose positions will be closed"
                  },
                  "type": {
                    "type": "integer",
                    "description": "Close mode: 0 — all, 1 — only profitable (profit > 0), -1 — only losing (profit < 0)"
                  },
                  "symbol": {
                    "type": "string",
                    "description": "Symbol filter (e.g., EURUSD). If omitted, applies to all symbols"
                  },
                  "comment": {
                    "type": "string",
                    "description": "If provided, server sets comment to GROUP_CLOSE for affected orders"
                  }
                },
                "required": [
                  "login",
                  "type"
                ]
              },
              "example": {
                "rows": [
                  {
                    "accepted": true,
                    "order": 123456,
                    "state": 7,
                    "login": 1001,
                    "symbol": "EURUSD",
                    "cmd": 0,
                    "close_volume": 100
                  }
                ],
                "matched": 1,
                "closed": 1,
                "failed": 0
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "login": 1001,
                  "type": 0,
                  "symbol": "EURUSD",
                  "comment": "any value to tag group close"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "trade/CloseGroupTrade.md"
      }
    },
    "/trade/close": {
      "delete": {
        "tags": [
          "trade"
        ],
        "summary": "Close Trade",
        "description": "Closes an existing open trade order for the authenticated client account.",
        "operationId": "delete_trade_close",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order": {
                    "type": "integer",
                    "description": "Trade order ID"
                  },
                  "volume": {
                    "type": "integer",
                    "description": "Partial close volume in minimal lots"
                  },
                  "comment": {
                    "type": "string",
                    "description": "Optional comment"
                  },
                  "expiration": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Optional expiration timestamp"
                  }
                },
                "required": [
                  "order"
                ]
              },
              "example": {
                "accepted": true,
                "order": 123456,
                "state": 7,
                "login": 1001,
                "symbol": "EURUSD",
                "cmd": 0,
                "close_volume": 100
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "accepted": true,
                  "order": 123456,
                  "state": 7,
                  "login": 1001,
                  "symbol": "EURUSD",
                  "cmd": 0,
                  "close_volume": 100
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "404": {
            "description": "Trade was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "trade/CloseTrade.md"
      }
    },
    "/trades/export": {
      "post": {
        "tags": [
          "trade"
        ],
        "summary": "Export Trades By Login",
        "description": "Exports the full filtered trade list for the authenticated account into a file stored on the server.",
        "operationId": "post_trades_export",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tradeType": {
                    "type": "integer",
                    "description": "Trade type filter in range 0..4"
                  },
                  "format": {
                    "type": "string",
                    "description": "Output format: csv or excel"
                  },
                  "where": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Additional filter rules"
                  },
                  "whereNot": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Negated filter rules"
                  },
                  "whereIn": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Inclusion filter rules in [[field, [value1, value2, ...]], ...] format"
                  },
                  "whereNotIn": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Exclusion filter rules in [[field, [value1, value2, ...]], ...] format"
                  },
                  "whereBetween": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Range filter rules in [[field, [from, to]], ...] format"
                  },
                  "whereNotBetween": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Negative range filter rules in [[field, [from, to]], ...] format"
                  },
                  "orderBy": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Sort instructions"
                  },
                  "select": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "List of fields to export. If omitted or empty, the default column layout for the selected tradeType is used"
                  },
                  "total": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "List of numeric fields that must be summed in a final Total: row"
                  }
                },
                "required": [
                  "tradeType",
                  "format"
                ]
              },
              "example": {
                "tradeType": 1,
                "format": "csv",
                "select": [
                  "order",
                  "symbol",
                  "open_time",
                  "volume",
                  "profit",
                  "net_profit"
                ],
                "total": [
                  "volume",
                  "profit",
                  "net_profit"
                ],
                "where": [],
                "whereNot": [],
                "orderBy": [
                  [
                    "open_time",
                    "DESC"
                  ]
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "file_name": "550e8400-e29b-41d4-a716-446655440000.csv"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "trade/ExportTradesByLogin.md"
      }
    },
    "/trades/history/login": {
      "get": {
        "tags": [
          "trade"
        ],
        "summary": "Get History Trades",
        "description": "Returns closed trade history for a login within a time range.",
        "operationId": "get_trades_history_login",
        "parameters": [
          {
            "name": "login",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Account login"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Range start timestamp"
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Range end timestamp"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "order",
                    "login",
                    "cmd",
                    "state",
                    "symbol",
                    "reason",
                    "volume",
                    "open_time",
                    "close_time",
                    "open_price",
                    "close_price",
                    "sl",
                    "tp",
                    "profit",
                    "commission",
                    "storage",
                    "comment",
                    "digits",
                    "expiration"
                  ],
                  "rows": [
                    [
                      1001234,
                      1001,
                      0,
                      2,
                      "EURUSD",
                      2,
                      100,
                      1713400000,
                      1713500000,
                      1.101,
                      1.104,
                      1.09,
                      1.12,
                      30.0,
                      -1.2,
                      -0.4,
                      "",
                      5,
                      0
                    ]
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "trade/GetHistoryTrades.md"
      }
    },
    "/trades": {
      "get": {
        "tags": [
          "trade"
        ],
        "summary": "Get Open Trades",
        "description": "Returns a paginated trade table for the authenticated account.",
        "operationId": "get_trades",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Maximum number of rows to return"
          },
          {
            "name": "offset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Pagination offset"
          },
          {
            "name": "tradeType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Trade type filter"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Additional filter rules"
          },
          {
            "name": "whereNot",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Negated filter rules"
          },
          {
            "name": "whereIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Inclusion filter rules in [[field, [value1, value2, ...]], ...] format"
          },
          {
            "name": "whereNotIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Exclusion filter rules in [[field, [value1, value2, ...]], ...] format"
          },
          {
            "name": "whereBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Range filter rules in [[field, [from, to]], ...] format"
          },
          {
            "name": "whereNotBetween",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "description": "Negative range filter rules in [[field, [from, to]], ...] format"
          }
        ],
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "structure": [
                    "order",
                    "login",
                    "cmd",
                    "state",
                    "symbol",
                    "reason",
                    "volume",
                    "open_time",
                    "close_time",
                    "open_price",
                    "close_price",
                    "sl",
                    "tp",
                    "profit",
                    "net_profit",
                    "commission",
                    "storage",
                    "comment",
                    "digits",
                    "expiration"
                  ],
                  "rows": [
                    [
                      1001234,
                      1001,
                      0,
                      1,
                      "EURUSD",
                      2,
                      100,
                      1713500000,
                      0,
                      1.101,
                      0,
                      1.09,
                      1.12,
                      0.0,
                      -1.6,
                      -1.2,
                      -0.4,
                      "",
                      5,
                      0
                    ]
                  ],
                  "count": 1,
                  "total_profit": 0.0,
                  "total_net_profit": -1.6,
                  "total_storage": -0.4,
                  "total_commission": -1.2,
                  "total_volume": 100
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "trade/GetOpenTrades.md"
      }
    },
    "/trade/modify": {
      "put": {
        "tags": [
          "trade"
        ],
        "summary": "ModifyOpenTrade",
        "description": "Modifies SL and/or TP for an existing open market position.",
        "operationId": "put_trade_modify",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order": {
                    "type": "integer",
                    "description": "Trade order ID"
                  },
                  "sl": {
                    "type": "number",
                    "description": "New Stop Loss"
                  },
                  "tp": {
                    "type": "number",
                    "description": "New Take Profit"
                  }
                },
                "required": [
                  "order"
                ]
              },
              "example": {
                "accepted": true,
                "order": 123456,
                "state": 14,
                "login": 1001,
                "symbol": "EURUSD",
                "cmd": 0,
                "volume": 100
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "accepted": true,
                  "order": 123456,
                  "state": 14,
                  "login": 1001,
                  "symbol": "EURUSD",
                  "cmd": 0,
                  "volume": 100
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "trade/ModifyOpenTrade.md",
        "x-source-files": [
          "trade/ModifyOpenTrade.md",
          "trade/ModifyTrade.md"
        ]
      }
    },
    "/trade/modify/pending": {
      "put": {
        "tags": [
          "trade"
        ],
        "summary": "ModifyPendingTrade",
        "description": "Modifies a pending order.",
        "operationId": "put_trade_modify_pending",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order": {
                    "type": "integer",
                    "description": "Pending order ID"
                  },
                  "open_price": {
                    "type": "number",
                    "description": "New activation price"
                  },
                  "sl": {
                    "type": "number",
                    "description": "New Stop Loss"
                  },
                  "tp": {
                    "type": "number",
                    "description": "New Take Profit"
                  },
                  "expiration": {
                    "type": "integer",
                    "format": "int64",
                    "description": "New expiration timestamp, 0 clears expiration"
                  }
                },
                "required": [
                  "order"
                ]
              },
              "example": {
                "accepted": true,
                "order": 123456,
                "state": 16,
                "login": 1001,
                "symbol": "EURUSD",
                "cmd": 2,
                "volume": 100
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "accepted": true,
                  "order": 123456,
                  "state": 16,
                  "login": 1001,
                  "symbol": "EURUSD",
                  "cmd": 2,
                  "volume": 100
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "trade/ModifyPendingTrade.md"
      }
    },
    "/trade/open/pending": {
      "post": {
        "tags": [
          "trade"
        ],
        "summary": "OpenPendingTrade",
        "description": "Opens a new pending trade order.",
        "operationId": "post_trade_open_pending",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "integer",
                    "description": "User account login ID"
                  },
                  "cmd": {
                    "type": "integer",
                    "description": "Pending command type only: 2=BUY_LIMIT, 3=SELL_LIMIT, 4=BUY_STOP, 5=SELL_STOP"
                  },
                  "volume": {
                    "type": "integer",
                    "description": "Trade volume in minimal lots"
                  },
                  "symbol": {
                    "type": "string",
                    "description": "Trading symbol"
                  },
                  "open_price": {
                    "type": "number",
                    "description": "Pending activation price"
                  },
                  "sl": {
                    "type": "number",
                    "description": "Stop Loss level (>= 0)"
                  },
                  "tp": {
                    "type": "number",
                    "description": "Take Profit level (>= 0)"
                  },
                  "expiration": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Expiration time (epoch timestamp)"
                  },
                  "comment": {
                    "type": "string",
                    "description": "Custom user comment"
                  }
                },
                "required": [
                  "login",
                  "cmd",
                  "volume",
                  "symbol",
                  "open_price",
                  "sl",
                  "tp"
                ]
              },
              "example": {
                "accepted": true,
                "order": 1001234,
                "state": 1,
                "login": 1001,
                "symbol": "EURUSD",
                "cmd": 2,
                "volume": 100
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "login": 1001,
                  "cmd": 2,
                  "volume": 100,
                  "symbol": "EURUSD",
                  "open_price": 1.085,
                  "sl": 1.08,
                  "tp": 1.095,
                  "expiration": 1760000000,
                  "comment": "pending entry"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "409": {
            "description": "OpenPendingTrade accepts only pending commands",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-source-file": "trade/OpenPendingTrade.md"
      }
    },
    "/trade/open": {
      "post": {
        "tags": [
          "trade"
        ],
        "summary": "Open Trade",
        "description": "Opens a new market order for the authenticated client account.",
        "operationId": "post_trade_open",
        "security": [
          {
            "ApiTokenAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "integer",
                    "description": "Account login. Must match the authenticated session"
                  },
                  "cmd": {
                    "type": "integer",
                    "description": "Market command only: 0=BUY, 1=SELL"
                  },
                  "volume": {
                    "type": "integer",
                    "description": "Trade volume in minimal lots"
                  },
                  "symbol": {
                    "type": "string",
                    "description": "Trading symbol"
                  },
                  "sl": {
                    "type": "number",
                    "description": "Stop Loss level"
                  },
                  "tp": {
                    "type": "number",
                    "description": "Take Profit level"
                  },
                  "open_price": {
                    "type": "number",
                    "description": "Optional requested open price"
                  },
                  "expiration": {
                    "type": "integer",
                    "format": "int64",
                    "description": "Optional expiration timestamp"
                  },
                  "comment": {
                    "type": "string",
                    "description": "Optional trade comment"
                  }
                },
                "required": [
                  "login",
                  "cmd",
                  "volume",
                  "symbol",
                  "sl",
                  "tp"
                ]
              },
              "example": {
                "accepted": true,
                "order": 1001234,
                "state": 1,
                "login": 1001,
                "symbol": "EURUSD",
                "cmd": 0,
                "volume": 100
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                },
                "example": {
                  "accepted": true,
                  "order": 1001234,
                  "state": 1,
                  "login": 1001,
                  "symbol": "EURUSD",
                  "cmd": 0,
                  "volume": 100
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        },
        "x-source-file": "trade/OpenTrade.md"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiTokenAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "JWT token as documented by the API pages."
      }
    },
    "schemas": {
      "GenericResponse": {
        "type": "object",
        "additionalProperties": true,
        "description": "Endpoint-specific response. See examples and source documentation."
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Validation error or bad request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication failed or missing authorization.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Authenticated but not allowed to access the resource.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Internal server error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    }
  },
  "x-generated-from": "docs/client-api/rest",
  "x-operation-count": 91,
  "x-docs-skipped": [
    "auth/check-session.md",
    "auth/signup.md",
    "customer/auth.md",
    "script/GetScriptByLogin.md",
    "settings/DeleteSetting.md",
    "settings/GetSettingsByLogin.md",
    "settings/SetSetting.md",
    "trade/GetAssetsList.md",
    "trade/GetMarketInfo.md"
  ]
}
