> ## 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.

# Retrieve the charge records data



## OpenAPI

````yaml /openapi/integrations-api/openapi.yml get /v1/charge-records
openapi: 3.0.0
info:
  title: Spirii Legacy API
  description: >-
    API for integration to Spirii CPO backend for charge point owners and charge
    point operators with access to whitelabel user data.
  version: 1.1.25
servers:
  - url: https://api.spirii.com/
    description: Production Environment
security: []
paths:
  /v1/charge-records:
    get:
      tags:
        - Charge Records
      summary: Retrieve the charge records data
      parameters:
        - $ref: '#/components/parameters/startedAt'
        - $ref: '#/components/parameters/updatedAt'
        - $ref: '#/components/parameters/updatedAtMax'
        - $ref: '#/components/parameters/endedAt'
        - $ref: '#/components/parameters/endedAtMax'
        - $ref: '#/components/parameters/locationIdQuery'
        - $ref: '#/components/parameters/voucherId'
        - $ref: '#/components/parameters/appUserIdQuery'
        - $ref: '#/components/parameters/idTagUid'
        - $ref: '#/components/parameters/sortBy'
        - $ref: '#/components/parameters/sortDir'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/format'
        - $ref: '#/components/parameters/output'
        - $ref: '#/components/parameters/delimiter'
        - $ref: '#/components/parameters/fieldSeparator'
        - $ref: '#/components/parameters/decimalSeparator'
      responses:
        '200':
          $ref: '#/components/responses/chargeRecordsList'
        '400':
          $ref: '#/components/responses/badRequest'
        '500':
          $ref: '#/components/responses/badImplementation'
