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

# List Unlinked CDRs

> Fetch a list of Charge Detail Records that are eligible for reimbursement, but not yet linked to an expense.



## OpenAPI

````yaml /openapi/reimbursement/expenses/openapi.yaml get /v1/expenses/{expenseId}/charge-detail-records/unlinked
openapi: 3.0.3
info:
  title: Reimbursement
  description: API for managing reimbursement expenses.
  version: '1.0'
servers:
  - url: https://api.spirii.com/reimbursement
security:
  - BearerAuth: []
tags:
  - name: Reimbursement Expenses
    description: Operations related to expense reimbursement.
paths:
  /v1/expenses/{expenseId}/charge-detail-records/unlinked:
    get:
      tags:
        - Reimbursement Expenses
      summary: List Unlinked CDRs
      description: >-
        Fetch a list of Charge Detail Records that are eligible for
        reimbursement, but not yet linked to an expense.
      operationId: getNonLinkedCDRs
      parameters:
        - $ref: '#/components/parameters/expenseId_path'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/sortByCDR'
        - $ref: '#/components/parameters/sortDirection'
      responses:
        '200':
          description: Returns a paginated list of CDRs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedChargeDetailRecord'
        '403':
          description: The Expense ID provided is not related to user's operator.
        '404':
          description: Could not find Expense with the ID provided.
        default:
          $ref: '#/components/responses/ProblemDetail'
components:
  parameters:
    expenseId_path:
      name: expenseId
      required: true
      in: path
      description: Unique identifier of the Expense.
      schema:
        type: string
        format: uuid
        example: f570bb7a-180a-4f82-bc13-eedf3573de43
    limit:
      name: limit
      in: query
      required: false
      description: Maximum number of items to return per page.
      schema:
        type: integer
        minimum: 1
        maximum: 500
        default: 20
    page:
      name: page
      in: query
      required: false
      description: Page number, starting at 1.
      schema:
        type: integer
        minimum: 1
        default: 1
    sortByCDR:
      name: sortBy
      in: query
      required: false
      description: Field to sort the CDR list by.
      schema:
        type: string
        enum:
          - consumedInWattHours
          - endedAt
          - id
          - locationName
          - startedAt
          - transactionId
        default: endedAt
    sortDirection:
      name: sortDirection
      in: query
      required: false
      description: The ordering direction.
      schema:
        type: string
        enum:
          - ASC
          - DESC
        default: DESC
  schemas:
    PaginatedChargeDetailRecord:
      type: object
      properties:
        data:
          readOnly: true
          type: array
          description: The items on the current page.
          items:
            $ref: '#/components/schemas/ChargeDetailRecord'
        pagination:
          description: Pagination metadata for navigating result pages.
          allOf:
            - $ref: '#/components/schemas/PaginationMeta'
      required:
        - data
        - pagination
    ChargeDetailRecord:
      type: object
      properties:
        amountInCents:
          type: number
          nullable: true
          description: >-
            Cost of this charging session, in the smallest currency unit (e.g.
            cents).
        authIdTag:
          $ref: '#/components/schemas/AuthIdTag'
        consumedInWattHours:
          type: number
          nullable: true
          description: Energy consumed during this charging session, in watt-hours.
        chargingTime:
          type: object
          description: Duration of the charging session.
          properties:
            days:
              type: integer
              nullable: true
            hours:
              type: integer
              nullable: true
            minutes:
              type: integer
              nullable: true
            seconds:
              type: integer
              nullable: true
          nullable: true
        customerName:
          type: string
          nullable: true
          description: Name of the App User.
          example: John Doe
        endedAt:
          type: string
          format: date-time
          nullable: true
          description: End time of the transaction.
        locationName:
          type: string
          nullable: true
          description: Given name of the charging location.
        centsPerWh:
          type: number
          nullable: true
          description: Agreement or Reimbursement rate in cents per Wh.
        startedAt:
          type: string
          format: date-time
          nullable: true
          description: Start time of the transaction.
        tagIdLabel:
          deprecated: true
          type: string
          nullable: true
          description: >-
            Label of the authentication token. This is often printed on the
            physical token.
        transactionId:
          type: integer
          description: Spirii ID of the transaction. Also shared with the charger.
      required:
        - transactionId
    PaginationMeta:
      type: object
      readOnly: true
      properties:
        currentPage:
          readOnly: true
          type: integer
          description: The current page this paginator "points" to (indexed from 1).
          example: 3
        itemCount:
          readOnly: true
          type: integer
          description: The amount of items on this specific page.
          example: 20
        itemsPerPage:
          readOnly: true
          type: integer
          description: The amount of items that were requested per page.
          example: 25
        totalItems:
          readOnly: true
          type: integer
          nullable: true
          description: The total amount of items across all pages.
          example: 70
        totalPages:
          readOnly: true
          type: integer
          nullable: true
          description: The total amount of pages.
          example: 3
      required:
        - currentPage
        - itemCount
        - itemsPerPage
    ProblemDetail:
      type: object
      description: RFC 9457 problem details.
      properties:
        type:
          type: string
          example: about:blank
          description: >-
            A URI reference that identifies the problem type. When this member
            is not present, its value is assumed to be "about:blank".
          format: uri
        title:
          example: Bad Request
          description: >-
            A short, human-readable summary of the problem type. It should not
            change from occurrence to occurrence of the problem, except for
            purposes of localization.
          type: string
        status:
          example: 400
          description: >-
            The HTTP status code generated by the origin server for this
            occurrence of the problem.
          type: integer
        detail:
          example: Invalid request body
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          type: string
        instance:
          example: /v1/uri-called/
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          type: string
          format: uri-reference
        errors:
          example:
            - currentPage must be a positive integer
          description: >-
            Optional field containing additional error details, such as
            validation errors.
          type: array
          items:
            type: string
      required:
        - type
        - title
        - status
        - detail
        - instance
    AuthIdTag:
      type: object
      properties:
        uid:
          type: string
          description: >-
            UID of the authentication token. This is what the charger uses to
            authorise.
        label:
          type: string
          nullable: true
          description: >-
            Label of the authentication token. This is often printed on the
            physical token.
        billingReference:
          type: string
          nullable: true
          description: Additional billing reference on the token.
  responses:
    ProblemDetail:
      description: >-
        An error occurred. Returns a response body conforming to [RFC
        9457](https://www.rfc-editor.org/rfc/rfc9457).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
  securitySchemes:
    BearerAuth:
      scheme: bearer
      bearerFormat: JWT
      description: Authorization via a JWT bearer token.
      type: http

````