> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oms.verolabs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Gửi thông tin đăng nhập vào luồng login

> Gửi thông tin đăng nhập vào luồng login



## OpenAPI

````yaml openapi.docs.vi.json POST /api/authen/self-service/login
openapi: 3.0.3
info:
  title: Vero OMS REST API
  version: 1.0.24
  description: >-
    Tài liệu REST API cho Vero OMS. Path được đối chiếu với KrakenD config hiện
    tại trong k8s-dev-gitops/vero-algo/tools/krakend và schema response được bổ
    sung từ source backend/frontend.
servers:
  - url: https://api-gw.verolabs.co
    description: API gateway
security: []
tags:
  - name: Xác thực
    description: Luồng xác thực và đăng xuất
    x-original-name: Auth
  - name: Đăng ký
    description: API hỗ trợ luồng đăng ký tài khoản
  - name: Tài khoản
    description: Tài khoản người dùng, số dư, vị thế, nạp và rút tiền
    x-original-name: Accounts
  - name: Tài khoản ngân hàng
    description: Quản lý tài khoản ngân hàng đã lưu
    x-original-name: Bank Accounts
  - name: Lệnh
    description: Đặt lệnh, hủy lệnh, sửa lệnh và lịch sử lệnh
    x-original-name: Orders
  - name: Lịch sử
    description: Lệnh, khớp lệnh và giao dịch tiền của tài khoản.
    x-original-name: History
  - name: Dữ liệu thị trường
    description: Watchlist, tìm kiếm mã, dữ liệu sản phẩm và lịch sử OHLCV
    x-original-name: Market Data
  - name: Thông báo
    description: Thông báo trong ứng dụng
    x-original-name: Notifications
  - name: Giới thiệu
    description: Mã giới thiệu, rebate và tổng hợp hoa hồng
    x-original-name: Referral
  - name: Chẩn đoán
    description: Endpoint kiểm tra sức khỏe và chẩn đoán hệ thống
    x-original-name: Diagnostics
paths:
  /api/authen/self-service/login:
    post:
      tags:
        - Xác thực
      summary: Gửi thông tin đăng nhập vào luồng login
      operationId: submitLoginFlow
      parameters:
        - $ref: '#/components/parameters/Flow'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginFlowUpdateRequest'
        description: >-
          Payload cap nhat self-service flow. Truyen ma flow tren query string
          va gui cac field bat buoc cua method dang dung.
      responses:
        '200':
          description: >-
            Dang nhap thanh cong. Ung dung doc session_token trong payload nay
            va dung no lam token phien dang nhap.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResponse'
        '400':
          $ref: '#/components/responses/AuthFlowError'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
        '401':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
        '404':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
        '500':
          $ref: '#/components/responses/ErrorResponse'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
        default:
          $ref: '#/components/responses/Error'
          description: Response lỗi.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnyErrorBody'
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationProblemDetails'
                  - $ref: '#/components/schemas/ProblemDetails'
            text/plain:
              schema:
                type: string
                description: Thông điệp lỗi dạng text do backend hoặc gateway trả về.
      security: []
