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

# Get a charging session

> Returns charging session details



## OpenAPI

````yaml /openapi.yaml get /sessions/{sessionId}
openapi: 3.1.0
info:
  title: Corpay APIs
  version: 1.0.0
  description: >
    Corpay APIs for customer profile management, card management, transaction
    history, and master data retrieval.
servers:
  - url: https://apigwuat.corpay.com
    description: Test environment
  - url: https://apigw.corpay.com
    description: Production environment
security:
  - oauth2ClientCredentials: []
tags:
  - name: Customer
    description: Customer profile and account lifecycle APIs
  - name: Card
    description: Card retrieval, ordering and lifecycle APIs
  - name: Geosearch
    description: >-
      Search and retrieve detailed information about charging locations and
      stations
  - name: Remote Charging
    description: >-
      Control charging sessions remotely including starting and stopping
      sessions, and monitoring session status
  - name: EV Session
    description: >-
      Access and manage charging session data including history, status, and
      detailed session information
  - name: Transaction
    description: Transaction history APIs
  - name: Master
    description: Master/reference data APIs
  - name: Webhooks
    description: Event callback payloads sent by Corpay
paths:
  /sessions/{sessionId}:
    get:
      tags:
        - EV Session
      summary: Get a charging session
      description: Returns charging session details
      operationId: getSessionById
      parameters:
        - name: sessionId
          in: path
          description: Session id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriveSession'
              example:
                balanceStatus: PROCESSING
                sessionStatus: CREATED
                charger:
                  chargingStationName: Drive_API_Test1_Station1
                  city: Solna
                  connectorLabel: '1'
                  evseId: SE*CND*EC1*1
                  streetName: Rättarvägen
                balanceAmountMinor: '-2160'
                chargingKeyType: virtual
                connectorId: O9UXK+YI5Q6i0FoI4qHwcA==
                duration: PT28.913S
                energy:
                  unit: WH
                  value: 57
                paymentMethod: CREDIT_CARD
                price:
                  currencyCode: EUR
                  minorExclVat: 2785
                  minorInclVat: 1
                  vat: '17.5'
                receiptAvailable: true
                sessionId: AAdmD55q8Vz
                site: Drive_API_Test1
                startTime: '2021-01-30T10:00:00.111Z'
                transactions:
                  - paymentMethod: CREDIT_CARD
                    paymentOutcome: CHARGE
                    amount:
                      currencyCode: EUR
                      minorExclVat: 2785
                      minorInclVat: 1
                      vat: '17.5'
                    time: '2021-01-30T10:00:00.111Z'
        '404':
          description: Session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriveErrorResponse'
              example:
                message: Resource not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriveErrorResponse'
              example:
                message: Resource not found
