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

# Get a transaction

> A charging session of a charger you reach with `basic` access or more, through any of your
teams; masked below `sensitive` access, as in the list. One you do not reach, one from before
its charger changed hands, or one your token's reach leaves out, is a 404.



## OpenAPI

````yaml api-reference/v4/v4.openapi.json GET /transactions/{transaction}
openapi: 3.1.0
info:
  title: Plugchoice API
  description: >-
    Every request sends an access token as `Authorization: Bearer …`, unless an
    operation says otherwise.


    Errors are problems (RFC 9457, `application/problem+json`): `code` says what
    went wrong, and a failed validation lists the fields in `errors`.


    A list answers one page: `{"data": [...], "next_cursor": ...,
    "previous_cursor": ...}`. Pass a cursor back as `cursor` to get that page,
    and `limit` (1 to 100, default 25) for its size.


    Within v4, changes only add: new operations, new optional parameters, new
    fields and new enum values. Ignore fields you do not know, and accept enum
    values you do not know. Requests that send a field the operation does not
    know are refused, so a typo does not pass unnoticed.
  version: '4'
servers:
  - url: https://api.plugchoice.com/v4
security:
  - bearer: []
paths:
  /transactions/{transaction}:
    get:
      tags:
        - transactions
      summary: A session
      description: >-
        A charging session of a charger you reach with `basic` access or more,
        through any of your

        teams; masked below `sensitive` access, as in the list. One you do not
        reach, one from before

        its charger changed hands, or one your token's reach leaves out, is a
        404.
      operationId: show_transaction
      parameters:
        - name: transaction
          in: path
          description: The session's id
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        default:
          description: >-
            A problem (RFC 9457). `code` says which; the field errors come with
            `validation-failed`.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - bearer:
            - transactions:read
components:
  schemas:
    Transaction:
      type: object
      description: >-
        A charging session: one vehicle charged at one EVSE, from its start to
        its stop.
      required:
        - id
        - charger
        - status
        - started_at
        - time_precision
        - updated_at
      properties:
        card:
          oneOf:
            - $ref: '#/components/schemas/Card'
              description: >-
                The card or token that started it; null when the charger sent
                none.
            - type: 'null'
        charger:
          $ref: '#/components/schemas/ChargerReference'
        energy_wh:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            The energy it delivered, in Wh: what Plugchoice settled,
            `meter_stop_wh` minus

            `meter_start_wh`. Null while it is active (its progress is in the
            charger's live state).
        evse:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            The number of the EVSE it charged at; null when the charger did not
            say.
        id:
          type: string
          format: uuid
          description: The session's id.
        label:
          type:
            - string
            - 'null'
          description: >-
            The label people gave it: `business`, `private` and `guest` are the
            standard ones, which

            apps translate; anything else shows as written. Null without one.
        location:
          oneOf:
            - $ref: '#/components/schemas/LocationReference'
              description: >-
                The location its charger is at now; null when it is at no
                location.
            - type: 'null'
        meter_start_wh:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            The EVSE's energy register when it started, in Wh; null until the
            charger sends it (an

            OCPP 2.x charger may start without it, and then the session starts
            at its first reading).
        meter_stop_wh:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            `meter_start_wh` plus the energy Plugchoice settled, in Wh; null
            while it is active. It is

            not always the register the charger reported at its stop: a session
            that ended without

            one is settled up to its last reading.
        note:
          type:
            - string
            - 'null'
          description: >-
            The note people wrote on it; null without one, and below `sensitive`
            access.
        started_at:
          type: string
          format: date-time
          description: When it started, by the charger's clock.
        state:
          oneOf:
            - $ref: '#/components/schemas/TransactionState'
              description: >-
                Where Plugchoice is in settling it; null for a session from
                before 26 October 2026, when

                Plugchoice started recording this.
            - type: 'null'
        status:
          $ref: '#/components/schemas/TransactionStatus'
        stop_reason:
          oneOf:
            - $ref: '#/components/schemas/StopReason'
              description: >-
                Why it stopped, as the charger or Plugchoice reported it; null
                while it is active, or when

                the reason is not one this API knows.
            - type: 'null'
        stopped_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When it stopped; null while it is active.
        time_precision:
          $ref: '#/components/schemas/TimePrecision'
          description: >-
            How exact `started_at`, `stopped_at` and `updated_at` are: `month`
            below `sensitive`

            access for a session that started more than 14 days ago.
        updated_at:
          type: string
          format: date-time
          description: When it, its label or its note last changed.
    Problem:
      type: object
      description: An error response body (RFC 9457).
      required:
        - type
        - title
        - status
        - code
      properties:
        code:
          type: string
          description: 'The kind of problem, for code to act on: the last part of `type`.'
        detail:
          type: string
          description: >-
            What went wrong with this request, when there is more to say than
            the title.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
          description: 'With `validation-failed`: the fields that broke a rule.'
        status:
          type: integer
          format: int32
          description: The HTTP status code.
          minimum: 0
        title:
          type: string
          description: A short summary of the kind of problem.
        type:
          type: string
          description: The page that explains this kind of problem.
    Card:
      type: object
      description: The card or token that started a session.
      required:
        - id_tag
      properties:
        id_tag:
          type: string
          description: >-
            The id the charger sent (OCPP's idTag or idToken). Below `sensitive`
            access it shows its

            last three characters: `••••34A`.
        name:
          type:
            - string
            - 'null'
          description: >-
            The name of the card with this id at the charger's location; null
            when the location has

            none. Below `sensitive` access it shows its first and last two
            letters: `Ja****en`.
    ChargerReference:
      type: object
      description: A charger, as a session names it.
      required:
        - id
        - identity
      properties:
        id:
          type: string
          format: uuid
          description: The charger's id.
        identity:
          type: string
          description: 'The name it connects with: its OCPP charge point identity.'
    LocationReference:
      type: object
      description: A location, as a charger names it.
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          description: The location's id.
        name:
          type:
            - string
            - 'null'
          description: Its name; null when it has none.
    TransactionState:
      type: string
      description: >-
        Where Plugchoice is in settling a session. Accept values you do not
        know: more may come.
      enum:
        - open
        - stopped
        - final
        - incomplete
    TransactionStatus:
      type: string
      description: Whether a session is still running.
      enum:
        - active
        - finished
    StopReason:
      type: string
      description: >-
        Why a session stopped: OCPP's reasons (1.6 and 2.x), and `auto_closed`.
        Accept values you

        do not know: more may come.
      enum:
        - de_authorized
        - emergency_stop
        - energy_limit_reached
        - ev_disconnected
        - ground_fault
        - hard_reset
        - immediate_reset
        - local
        - local_out_of_credit
        - master_pass
        - other
        - overcurrent_fault
        - power_loss
        - power_quality
        - reboot
        - remote
        - soc_limit_reached
        - soft_reset
        - stopped_by_ev
        - time_limit_reached
        - timeout
        - unlock_command
        - auto_closed
    TimePrecision:
      type: string
      description: How exact a resource's times are.
      enum:
        - exact
        - month
    FieldError:
      type: object
      description: One field that broke a rule.
      required:
        - field
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            The rule it broke, for code to act on: `missing-field`,
            `unknown-field`, `invalid-type`,

            `invalid`, or `taken` (a value that must be unique, such as a card's
            id at a location,

            and is not).
        field:
          type: string
          description: >-
            Where the field is in the request, such as `name` or
            `connectors[0].max_current`.
        message:
          type: string
          description: What is wrong, in English.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        An access token from `accounts.plugchoice.com`, for a personal API
        token, a person signed in through an app, or an OAuth client.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.