components:
  parameters:
    startedAt:
      in: query
      name: startedAt
      description: >-
        Transaction started at (Both `startedAt` and `endedAt` cannot be applied
        to the same request)
      schema:
        type: string
        format: timestamp
        example: '2021-12-11T13:04:49.372Z'
    updatedAt:
      in: query
      name: updatedAt
      description: Transaction record updated date
      schema:
        type: string
        format: timestamp
        example: '2023-01-11T13:04:49.372Z'
    updatedAtMax:
      in: query
      name: updatedAtMax
      description: ISO Timestamp
      schema:
        type: string
        format: timestamp
        example: '2023-02-11T13:04:49.372Z'
    endedAt:
      in: query
      name: endedAt
      description: >-
        Transaction ended at (Both `startedAt` and `endedAt` cannot be applied
        to the same request)
      schema:
        type: string
        format: timestamp
        example: '2021-12-11T13:04:49.372Z'
    endedAtMax:
      in: query
      name: endedAtMax
      description: ISO Timestamp
      schema:
        type: string
        format: timestamp
        example: '2021-12-11T13:04:49.372Z'
    locationIdQuery:
      in: query
      name: locationId
      description: location ID to retrieve
      schema:
        type: integer
        example: 1
    voucherId:
      in: query
      name: voucherId
      schema:
        type: integer
        example: 1
    appUserIdQuery:
      in: query
      name: appUserId
      description: Only retrieve informations associated with an appUserId
      schema:
        type: integer
        example: 1
    idTagUid:
      in: query
      name: idTagUid
      schema:
        type: string
        example: '1'
    sortBy:
      in: query
      name: sortBy
      schema:
        enum:
          - id
          - startedAt
          - updatedAt
          - endedAt
        default: id
        example: id
    sortDir:
      in: query
      name: sortDir
      schema:
        enum:
          - ASC
          - DESC
        default: ASC
        example: ASC
    offset:
      in: query
      name: offset
      description: The number of items to skip before starting to collect the result set
      schema:
        type: integer
        example: 250
    limit:
      in: query
      name: limit
      description: Number of record to collect
      schema:
        type: integer
        maximum: 2000
        default: 250
        example: 250
    format:
      in: query
      name: format
      schema:
        type: string
        enum:
          - standard
          - finance
        default: standard
        example: finance
    output:
      in: query
      name: output
      schema:
        type: string
        enum:
          - CSV
          - JSON
        default: JSON
        example: JSON
    delimiter:
      in: query
      name: delimiter
      schema:
        type: string
        enum:
          - ;
          - ','
        default: ','
        example: ','
    fieldSeparator:
      in: query
      name: fieldSeparator
      schema:
        type: string
        enum:
          - _
          - .
        default: .
        example: .
    decimalSeparator:
      in: query
      name: decimalSeparator
      schema:
        type: string
        enum:
          - ','
          - .
        default: .
        example: .
  responses:
    chargeRecordsList:
      description: Charge Records Data
      content:
        application/json:
          schema:
            type: object
            required:
              - data
            properties:
              data:
                type: array
                items:
                  type: object
                  required:
                    - id
                    - location
                    - evseId
                    - isRoaming
                    - startedAt
                    - updatedAt
                    - endedAt
                    - consumed
                    - price
                  properties:
                    id:
                      $ref: '#/components/schemas/id'
                    location:
                      $ref: '#/components/schemas/location'
                    evseId:
                      $ref: '#/components/schemas/evseId'
                    auth:
                      $ref: '#/components/schemas/auth'
                    isRoaming:
                      $ref: '#/components/schemas/isRoaming'
                    isPublicSharing:
                      $ref: '#/components/schemas/isPublicSharing'
                    startedAt:
                      $ref: '#/components/schemas/startedAt'
                    updatedAt:
                      $ref: '#/components/schemas/updatedAt'
                    endedAt:
                      $ref: '#/components/schemas/endedAt'
                    consumed:
                      $ref: '#/components/schemas/consumed'
                    price:
                      $ref: '#/components/schemas/price'
                    isDynamicPrice:
                      $ref: '#/components/schemas/isDynamicPrice'
                    priceSource:
                      $ref: '#/components/schemas/priceSource'
                    voucherCode:
                      $ref: '#/components/schemas/voucherCode'
                    voucherGroupId:
                      $ref: '#/components/schemas/voucherGroupId'
                    billingMethod:
                      $ref: '#/components/schemas/billingMethod'
          example:
            data:
              - id: 123665
                location:
                  id: 1766
                  crmCustomerId: null
                  name: Søllerødgade
                  address: Søllerødgade 42
                  zipCode: '2200'
                  city: København
                  country: DK
                  type: Parking lot
                  isPublic: 1
                evseId: DK.SPI.ZM0050*1
                auth:
                  evcoID: null
                  tagUid: 6F15885115F85294D18C
                  tagLabel: SpiriiGo-custId-6329
                  tagDescription: Generated during setupIntent creation
                  tagType: creditCard
                  appUserId: 6329
                isRoaming: false
                isPublicSharing: false
                startedAt: '2021-06-21T08:30:55.000Z'
                updatedAt: '2021-06-21T08:30:55.000Z'
                endedAt: '2021-06-21T12:25:59.000Z'
                consumed: 13.79
                price:
                  currency: DKK
                  amount: 31,02
                isDynamicPrice: false
                priceSource: LocationTariff
                voucherCode: ''
                voucherGroupId: 0
                billingMethod: AppPayment
                billingDetails: ''
              - id: 124909
                location:
                  id: 1766
                  crmCustomerId: null
                  name: Søllerødgade
                  address: Søllerødgade 42
                  zipCode: '2200'
                  city: København
                  country: DK
                  type: Parking lot
                  isPublic: 1
                evseId: DK.SPI.ZM0051*1
                auth:
                  evcoID: null
                  tagUid: 6606F3F9B70E5F357F07
                  tagLabel: SpiriiGo-custId-6670
                  tagDescription: Generated during setupIntent creation
                  tagType: creditCard
                  appUserId: 6670
                isRoaming: false
                isPublicSharing: false
                startedAt: '2021-06-22T21:00:12.000Z'
                updatedAt: '2022-11-11T08:17:39.000Z'
                endedAt: '2021-06-23T07:34:34.000Z'
                consumed: 11.36
                price:
                  currency: DKK
                  amount: 25,56
                isDynamicPrice: false
                priceSource: LocationTariff
                voucherCode: ''
                voucherGroupId: 0
                billingMethod: AppPayment
                billingDetails: ''
            totalElements: 818
            offset: 0
            limit: 2
        text/csv:
          schema:
            description: CSV format
            type: string
          example: >
            "id","evseId","location.id","location.name","location.address","location.zipCode","location.city","locationId","consumed","price.perKwh","price.currency","price.amount","startedAt","endedAt","voucher","voucherGroup","duration.charging","duration.idle","user","paymentMethod.type","paymentMethod.label"

            20030,"DK.SPI.Z095*1",1145,"TheVillage","Lenin","640022","Kurgan",1145,0.425,3,"DKK",1.28,"2020-09-08T11:28:40.000Z","2020-09-08T11:41:30.000Z",,,"0","0",,"system","CreditCard"

            20036,"DK.SPI.Z095*1",1145,"TheVillage","Lenin","640022","Kurgan",1145,0,,,,"2020-09-08T11:44:39.000Z","2020-09-08T11:44:43.000Z",,,"0","0",,,
    badRequest:
      description: Bad Request, invalid request or missing request parameter
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                description: Error object
                type: object
                properties:
                  message:
                    description: Error message
                    type: string
                    example: >-
                      No fields to update. Please provide at least one of the
                      valid fields
          example:
            error:
              message: Querystring parameter `id` is not allowed
              statusCode: 400
              code: QueryParamNotAllowed
    badImplementation:
      description: Something went wroing, try again later
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                description: Error object
                type: object
                properties:
                  message:
                    description: Error message
                    type: string
                    example: Something went wroing, try again later
          example:
            error:
              message: Something went wroing, try again later
              statusCode: 500
  schemas:
    id:
      description: id
      type: integer
      example: 1
    location:
      type: object
      required:
        - id
        - name
        - zipCode
        - city
      properties:
        id:
          $ref: '#/components/schemas/id'
        name:
          $ref: '#/components/schemas/name'
        streetAddress:
          $ref: '#/components/schemas/streetAddress'
        zipCode:
          $ref: '#/components/schemas/zipCode'
        city:
          $ref: '#/components/schemas/city'
    evseId:
      type: string
      example: DK.SPI.Z095*1
    auth:
      type: object
      required:
        - evcoID
        - tagUid
        - tagLabel
        - tagType
        - appUserId
      properties:
        evcoID:
          $ref: '#/components/schemas/evcoID'
        tagUid:
          $ref: '#/components/schemas/tagUid'
        tagLabel:
          $ref: '#/components/schemas/tagLabel'
        tagDescription:
          $ref: '#/components/schemas/tagDescription'
        tagType:
          $ref: '#/components/schemas/tagType'
        appUserId:
          $ref: '#/components/schemas/appUserId'
    isRoaming:
      type: boolean
      example: false
    isPublicSharing:
      type: boolean
      example: false
    startedAt:
      type: string
      format: timestamp
      example: '2021-12-11T13:04:49.372Z'
    updatedAt:
      description: Updated date
      format: timestamp
      type: string
      example: '2021-04-20T14:38:20.000Z'
    endedAt:
      type: string
      format: timestamp
      example: '2021-12-11T13:04:49.372Z'
      nullable: true
    consumed:
      type: number
      example: 4
      nullable: true
    price:
      type: object
      required:
        - currency
      properties:
        perKwh:
          $ref: '#/components/schemas/perKwh'
        currency:
          $ref: '#/components/schemas/currency'
        vat:
          $ref: '#/components/schemas/vat'
    isDynamicPrice:
      type: boolean
      example: false
    priceSource:
      type: string
      example: LocaitonTariff
    voucherCode:
      type: string
      example: IDK
    voucherGroupId:
      type: number
      example: 0
    billingMethod:
      type: string
      example: AppPayment
    name:
      description: name
      type: string
      example: Kokbjerg
    streetAddress:
      description: street
      type: string
      example: Kokbjerg 30
    zipCode:
      description: zip code
      type: string
      example: '6000'
    city:
      description: city
      type: string
      example: Kolding
    evcoID:
      type: integer
      nullable: true
      example: 1
    tagUid:
      type: string
      example: 4174758928AC2B6
    tagLabel:
      type: string
      example: tag-label-1
    tagDescription:
      type: string
      nullable: true
      example: This is a tag
    tagType:
      type: string
      example: creditCard
    appUserId:
      type: integer
      example: 1
    perKwh:
      description: price per kwh
      type: number
      example: 3
      nullable: true
    currency:
      description: pricing currency
      type: string
      example: DKK
      nullable: true
    vat:
      description: vat
      type: number
      example: 0.25
      nullable: true

````