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

# Get ClearLoop Settlements



## OpenAPI

````yaml /copper-open-api-public.json get /clearloop/settlements
openapi: 3.1.0
info:
  description: >-
    Copper API is based on the REST API interface provided for data exchange
    between a client and a server with the use of HTTPS requests and responses.

    By default, the request should include a Content-Type header set as
    application/json. Some requests require different header fields, as well as
    other Content-Type values. In this case, a proper header will be stated in
    an example.

    When interacting with the API, please note that all numerical values, such
    as order amounts or timestamps, should be transmitted as strings. This
    ensures consistent data representation and prevents potential issues with
    floating-point precision
  title: Copper Platform API
  version: latest
servers:
  - description: platform.copper.co
    url: https://api.copper.co/platform
  - description: demo.copper.co
    url: https://api.stage.copper.co/platform
  - description: testnet.copper.co
    url: https://api.testnet.copper.co/platform
security: []
tags:
  - name: reports
  - name: deposit-targets
  - name: lending
  - name: portfolios
  - name: wallets
  - name: network
  - name: stake
  - name: blockchain
  - name: organizations
  - name: files
  - name: orders
  - name: address-book
  - name: clearloop
  - name: currencies
paths:
  /clearloop/settlements:
    get:
      tags:
        - clearloop
      summary: Get ClearLoop Settlements
      parameters:
        - description: Unique Copper account identifier for which records can be retrieved
          in: query
          name: portfolioId
          required: false
          schema:
            type: string
        - description: >-
            Exchange account unique identifier for which records can be
            retrieved
          in: query
          name: clientAccountId
          required: false
          schema:
            type: string
        - description: >-
            Unique exchange settlement identifier per instruction, defined by
            client account and settlement currency. Guaranteed to be unique
            within each exchange.
          in: query
          name: exchangeSettlementId
          required: false
          schema:
            type: string
        - description: >-
            Unix timestamp in milliseconds to filter settlements created after
            this time
          in: query
          name: createdAfter
          required: false
          schema:
            type: string
        - description: >-
            Unix timestamp in milliseconds to filter settlements created before
            this time
          in: query
          name: createdBefore
          required: false
          schema:
            type: string
        - description: >-
            Unix timestamp (in milliseconds) of the date and time when the
            settlement cycle has started
          in: query
          name: cycleStartTimestamp
          required: false
          schema:
            type: string
        - description: >-
            The number of most recent cycles that you want to retrieve for every
            exchange. For example, specifying 1 will return the last settlement
            for every queried exchange
          in: query
          name: cycles
          required: false
          schema:
            type: string
        - description: >-
            Comma separated list with statuses to be included. [See
            details](/enums/ClearLoopSettlementStatus)
          in: query
          name: clearLoopSettlementStatuses
          required: false
          schema:
            items:
              $ref: '#/components/schemas/ClearLoopSettlementStatus'
            type: array
        - description: >-
            Comma separated list with statuses not to be included. [See
            details](/enums/ClearLoopSettlementStatus)
          in: query
          name: clearLoopSettlementStatusesNotIn
          required: false
          schema:
            items:
              $ref: '#/components/schemas/ClearLoopSettlementStatus'
            type: array
        - description: Maximum number of records to return (pagination limit)
          in: query
          name: limit
          required: false
          schema:
            default: '1000'
            type: string
        - description: >-
            The sorting order of settlement records, which are sorted by their
            `createdAt` field: `asc` (ascending) or `desc` (descending)
          in: query
          name: sortDirection
          required: false
          schema:
            default: asc
            type: string
        - description: >-
            Number of records to skip before starting to return results
            (pagination offset)
          in: query
          name: offset
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClearLoopSettlementsResponseV2'
          description: OK
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: The machine-readable error code
                    examples:
                      - bad-request
                    type: string
                  message:
                    description: >-
                      A human-readable message providing more details about the
                      error
                    type: string
                type: object
          description: Bad Request
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: The machine-readable error code
                    examples:
                      - forbidden
                    type: string
                  message:
                    description: >-
                      A human-readable message providing more details about the
                      error
                    type: string
                type: object
          description: Forbidden
        '409':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: The machine-readable error code
                    examples:
                      - conflict
                    type: string
                  message:
                    description: >-
                      A human-readable message providing more details about the
                      error
                    type: string
                type: object
          description: Conflict
