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

# List settlement windows

> Retrieves settlement windows with optional filters for merchant ID,
cycle ID, status, and/or date range. Supports pagination with page
and page_size parameters.




## OpenAPI

````yaml /openapi/account-settlement.json get /settlement/settlement-windows
openapi: 3.1.0
info:
  title: lite - Account Settlement
  version: 1.0.0
servers:
  - url: https://api.lite.sa/v1
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Settlement Windows
    description: Manage settlement windows for merchant payout cycles
  - name: Transactions
    description: Query settlement transactions and their details
paths:
  /settlement/settlement-windows:
    get:
      tags:
        - Settlement Windows
      summary: List settlement windows
      description: |
        Retrieves settlement windows with optional filters for merchant ID,
        cycle ID, status, and/or date range. Supports pagination with page
        and page_size parameters.
      operationId: lite.settlement.listSettlementWindows
      parameters:
        - $ref: '#/components/parameters/x-correlation-id'
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
          description: Page number (1-indexed)
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          description: Number of items per page
        - name: merchant_id
          in: query
          required: false
          schema:
            type: string
          description: Filter by merchant ID
        - name: cycle_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: Filter by cycle ID
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - OPENED
              - IN_PROGRESS
              - SUCCESS
              - FAILED
              - PARTIALLY_SUCCESS
          description: Filter by settlement window status
        - name: date_from
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: >-
            Filter settlement windows with value date from this date (ISO 8601
            format)
        - name: date_to
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: >-
            Filter settlement windows with value date up to this date (ISO 8601
            format)
      responses:
        '200':
          $ref: '#/components/responses/SettlementWindowList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    x-correlation-id:
      name: x-correlation-id
      in: header
      required: false
      description: >-
        Unique identifier for request tracing. Generated by the client or server
        if not provided.
      schema:
        type: string
        format: uuid
        example: 550e8400-e29b-41d4-a716-446655440000
  responses:
    SettlementWindowList:
      description: List of settlement windows retrieved successfully.
      content:
        application/json:
          schema:
            type: object
            required:
              - data
              - pagination_data
              - summary
            properties:
              data:
                type: array
                description: List of settlement windows
                items:
                  $ref: '#/components/schemas/SettlementWindow'
              pagination_data:
                $ref: '#/components/schemas/PaginationData'
              summary:
                $ref: '#/components/schemas/SettlementWindowSummary'
    Unauthorized:
      description: |
        Authentication failed — missing or invalid token.

        Returned when:
        - The JWT bearer token is missing, expired, or has an invalid signature
        - The API key is missing or invalid
        - The authenticated session token is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: >
        An unexpected error occurred on the server.


        Returned when an unhandled exception or infrastructure failure prevents
        the request from being processed. Retry the request with exponential
        backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    SettlementWindow:
      type: object
      description: A settlement window representing a merchant payout cycle
      required:
        - id
        - merchant_id
        - cycle_id
        - value_date
        - status
        - created_by
        - updated_by
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: Unique settlement window identifier
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        merchant_id:
          type: string
          description: Merchant identifier
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        cycle_id:
          type: string
          description: Settlement cycle identifier
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        value_date:
          type: string
          format: date-time
          description: Date that actual settlement should be sent
          example: '2024-01-01T23:59:59.000Z'
        closing_date:
          type: string
          format: date-time
          description: Date after all instructions are done and window is completed
          example: '2024-01-02T00:00:00.000Z'
        status:
          type: string
          description: Settlement window status
          oneOf:
            - title: Opened
              const: OPENED
              description: Window is open and accepting transactions
            - title: In Progress
              const: IN_PROGRESS
              description: Window is being processed
            - title: Success
              const: SUCCESS
              description: Window settled successfully
            - title: Failed
              const: FAILED
              description: Window settlement failed
            - title: Partially Success
              const: PARTIALLY_SUCCESS
              description: Window settled with partial success
        total_instructions:
          type: integer
          description: Total number of instructions in this window
          minimum: 0
          example: 5
        total_amount:
          type: integer
          description: Total sales amount in minor units
          minimum: 0
          example: 100000
        settled_amount:
          type: integer
          description: >-
            Total settled amount in minor units (sum of transaction settled
            amounts)
          minimum: 0
          example: 95000
        currency:
          type: string
          description: Currency code (ISO 4217)
          minLength: 3
          maxLength: 3
          pattern: ^[A-Z]{3}$
          example: USD
        created_by:
          type: string
          description: User who created the settlement window
          example: system
        updated_by:
          type: string
          description: User who last updated the settlement window
          example: system
        created_at:
          type: string
          format: date-time
          description: Creation timestamp
          example: '2024-01-01T00:00:00.000Z'
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
          example: '2024-01-01T00:00:00.000Z'
    PaginationData:
      type: object
      description: Pagination metadata for list responses
      required:
        - count
        - pages
        - page
        - page_size
        - has_next
        - has_previous
      properties:
        count:
          type: integer
          description: Total number of items matching the query
          minimum: 0
          example: 100
        pages:
          type: integer
          description: Total number of pages
          minimum: 0
          example: 4
        page:
          type: integer
          description: Current page number (1-indexed)
          minimum: 1
          example: 1
        page_size:
          type: integer
          description: Number of items per page
          minimum: 1
          example: 25
        has_next:
          type: boolean
          description: Whether there is a next page
          example: true
        has_previous:
          type: boolean
          description: Whether there is a previous page
          example: false
    SettlementWindowSummary:
      type: object
      description: Summary of settled amounts aggregated by settlement window status
      required:
        - opened
        - in_progress
        - success
        - failed
        - partially_success
        - total
        - by_currency
      properties:
        opened:
          type: integer
          description: Sum of settled amounts for OPENED status windows in minor units
          minimum: 0
          example: 500000
        in_progress:
          type: integer
          description: Sum of settled amounts for IN_PROGRESS status windows in minor units
          minimum: 0
          example: 1000000
        success:
          type: integer
          description: Sum of settled amounts for SUCCESS status windows in minor units
          minimum: 0
          example: 5000000
        failed:
          type: integer
          description: Sum of settled amounts for FAILED status windows in minor units
          minimum: 0
          example: 0
        partially_success:
          type: integer
          description: >-
            Sum of settled amounts for PARTIALLY_SUCCESS status windows in minor
            units
          minimum: 0
          example: 250000
        total:
          type: integer
          description: Total sum of all settled amounts across all statuses in minor units
          minimum: 0
          example: 6750000
        by_currency:
          type: array
          description: Summary per currency (use this when multiple currencies are present)
          items:
            $ref: '#/components/schemas/SettlementWindowSummaryByCurrency'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - timestamp
          properties:
            code:
              type: string
              description: Error code identifying the type of error
              example: PAYMENT_DETAILS_MISMATCH
            message:
              type: string
              description: Human-readable error description
              example: The request was invalid or malformed
            details:
              type: object
              description: Additional error details
            correlationId:
              type: string
              format: uuid
              description: Correlation ID for tracking the request
              example: 550e8400-e29b-41d4-a716-446655440000
            timestamp:
              type: string
              format: date-time
              description: Timestamp when the error occurred
              example: '2024-12-16T10:30:00.000Z'
    SettlementWindowSummaryByCurrency:
      type: object
      description: Settlement amount summary broken down by currency
      required:
        - currency
        - opened
        - in_progress
        - success
        - failed
        - partially_success
        - total
      properties:
        currency:
          type: string
          description: ISO 4217 currency code
          minLength: 3
          maxLength: 3
          pattern: ^[A-Z]{3}$
          example: USD
        opened:
          type: integer
          description: Sum of settled amounts for OPENED status windows in minor units
          minimum: 0
          example: 500000
        in_progress:
          type: integer
          description: Sum of settled amounts for IN_PROGRESS status windows in minor units
          minimum: 0
          example: 1000000
        success:
          type: integer
          description: Sum of settled amounts for SUCCESS status windows in minor units
          minimum: 0
          example: 5000000
        failed:
          type: integer
          description: Sum of settled amounts for FAILED status windows in minor units
          minimum: 0
          example: 0
        partially_success:
          type: integer
          description: >-
            Sum of settled amounts for PARTIALLY_SUCCESS status windows in minor
            units
          minimum: 0
          example: 250000
        total:
          type: integer
          description: Total sum of all settled amounts across all statuses in minor units
          minimum: 0
          example: 6750000
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for service-to-service or merchant authentication.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token obtained from user authentication. Passed as
        Authorization: Bearer <token>.

````