openapi: 3.1.0
info:
  title: Light Horse Cash Management API
  version: 1.0.0
  description: API for managing cash transfers and linked banks.
  contact:
    name: Light Horse Support
    url: https://www.lighthorse.io
    email: support@lighthorse.io
  license:
    name: Proprietary
tags:
  - name: Account
    description: Account balance and state.
  - name: Positions
    description: Open positions for an account.
  - name: Orders
    description: Order management — history, preview, placement, and cancellation.
  - name: Cash
    description: Deposit, withdraw operations
servers:
  - url: https://interface.lighthorse.io/open-api/account-center/v1
    description: Production with cryptographic signatures authentication
  - url: https://interface.lighthorse.io/api/account-center/v1
    description: Production with access tokens authentication
security:
  - SignatureAuth: []

components:
  securitySchemes:
    SignatureAuth:
      type: apiKey
      in: header
      name: X-Signature
      description: Cryptographic signature authentication

paths:
  /cash/{accountId}/ach/transfers:
    get:
      operationId: getTransfers
      tags: [Cash]
      summary: List Transfers
      description: Returns a paginated list of transfer records for the specified account identifier.
      parameters:
        - name: accountId
          in: path
          required: true
          schema:
            type: string
          description: Unique account identifier
          example: "lh000000000001"
        - name: pageNum
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
          description: Page number (1-based)
          example: 1
        - name: pageSize
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
          description: Number of records per page
          example: 10
      responses:
        '200':
          description: Paginated list of transfers
          content:
            application/json:
              schema:
                type: object
                required:
                  - s
                  - d
                properties:
                  s:
                    type: string
                    enum: [ok, error]
                    description: Response status indicator
                  d:
                    type: object
                    required:
                      - pageNum
                      - pageSize
                      - sort
                      - total
                      - list
                    properties:
                      pageNum:
                        type: integer
                        description: Current page number
                        example: 1
                      pageSize:
                        type: integer
                        description: Number of records per page
                        example: 10
                      sort:
                        type: string
                        enum: [ASC, DESC]
                        description: Sort order of results
                        example: ASC
                      total:
                        type: integer
                        description: Total number of records
                        example: 71
                      list:
                        type: array
                        items:
                          type: object
                          properties:
                            serialNo:
                              type: string
                              description: Unique serial number for the transfer record
                              example: "20260129000082718"
                            currDate:
                              type: integer
                              description: Transfer initiation date in YYYYMMDD format
                              example: 20260129
                            currTime:
                              type: string
                              description: Transfer initiation time in HH:mm:ss format
                              example: "13:28:30"
                            bankCode:
                              type: string
                              description: Masked bank account number
                              example: "**** **** ****"
                            amount:
                              type: string
                              description: Transfer amount in USD
                              example: "10"
                            transferId:
                              type: string
                              description: Unique transfer identifier
                              example: "20260129181936"
                            fundType:
                              type: string
                              description: "Fund type: 0 = Deposit, 1 = Withdrawal"
                              example: "1"
                            fundChannel:
                              type: string
                              description: "Fund channel: 0 = ACH"
                              example: "0"
                            transStatus:
                              type: string
                              description: "Transaction status code: 1 = Completed, 3 = Canceled"
                              example: "1"
                            remark:
                              type: string
                              description: Last known status description
                              example: "Requested"
                            userId:
                              type: string
                              description: Internal user identifier
                              example: "3000000000"
                            apexStatus:
                              type: string
                              description: Clearing firm status
                              example: "Completed"
                            endDate:
                              type: integer
                              description: Transfer completion date in YYYYMMDD format
                              example: 20260129
                            endTime:
                              type: string
                              description: Transfer completion time in HH:mm:ss format
                              example: "16:32:00"
                            achRelationshipId:
                              type: string
                              description: ACH bank relationship identifier
                              example: "679240553ae1fc08145c63fa"
                            bankRoutingNumber:
                              type: string
                              description: Bank routing number
                              example: "XXXXXXXX"
                            tradeAccount:
                              type: string
                              description: Account id
                              example: "lh000000000001"
                            processStatus:
                              type: string
                              description: Current processing status
                              example: "COMPLETED"
                            cancelStatus:
                              type: string
                              enum: [NORMAL, CANCELLED]
                              description: Cancellation status
                              example: "NORMAL"
                  errormsg:
                    type: ['string', 'null']
                    description: Error message when s is not ok
              example:
                s: ok
                d:
                  pageNum: 1
                  pageSize: 10
                  sort: ASC
                  total: 71
                  list:
                    - serialNo: "20260129000082718"
                      currDate: 20260129
                      currTime: "13:28:30"
                      bankCode: "**** **** ****"
                      amount: "10"
                      transferId: "20260129181936"
                      fundType: "1"
                      fundChannel: "0"
                      transStatus: "1"
                      remark: "Requested"
                      userId: "3000000049"
                      apexStatus: "Completed"
                      endDate: 20260129
                      endTime: "16:32:00"
                      achRelationshipId: "679240553ae1fc08145c63fa"
                      bankRoutingNumber: "XXXXXXXX"
                      tradeAccount: "lh000000000001"
                      processStatus: "COMPLETED"
                      cancelStatus: "NORMAL"
                errormsg: null
        '401':
          description: Unauthorized — missing or invalid authentication
          content:
            application/json:
              schema:
                type: object
                required:
                  - s
                  - errormsg
                properties:
                  s:
                    type: string
                    enum: [error]
                  errormsg:
                    type: string
              example:
                s: error
                errormsg: "Unauthorized"
    post:
      operationId: createTransfer
      tags: [Cash]
      summary: Create Transfer
      description: Initiates a new ACH deposit or withdrawal for the specified account.
      parameters:
        - name: accountId
          in: path
          required: true
          schema:
            type: string
          description: Unique account identifier
          example: "lh000000000001"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: string
                  description: Transfer balance
                  example: "100"
                fundType:
                  type: string
                  enum: ["0", "1"]
                  description: "Transfer direction: 0 = deposit; 1 = withdraw"
                  example: "0"
            example:
              amount: "100"
              fundType: "0"
      responses:
        '200':
          description: Transfer created successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - s
                  - d
                properties:
                  s:
                    type: string
                    enum: [ok, error]
                    description: Response status indicator
                  d:
                    type: object
                    properties:
                      serialNo:
                        type: string
                        description: Unique serial number for the transfer record
                        example: "20260129000082718"
                      currDate:
                        type: integer
                        description: Transfer initiation date in YYYYMMDD format
                        example: 20260129
                      currTime:
                        type: string
                        description: Transfer initiation time in HH:mm:ss format
                        example: "13:28:30"
                      bankCode:
                        type: string
                        description: Masked bank account number
                        example: "**** **** ****"
                      amount:
                        type: string
                        description: Transfer amount in USD
                        example: "10"
                      transferId:
                        type: string
                        description: Unique transfer identifier
                        example: "20260129181936"
                      fundType:
                        type: string
                        description: "Fund type: 0 = Deposit, 1 = Withdrawal"
                        example: "1"
                      fundChannel:
                        type: string
                        description: "Fund channel: 0 = ACH"
                        example: "0"
                      transStatus:
                        type: string
                        description: "Transaction status code: 1 = Completed, 3 = Canceled"
                        example: "1"
                      remark:
                        type: string
                        description: Last known status description
                        example: "Requested"
                      userId:
                        type: string
                        description: Internal user identifier
                        example: "3000000000"
                      apexStatus:
                        type: string
                        description: Clearing firm status
                        example: "Completed"
                      endDate:
                        type: integer
                        description: Transfer completion date in YYYYMMDD format
                        example: 20260129
                      endTime:
                        type: string
                        description: Transfer completion time in HH:mm:ss format
                        example: "16:32:00"
                      achRelationshipId:
                        type: string
                        description: ACH bank relationship identifier
                        example: "679240553ae1fc08145c63fa"
                      bankRoutingNumber:
                        type: string
                        description: Bank routing number
                        example: "XXXXXXXX"
                      tradeAccount:
                        type: string
                        description: Account id
                        example: "lh000000000001"
                      processStatus:
                        type: string
                        description: Current processing status
                        example: "COMPLETED"
                      cancelStatus:
                        type: string
                        enum: [NORMAL, CANCELLED]
                        description: Cancellation status
                        example: "NORMAL"
                  errormsg:
                    type: ['string', 'null']
                    description: Error message when s is not ok
              example:
                s: ok
                d:
                  serialNo: "20260129000082718"
                  currDate: 20260129
                  currTime: "13:28:30"
                  bankCode: "**** **** ****"
                  amount: "10"
                  transferId: "20260129181936"
                  fundType: "1"
                  fundChannel: "0"
                  transStatus: "1"
                  remark: "Requested"
                  userId: "3000000000"
                  apexStatus: "Completed"
                  endDate: 20260129
                  endTime: "16:32:00"
                  achRelationshipId: "679240553ae1fc08145c63fa"
                  bankRoutingNumber: "XXXXXXXX"
                  tradeAccount: "lh000000000001"
                  processStatus: "COMPLETED"
                  cancelStatus: "NORMAL"
                errormsg: null
        '401':
          description: Unauthorized — missing or invalid authentication
          content:
            application/json:
              schema:
                type: object
                required:
                  - s
                  - errormsg
                properties:
                  s:
                    type: string
                    enum: [error]
                  errormsg:
                    type: string
              example:
                s: error
                errormsg: "Unauthorized"