components:
  schemas:
    DriveSession:
      description: Detailed charging session information.
      properties:
        balanceAmountMinor:
          description: >-
            Type "Long". This field is not relevant for External Clearing (only
            used when using Plugsurfing's Payment Service Provider). Represents
            the remaining amount to be paid, expressed as a negative number. A
            value of 0 indicates the balance is fully paid. -2160 means there is
            an outstanding amount of 21.60 in the currency of the session.
          example: '-2160'
          type: number
        balanceStatus:
          $ref: '#/components/schemas/DriveSessionBalanceStatus'
          description: Balance state after applying session costs.
        charger:
          $ref: '#/components/schemas/DriveSessionCharger'
          description: Charger location and connector metadata.
        chargingKeyType:
          description: >-
            Only available after a session has successfully started. Possible
            values are "tag", "card", "virtual" or "plug_and_charge".
          example: virtual
          type: string
        connectorId:
          description: Only available after a session has successfully started.
          example: O9UXK+YI5Q6i0FoI4qHwcA==
          type: string
        duration:
          description: The value is in ISO 8601 duration format
          example: PT28.913S
          format: duration
          type: string
        energy:
          $ref: '#/components/schemas/DriveSessionEnergy'
          description: Energy consumed during the session.
        paymentMethod:
          deprecated: true
          description: >-
            Returns the `paymentMethod` of the transaction with the earliest
            timestamp. This field is `DEPRECATED` and will be removed in future
            versions. Use `session.transactions[].paymentMethod` instead.
            Migration note: `WRITE_OFF` was renamed to `NONE`, where
            `session.transactions[].paymentOutcome=WRITE_OFF` is the replacement
          enum:
            - CREDIT_CARD
            - EXTERNAL
            - PREPAID
            - WRITE_OFF
          type: string
        price:
          $ref: '#/components/schemas/DriveSessionAmount'
          description: Total session price.
        receiptAvailable:
          description: Indicates whether a receipt can be downloaded.
          type: boolean
        sessionId:
          description: Unique identifier of the charging session.
          example: AAdmD55q8Vz
          type: string
        sessionStatus:
          $ref: '#/components/schemas/DriveSessionStatus'
          description: Current lifecycle status of the session.
        site:
          description: Human-readable charging site name.
          example: Drive_API_Test1
          type: string
        startTime:
          $ref: '#/components/schemas/DriveTime'
          description: UTC timestamp when the session started.
        transactions:
          description: Transactions linked to this charging session.
          items:
            $ref: '#/components/schemas/DriveTransaction'
          type: array
      required:
        - sessionStatus
        - connectorId
        - sessionId
        - transactions
      type: object
    DriveErrorResponse:
      properties:
        message:
          type: string
      title: ErrorResponse
      type: object
    DriveSessionBalanceStatus:
      description: 'Note: this field is not relevant when using External Clearing.'
      enum:
        - PROCESSING
        - PAID
        - DEBT
        - REFUND
      type: string
    DriveSessionCharger:
      description: Location and connector information for the charger used in a session.
      properties:
        chargingStationName:
          description: Display name of the charging station.
          example: Drive_API_Test1_Station1
          type: string
        city:
          description: City where the charger is located.
          example: Solna
          type: string
        connectorLabel:
          description: Connector label reported by the charge point operator.
          example: '1'
          type: string
        evseId:
          description: EVSE identifier for the charging point.
          example: SE*CND*EC1*1
          type: string
        streetName:
          description: Street address of the charger.
          example: Rättarvägen
          type: string
      type: object
    DriveSessionEnergy:
      description: Energy measurement data for a charging session.
      properties:
        unit:
          description: Energy unit, typically kWh.
          example: WH
          type: string
        value:
          description: Measured energy value for the session.
          example: 57
          type: string
      required:
        - unit
        - value
      type: object
    DriveSessionAmount:
      description: Monetary amount with currency and VAT breakdown.
      properties:
        currencyCode:
          description: 3-letter currency code
          example: EUR
          type: string
        minorExclVat:
          description: 'Minor units amount. Example: 2785 = 27.85€.'
          example: 2785
          type: integer
        minorInclVat:
          description: Minor units amount
          type: integer
        vat:
          description: VAT percentage
          example: '17.5'
          type: string
      required:
        - currencyCode
        - minorExclVat
        - minorInclVat
        - vat
      type: object
    DriveSessionStatus:
      description: >-
        IMPORTANT - when handling this enum other unknown values should be
        handled.
      enum:
        - CREATED
        - WAITING_TO_START
        - STARTED
        - WAITING_TO_STOP
        - STOPPED
        - COMPLETE
        - FAILED
        - UNKNOWN
        - STOP_FAILED
      type: string
    DriveTime:
      description: Timestamp in ISO 8601 UTC format with up to nanosecond precision.
      example: '2021-01-30T10:00:00.111Z'
      format: date-time
      type: string
    DriveTransaction:
      description: Represents a transaction with payment details and time.
      properties:
        amount:
          $ref: '#/components/schemas/DriveSessionAmount'
        paymentMethod:
          description: >-
            The payment method used for the transaction. Can be `NONE` for
            outcome `WRITE_OFF`
          enum:
            - CREDIT_CARD
            - EXTERNAL
            - PREPAID
            - NONE
          type: string
        paymentOutcome:
          description: The outcome of the payment process.
          enum:
            - CHARGE
            - WRITE_OFF
            - REFUND
          type: string
        time:
          $ref: '#/components/schemas/DriveTime'
      required:
        - paymentMethod
        - paymentOutcome
        - amount
        - time
      type: object
  securitySchemes:
    oauth2ClientCredentials:
      description: >
        Use OAuth2 client credentials to obtain a bearer token.


        Token endpoint:

        `POST <BASE_URL>/keycloak/realms/longship/protocol/openid-connect/token`


        Use the same base URL as the selected API server:

        - Test environment: `https://apigwuat.corpay.com`

        - Production environment: `https://apigw.corpay.com`


        Example:

        ```bash

        curl --location
        '<BASE_URL>/keycloak/realms/longship/protocol/openid-connect/token' \

        --header 'accept: application/json' \

        --data-urlencode 'grant_type=client_credentials' \

        --data-urlencode 'client_id=.......' \

        --data-urlencode 'client_secret=......'

        ```
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /keycloak/realms/longship/protocol/openid-connect/token
      type: oauth2

````