components:
  parameters:
    Flow:
      name: flow
      in: query
      required: true
      schema:
        type: string
      description: >-
        Ma flow duoc tra ve tu endpoint tao flow tuong ung. Khi submit/update
        flow phai truyen dung ma nay trong query flow.
  schemas:
    LoginFlowUpdateRequest:
      type: object
      required:
        - method
        - csrf_token
        - password_identifier
        - password
      properties:
        method:
          type: string
          enum:
            - password
          description: >-
            Phuong thuc xac thuc. Client gui password khi dang nhap bang mat
            khau.
        csrf_token:
          type: string
          description: CSRF token lay tu UI node cua login flow khi he thong yeu cau.
        password_identifier:
          type: string
          format: email
          description: Dinh danh dang nhap cua user. Ung dung gui email tai khoan.
        password:
          type: string
          format: password
          description: Mat khau dang plain text do user nhap. Chi gui qua HTTPS.
      description: >-
        JSON payload dung de submit thong tin dang nhap bang mat khau vao login
        flow.
    LoginResponse:
      type: object
      additionalProperties: true
      properties:
        session_token:
          type: string
          description: Bearer/session token client dung cho cac API can dang nhap.
        session:
          $ref: '#/components/schemas/AuthSession'
          description: session object cua identity da dang nhap.
        identity:
          type: object
          additionalProperties: true
          description: identity object, gom identity id va traits khi tra ve.
      description: Response tra ve sau khi API login flow thanh cong.
    AnyErrorBody:
      oneOf:
        - $ref: '#/components/schemas/ErrorResponse'
        - $ref: '#/components/schemas/ValidationProblemDetails'
        - $ref: '#/components/schemas/ProblemDetails'
        - $ref: '#/components/schemas/AuthFlow'
      description: >-
        Body lỗi có cấu trúc do gateway, ASP.NET service hoặc validation handler
        backend trả về.
    ValidationProblemDetails:
      allOf:
        - $ref: '#/components/schemas/ProblemDetails'
        - type: object
          additionalProperties: true
          properties:
            errors:
              type: object
              additionalProperties:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              description: Lỗi validation theo từng field request.
      description: Response lỗi validation khi param hoặc body field không hợp lệ.
    ProblemDetails:
      type: object
      additionalProperties: true
      description: Response lỗi kiểu RFC 7807 do ASP.NET/gateway trả về.
      properties:
        type:
          type: string
          description: URI loại lỗi.
        title:
          type: string
          description: Tiêu đề lỗi ngắn.
        status:
          type: integer
          description: Mã HTTP status.
        detail:
          type: string
          description: Thông điệp lỗi chi tiết.
        traceId:
          type: string
          description: Trace id để tra cứu lỗi backend.
    AuthSession:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: Ma session.
        active:
          type: boolean
          description: Cho biet session hien co dang active hay khong.
        identity:
          type: object
          additionalProperties: true
          properties:
            id:
              type: string
              description: Ma identity cua user da dang nhap.
            traits:
              type: object
              additionalProperties: true
              description: >-
                Thuoc tinh ho so identity luu tren he thong, vi du email va
                name.
            schema_id:
              type: string
              description: Ma identity schema.
            schema_url:
              type: string
              description: URL cua identity schema.
            state:
              type: string
              description: Trang thai identity, vi du active.
            state_changed_at:
              type: string
              description: Thoi diem trang thai identity thay doi lan cuoi.
              format: date-time
            recovery_addresses:
              type: array
              description: Danh sach recovery address cau hinh tren identity.
              items:
                type: object
                additionalProperties: true
            metadata_public:
              nullable: true
              description: Metadata public cua identity do he thong tra ve; co the null.
              type: object
              additionalProperties: true
            created_at:
              type: string
              description: Thoi diem tao identity.
              format: date-time
            updated_at:
              type: string
              description: Thoi diem cap nhat identity.
              format: date-time
            organization_id:
              type: string
              nullable: true
              description: >-
                Ma organization neu identity thuoc organization; null neu khong
                co.
          description: >-
            identity da dang nhap, gom id, schema metadata, state, traits,
            recovery addresses va timestamps.
        tokenized:
          type: string
          description: Bearer token tra ve khi truyen tokenize_as va tra tokenized session.
        expires_at:
          type: string
          description: Thoi diem session het han.
          format: date-time
        authenticated_at:
          type: string
          description: Thoi diem user xac thuc cho session nay.
          format: date-time
        authenticator_assurance_level:
          type: string
          description: Muc dam bao xac thuc cua session, vi du aal1.
        authentication_methods:
          type: array
          description: Cac phuong thuc xac thuc da hoan tat cho session.
          items:
            type: object
            additionalProperties: true
            properties:
              method:
                type: string
                description: Ten phuong thuc xac thuc, vi du password.
              aal:
                type: string
                description: Muc dam bao xac thuc cua phuong thuc nay.
              completed_at:
                type: string
                description: Thoi diem phuong thuc nay hoan tat.
                format: date-time
        issued_at:
          type: string
          description: Thoi diem he thong phat hanh session.
          format: date-time
        devices:
          type: array
          description: >-
            Metadata thiet bi/session do he thong tra ve, gom device id, IP
            address, user agent va location.
          items:
            type: object
            additionalProperties: true
            properties:
              id:
                type: string
                description: Ma thiet bi.
              ip_address:
                type: string
                description: Dia chi IP cua session/thiet bi.
              user_agent:
                type: string
                description: User agent cua session/thiet bi.
              location:
                type: string
                description: Chuoi location do he thong tra ve khi co.
      description: session tra ve boi whoami va login response.
    AuthFlow:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: >-
            Ma flow. Dung gia tri nay lam query parameter flow khi submit hoac
            update flow.
        type:
          type: string
          description: Loai flow do he thong tra ve, vi du browser hoac api.
        expires_at:
          type: string
          format: date-time
          description: Thoi diem flow het han. Can submit flow truoc thoi diem nay.
        issued_at:
          type: string
          format: date-time
          description: Thoi diem he thong tao flow.
        ui:
          type: object
          additionalProperties: true
          description: >-
            Payload UI cua gom action URL, method, nodes, messages va CSRF node
            khi can.
        state:
          type: string
          description: >-
            Trang thai hien tai cua flow, vi du choose_method, sent_email,
            passed_challenge hoac success.
        request_url:
          type: string
          description: URL request goc dung de tao flow.
        organization_id:
          type: string
          nullable: true
          description: Ma organization cho flow theo organization, khi co.
        created_at:
          type: string
          description: Thoi diem tao flow.
          format: date-time
        updated_at:
          type: string
          description: Thoi diem cap nhat flow.
          format: date-time
        refresh:
          type: boolean
          description: Cho biet flow co phai refresh flow hay khong.
        requested_aal:
          type: string
          description: Muc dam bao xac thuc duoc yeu cau cho flow.
        identity:
          allOf:
            - 18a8e28a-07b2-496a-8619-bacbc39b1aff
          description: Identity gan voi settings flow khi tra ve.
      description: >-
        self-service flow object duoc tra ve boi cac endpoint tao/cap nhat
        login, registration, recovery va settings flow.
    ErrorResponse:
      type: object
      additionalProperties: true
      description: >-
        Body loi do gateway hoac backend tra ve. Backend co the tra JSON object
        hoac loi dang plain text.
      properties:
        error:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
              properties:
                id:
                  type: string
                  description: Ma loi gateway khi co.
                code:
                  type: integer
                  description: Ma loi tuong duong HTTP.
                status:
                  type: string
                  description: Text trang thai HTTP, vi du Unauthorized.
                reason:
                  type: string
                  description: Ly do chi tiet do he thong hoac gateway tra ve.
                message:
                  type: string
                  description: Thong diep loi de doc.
          description: Chuoi ma/thong diep loi hoac object loi nested cua gateway.
        message:
          type: string
          description: Human-readable error message.
        detail:
          type: string
          description: Detailed backend error message when available.
        details:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
            - type: array
              items:
                type: object
                additionalProperties: true
          description: Chi tiết validation hoặc backend bổ sung.
          nullable: true
        status:
          type: integer
          description: HTTP status code when included by the backend.
  responses:
    AuthFlowError:
      description: Authentication flow validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthFlow'
    ErrorResponse:
      description: Error response containing an error code, message, detail, or plain text.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
        text/plain:
          schema:
            type: string
    Error:
      description: Error response. The app reads detail or message when available.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
        text/plain:
          schema:
            type: string

````