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

# List the earlier versions of the P45

> Needs permission pay-run:read.

The P45s earlier lock cycles issued for the employee's latest P45, kept when the re-lock of an unlocked pay run replaced them, earliest cycle first. Empty while the P45 was issued once. Each version's document is served by the file route with its lockCycle.



## OpenAPI

````yaml /api-reference/specs/hmrc-p-forms.yaml get /p45/{employeeId}/versions
openapi: 3.1.1
info:
  title: HmrcPForms Service
  description: HMRC P Forms API for FlowPayroll (P45, P60, P32)
  contact:
    name: FlowPayroll
    email: support@flowpayroll.com
  version: v1
servers:
  - url: https://api.sandbox.flowpayroll.ai/v1/hmrc-p-forms
security:
  - X-Auth-Token: []
    X-Org-Id: []
tags:
  - name: P32
  - name: P45
  - name: P60
  - name: PFormBulkSend
paths:
  /p45/{employeeId}/versions:
    get:
      tags:
        - P45
      summary: List the earlier versions of the P45
      description: >-
        Needs permission pay-run:read.


        The P45s earlier lock cycles issued for the employee's latest P45, kept
        when the re-lock of an unlocked pay run replaced them, earliest cycle
        first. Empty while the P45 was issued once. Each version's document is
        served by the file route with its lockCycle.
      operationId: ListP45Versions
      parameters:
        - name: employeeId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/P45VersionModelListResponseBody'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
components:
  schemas:
    P45VersionModelListResponseBody:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/P45VersionModelListContentResponse'
        validationIssues:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ValidationIssue'
      additionalProperties: false
    ApiErrorResponse:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        validationIssues:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ValidationIssue'
      additionalProperties: false
    ObjectResponseBody:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/ObjectContentResponse'
        validationIssues:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ValidationIssue'
      additionalProperties: false
    MessageWithTokenResponse:
      type: object
      properties:
        text:
          type:
            - 'null'
            - string
        token:
          type:
            - 'null'
            - string
        tokenArguments:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
      additionalProperties: false
    P45VersionModelListContentResponse:
      type: object
      properties:
        data:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/P45VersionModel'
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssue:
      type: object
      properties:
        field:
          type:
            - 'null'
            - string
        reason:
          type:
            - 'null'
            - string
        reasonToken:
          type:
            - 'null'
            - string
        reasonTokenArguments:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
      additionalProperties: false
    ObjectContentResponse:
      type: object
      properties:
        data: {}
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssueArgument:
      type: object
      properties:
        name:
          type:
            - 'null'
            - string
        value: {}
      additionalProperties: false
    P45VersionModel:
      type: object
      properties:
        organisationId:
          type:
            - 'null'
            - string
        employeeId:
          type:
            - 'null'
            - string
        taxYear:
          type: integer
          format: int32
        lockCycle:
          type: integer
          format: int32
        fileName:
          type:
            - 'null'
            - string
        finalisedDate:
          type:
            - 'null'
            - string
        reissuedDate:
          type:
            - 'null'
            - string
        keptDate:
          type:
            - 'null'
            - string
        reopenedLockCycle:
          type:
            - 'null'
            - integer
          format: int32
        reopenedDate:
          type:
            - 'null'
            - string
        taxDetails:
          $ref: '#/components/schemas/P45TaxModel'
        lastEmailedAt:
          type:
            - 'null'
            - string
        lastEmailedTo:
          type:
            - 'null'
            - string
        lastEmailedStatus:
          type:
            - 'null'
            - string
      additionalProperties: false
    ContentMetadataResponse:
      type: object
      properties:
        dateFormat:
          type:
            - 'null'
            - string
        dateTimeFormat:
          type:
            - 'null'
            - string
        paginationToken:
          type:
            - 'null'
            - string
      additionalProperties: false
    P45TaxModel:
      type: object
      properties:
        taxCodeAtLeavingDate:
          type:
            - 'null'
            - string
        taxCodeWeek1Month1:
          type: boolean
        totalPayToDate:
          type: number
          format: double
        totalTaxToDate:
          type: number
          format: double
        totalPayInThisEmployment:
          type: number
          format: double
        totalTaxInThisEmployment:
          type: number
          format: double
        weekNumber:
          type:
            - 'null'
            - integer
          format: int32
        monthNumber:
          type:
            - 'null'
            - integer
          format: int32
      additionalProperties: false
  securitySchemes:
    X-Auth-Token:
      type: apiKey
      description: Authentication token for API access
      name: X-Auth-Token
      in: header
    X-Org-Id:
      type: apiKey
      description: >-
        Organisation to scope the request to. Required when the principal can
        access more than one organisation; optional for single-organisation
        principals (the authorizer resolves it automatically).
      name: X-Org-Id
      in: header

````

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