components:
  schemas:
    ClearLoopSettlementStatus:
      enum:
        - new
        - pending-exchange-confirmation
        - in-progress
        - completed
        - failed
        - cancelled
        - partially-completed
        - ignored
        - on-chain-orders-in-progress
        - excluded
      type: string
    ClearLoopSettlementsResponseV2:
      properties:
        pagination:
          $ref: '#/components/schemas/ClearLoopPagination'
          type: object
        settlements:
          items:
            $ref: '#/components/schemas/ClearLoopSettlementV2'
          type: array
      required:
        - settlements
      type: object
    ClearLoopPagination:
      properties:
        limit:
          description: Numerical limit of records for any given page
          type: string
        page:
          description: Current page index (numerical)
          type: string
        pages:
          description: Total number of pages matching the query
          type: string
        totalItems:
          description: Total number of records returned
          type: string
      type: object
    ClearLoopSettlementV2:
      properties:
        completedAt:
          description: >-
            Unix timestamp (in milliseconds) of the date and time when the
            settlement was fully completed
          type: string
        createdAt:
          description: >-
            Unix timestamp (in milliseconds) of the date and time when the
            settlement started
          type: string
        custodian:
          description: Custodian associated to settlement
          type: string
        cycleEndTimestamp:
          description: >-
            Unix timestamp (in milliseconds) of the date and time when the
            settlement cycle has ended
          type: string
        cycleStartTimestamp:
          description: >-
            Unix timestamp (in milliseconds) of the date and time when the
            settlement cycle has started
          type: string
        deadline:
          description: Unix timestamp (in milliseconds) of the settlement deadline
          type: string
        exchange:
          description: Exchange name
          type: string
        exchangeId:
          description: Exchange identifier
          type: string
        failureReason:
          type: string
        settlementDetails:
          description: >-
            Array of settlement detail records for each client account linked to
            a given settlement ID
          items:
            $ref: '#/components/schemas/ClearLoopSettlementDetails'
          type: array
        settlementId:
          description: Unique Copper settlement identifier
          type: string
        settlementStatus:
          $ref: '#/components/schemas/ClearLoopSettlementStatus'
          description: >-
            Status describing the settlement. [See
            details](/enums/ClearLoopSettlementStatus)
        settlementSubStatus:
          $ref: '#/components/schemas/ClearLoopSettlementSubStatus'
          description: >-
            Sub-status providing additional context to the status of the
            settlement
      required:
        - settlementId
        - settlementStatus
        - settlementSubStatus
        - cycleStartTimestamp
        - exchange
        - exchangeId
      type: object
    ClearLoopSettlementDetails:
      properties:
        clientAccountId:
          description: Unique exchange account identifier
          type: string
        exchangeSettlementId:
          description: Unique identifier assigned by the exchange for the settlement
          type: string
        exclusionDetails:
          $ref: '#/components/schemas/ClearLoopSettlementExclusionDetails'
          description: Exclusion details
          type: object
        organizationId:
          description: >-
            Unique identifier for the client organisation tied to a settlement
            record
          type: string
        pnlAttributionEndTimestamp:
          description: >-
            Unix timestamp (in milliseconds) of the end of the period used to
            attribute profit and loss (PnL) for the settlement
          type: string
        pnlAttributionStartTimestamp:
          description: >-
            Unix timestamp (in milliseconds) of the start of the period used to
            attribute profit and loss (PnL) for the settlement
          type: string
        portfolioId:
          description: Unique Copper account identifier
          type: string
        settlementInstructions:
          description: >-
            Array of settlement instruction records, grouped by settlement
            currency and client account, linked to a given settlement ID
          items:
            $ref: '#/components/schemas/ClearLoopSettlementInstruction'
          type: array
        status:
          $ref: '#/components/schemas/ClearLoopSettlementStatus'
          description: >-
            Client settlement status. [See
            details](/enums/ClearLoopSettlementStatus)
      required:
        - portfolioId
        - clientAccountId
        - exchangeSettlementId
        - settlementInstructions
      type: object
    ClearLoopSettlementSubStatus:
      enum: []
      type: string
    ClearLoopSettlementExclusionDetails:
      properties:
        exclusionReason:
          description: Settlement exclusion reason
          type: string
        exclusionSettlementId:
          description: >-
            Exclusion settlement identifier, if the client has been excluded
            from a settlement cycle.
          type: string
      required:
        - exclusionReason
      type: object
    ClearLoopSettlementInstruction:
      properties:
        balance:
          description: >-
            Client's delegated balance in Copper, fetched at the time of
            settlement
          type: string
        currency:
          description: Settlement currency
          type: string
        orderId:
          description: >-
            Identifier of the order linked to the settlement for the specified
            client account and currency
          type: string
        orderStatus:
          $ref: '#/components/schemas/OrderStatus'
          description: >-
            Status of the order associated with the settlement for the given
            client account and currency. [See details](/enums/OrderStatus)
        settlementAmount:
          description: >-
            Aggregate amount to be settled across main and subaccounts within
            the exchange
          type: string
        settlementAmountUSD:
          description: USD equivalent of the `settlementAmount`
          type: string
        settlementInstructionId:
          description: >-
            Unique identifier for the settlement instruction (per client account
            and currency per cycle)
          type: string
        status:
          $ref: '#/components/schemas/ClearLoopSettlementStatus'
          description: >-
            Status of the settlement at client account and currency level. [See
            details](/enums/ClearLoopSettlementStatus)
      required:
        - currency
        - settlementAmount
      type: object
    OrderStatus:
      enum:
        - new
        - waiting-funds
        - reserving
        - reserved
        - queued
        - validating-funds
        - working
        - waiting-approve
        - co-sign-require
        - approved
        - processing
        - executed
        - canceled
        - rejecting
        - rejected
        - declining
        - declined
        - suspending
        - suspended
        - blocked
        - action-required
        - accepting
        - accepted
        - require-initializer-approve
        - waiting-counterparty-approve
        - require-counterparty-approve
        - ready-for-settlement
        - settled
        - part-signed-tx-added
        - full-signed-tx-added
        - rejected-part-signed-tx-added
        - rejected-full-signed-tx-added
        - accepted-part-signed-tx-added
        - accepted-full-signed-tx-added
        - awaiting-settlement
        - master-password-required
        - manual-resolving
        - error
        - pending-atomic-settlement-confirmation
        - atomic-settlement-reservation-completed
        - require-finalize
        - waiting-accept-deposit
        - waiting-reject-deposit
      type: string

````