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

# Get a payslip as it stood for a lock cycle

> Needs permission pay-run:read.

Returns the employee's payslip exactly as it stood when its pay run was locked for the given lock cycle.



## OpenAPI

````yaml /api-reference/specs/pay-api.yaml get /payslip/data/{employeeId}/{year}/{period}/versions/{lockCycle}
openapi: 3.0.3
info:
  title: FlowPayroll API
  description: >-
    API for payroll management, including payroll upload, lock, HMRC submission,
    employee management
  version: 0.1.0
servers:
  - url: https://api.sandbox.flowpayroll.ai/v1
security:
  - XAuthToken: []
    XOrgId: []
tags:
  - name: Employees
    description: >-
      Create, retrieve, update, and delete employee records, and look them up by
      NI number or payroll ID.
  - name: Starters & leavers
    description: Set and clear starter and leaver details, individually or in bulk.
  - name: Tax codes
    description: >-
      Manage employee tax codes and query the effective tax code and NI category
      on a given date.
  - name: NI & identifiers
    description: Manage NI categories, National Insurance numbers, and payroll IDs.
  - name: Student loans
    description: Start and end student and postgraduate loans.
  - name: Payroll setup
    description: Assign an employee's payroll config and set opening balances.
  - name: Salary
    description: >-
      The employee's effective-dated annual salary history: read it, add or
      correct a version from a date, and remove one. The Salary API pro-rates
      this history onto each pay run.
  - name: Payroll
  - name: Payroll lines
  - name: PayrollConfig
  - name: Pay Elements
  - name: Calculator
  - name: Payslip
  - name: RTI
  - name: YearEnd
  - name: Organisation
paths:
  /payslip/data/{employeeId}/{year}/{period}/versions/{lockCycle}:
    get:
      tags:
        - Payslip
      summary: Get a payslip as it stood for a lock cycle
      description: >-
        Needs permission pay-run:read.


        Returns the employee's payslip exactly as it stood when its pay run was
        locked for the given lock cycle.
      operationId: GetPayslipVersion
      parameters:
        - name: year
          in: path
          required: true
          schema:
            type: integer
            format: int32
          description: Year of the payslip
          example: 2026
        - name: period
          in: path
          required: true
          schema:
            type: integer
            format: int32
          description: Pay period number within the year
          example: 7
        - name: employeeId
          in: path
          required: true
          schema:
            type: string
          description: ID of the employee
          example: EMP01JPW80Q2B7Q9RGGRY29VGC8WM
        - name: lockCycle
          in: path
          required: true
          schema:
            type: integer
            format: int32
          description: The lock cycle the version belongs to (1 = the first lock)
          example: 1
        - name: frequency
          in: query
          required: false
          schema:
            type: string
            enum:
              - Annual
              - Monthly
              - FourWeekly
              - Fortnightly
              - Weekly
              - Daily
              - Quarterly
              - BiAnnually
          description: >-
            Optional payment frequency override. When provided, overrides the
            frequency from the employee's payroll config.
          example: Monthly
        - $ref: '#/components/parameters/Request-Id'
      responses:
        '200':
          description: The payslip version was retrieved successfully
          content:
            application/json:
              schema:
                type: object
                allOf:
                  - $ref: '#/components/schemas/ResponseBody'
                  - properties:
                      content:
                        type: object
                        properties:
                          data:
                            $ref: '#/components/schemas/PayslipVersionDto'
        '400':
          description: Invalid frequency parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody'
        '404':
          description: No version of the payslip was kept for that lock cycle
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody'
        '500':
          description: Internal Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody'
components:
  parameters:
    Request-Id:
      name: Request-Id
      in: header
      required: false
      description: >-
        Optional. Your id for this request: it is carried into every log line
        about it, so quote it when you contact support.
      schema:
        type: string
  schemas:
    ResponseBody:
      type: object
      required:
        - message
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
          description: >-
            A readable message about the outcome and a stable token a client can
            branch on.
        content:
          type: object
          required:
            - metadata
          properties:
            data:
              description: >-
                The resource or list the request asked for; left out when there
                is none.
            metadata:
              type: object
              required:
                - dateFormat
                - dateTimeFormat
              properties:
                dateFormat:
                  type: string
                  description: The format of the dates in this response, yyyy-MM-dd.
                dateTimeFormat:
                  type: string
                  description: >-
                    The format of the timestamps in this response,
                    yyyy-MM-ddTHH:mm:ss.fffZ in UTC.
                paginationToken:
                  type: string
                  nullable: true
                  description: >-
                    Send this value back as the paginationToken query parameter
                    to get the next page; absent when there are no more pages.
              description: >-
                The date formats the response uses and, on a paged list, the
                token for the next page.
          description: >-
            The data the request returns with its metadata; left out on a
            response that carries no data, such as most errors.
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
          description: >-
            Each field the request was refused for and why; left out when the
            request was not refused for its fields.
    PayslipVersionDto:
      type: object
      description: >-
        A payslip version in full: the summary fields plus the payslip exactly
        as it was.
      required:
        - lockCycle
        - supersededAt
        - supersededBy
        - payslip
      properties:
        lockCycle:
          type: integer
          format: int32
          description: The lock cycle this version belongs to (1 = the first lock)
        supersededAt:
          type: string
          description: When the version was superseded, UTC
        supersededBy:
          type: string
          description: Who unlocked the pay run
        supersededReason:
          type: string
          nullable: true
          description: The reason given for the unlock, when one was given
        payslip:
          $ref: '#/components/schemas/Payslip'
          description: The payslip as it stood
    MessageWithTokenResponse:
      type: object
      required:
        - text
        - token
      properties:
        text:
          type: string
          description: The message in English, ready to show to a user.
        token:
          type: string
          description: >-
            A stable snake_case key for the message, so a client can show its
            own wording or a translation instead of text.
        tokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
          description: >-
            Values to fill into the client's own wording for token, such as the
            request id; absent when the message has none.
    ValidationIssue:
      type: object
      description: >-
        Field validation item. `reasonToken` is a stable snake_case key for i18n
        or custom client messages; `reason` is the default English text from the
        API.
      required:
        - field
        - reason
        - reasonToken
      properties:
        field:
          type: string
          description: Dot-path of the field (e.g. name.firstName, address.line1).
        reason:
          type: string
          description: Default human-readable message.
        reasonToken:
          type: string
          description: Machine-readable error identifier (snake_case).
        reasonTokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
          description: >-
            Values to fill into the client's own wording for reasonToken; absent
            when the reason has none.
    Payslip:
      type: object
      required:
        - employeeDetails
        - employerDetails
        - year
        - period
        - payrollConfigId
        - frequency
        - summaryItems
        - forPeriod
        - yearToDate
        - forEmployment
        - createdDate
        - createdBy
        - updatedDate
        - updatedBy
        - status
        - payslipMetadata
        - payPeriodStartDate
        - payPeriodEndDate
        - lockCycle
      properties:
        employeeDetails:
          $ref: '#/components/schemas/PayslipEmployeeDetailsDto'
          description: Employee details
        employerDetails:
          $ref: '#/components/schemas/PayslipEmployerDetailsDto'
          description: Employer details
        year:
          type: integer
          format: int32
          description: Year
          example: 2024
        period:
          type: integer
          format: int32
          description: Period
          example: 2
        payrollConfigId:
          type: string
          description: Payroll config id
          example: 01JNR9P81W74HYCN35X1EEFDZE
        frequency:
          type: string
          enum:
            - Annual
            - Monthly
            - FourWeekly
            - Fortnightly
            - Weekly
            - Daily
            - Quarterly
            - BiAnnually
          description: Frequency
          example: Monthly
        summaryItems:
          type: array
          items:
            $ref: '#/components/schemas/PayslipSummaryItemDto'
          description: Summary items
        forPeriod:
          $ref: '#/components/schemas/BaseValuesDto'
          description: The totals for this pay period alone.
        yearToDate:
          $ref: '#/components/schemas/BaseValuesDto'
          description: >-
            The tax year's totals so far including this period, with pay and tax
            from a previous employment in the same tax year added in.
        forEmployment:
          $ref: '#/components/schemas/BaseValuesDto'
          description: >-
            The tax year's totals so far including this period for this
            employment only, without any previous employment.
        createdDate:
          type: string
          description: Created date
          example: '2025-03-21T14:17:19.076Z'
        createdBy:
          type: string
          description: Created by
          example: System
        updatedDate:
          type: string
          description: Updated date
          example: '2025-03-21T14:17:19.076Z'
        updatedBy:
          type: string
          description: Updated by
          example: System
        status:
          type: string
          enum:
            - Preview
            - Final
            - Reopened
          description: Status
          example: Final
        payslipMetadata:
          $ref: '#/components/schemas/PayslipMetadataDto'
          description: Payslip metadata
        paymentDate:
          type: string
          nullable: true
          description: Payment date
        payPeriodStartDate:
          type: string
          description: Pay period start date
          example: '2024-02-01'
        payPeriodEndDate:
          type: string
          description: Pay period end date
          example: '2024-02-29'
        lateReason:
          type: string
          enum:
            - NotionalPaymentToExpartByThirdPartyOrOverseasEmployer
            - NotionalPaymentEmploymentRelatedSecurity
            - NotionalPaymentOther
            - PaymentSubjectToClass1NicButP11dP9dForTax
            - MicroEmployerUsingTemporaryOnOrBeforeRelaxation
            - >-
              NoRequirementToMaintainADeductionsWorkingSheetOrImpossibleToReportWorkDoneOnTheDay
            - ReasonableExcuse
            - CorrectionToEarlierSubmission
          description: Late reason
          example: ReasonableExcuse
        alerts:
          type: array
          items:
            $ref: '#/components/schemas/PayslipAlertDto'
          nullable: true
          description: >-
            Alerts raised for this payslip during calculation (e.g. missing bank
            account, NMW breach). Null or empty when no alerts apply.
        lastEmailedAt:
          type: string
          nullable: true
          description: >-
            Timestamp of the last payslip email-send attempt (ISO 8601). Null if
            the payslip has never been emailed.
          example: '2026-06-24T10:00:00.000Z'
        lastEmailedTo:
          type: string
          nullable: true
          description: Email address the payslip was last sent to.
          example: jane.doe@example.com
        lastEmailedBy:
          type: string
          nullable: true
          description: >-
            User who triggered the last payslip email (or 'system' for automated
            sends).
          example: admin@example.com
        lastEmailedStatus:
          type: string
          enum:
            - Sent
            - Failed
          description: Outcome of the last payslip email-send attempt.
          example: Sent
        lastEmailError:
          type: string
          nullable: true
          description: Reason the last payslip email failed. Null on success.
          example: Mailbox full
        versionId:
          type: string
          nullable: true
          description: >-
            Monotonic ULID stamped when this payslip's content was produced.
            Consumers use it as a freshness token: a payslip carrying a lower
            value than one already processed is stale and must not overwrite the
            newer state. Writes to the payslip itself are guarded on the same
            value. Null on payslips written before versioning existed — treat
            that as unknown, not as the oldest possible version.
          example: 01KZB4YMGGSKA1B3PFD5WJ5YFB
        lockCycle:
          type: integer
          format: int32
          description: >-
            The pay run lock cycle this payslip belongs to: 1 until the run is
            unlocked for the first time, then the cycle it was reopened under.
            Earlier cycles are kept as payslip versions.
          example: 1
    ValidationIssueArgument:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
          description: The name of the value, as a client's wording refers to it.
        value:
          description: The value itself, as a string, number or other JSON value.
    PayslipEmployeeDetailsDto:
      type: object
      required:
        - id
        - name
        - email
        - birthDate
        - birthGender
        - hoursWorkedCategory
        - taxCode
        - nationalInsuranceCategory
        - nationalInsuranceNumber
        - starterDetails
        - isPaymentAfterLeaving
      properties:
        id:
          type: string
          description: Id
          example: EMP01JPW80Q2B7Q9RGGRY29VGC8WM
        name:
          $ref: '#/components/schemas/EmployeeNameDto'
          description: The employee's name when the payslip was calculated.
        email:
          type: string
          description: Email address
          example: john.doe@example.com
        secondaryEmail:
          type: string
          nullable: true
          description: Secondary email address
          example: john.doe@example.com
        address:
          $ref: '#/components/schemas/AddressDto'
          nullable: true
          description: The employee's address when the payslip was calculated.
        birthDate:
          type: string
          description: Birth date (YYYY-MM-DD)
          example: '1980-01-12'
        birthGender:
          type: string
          enum:
            - Male
            - Female
          description: Birth gender (Male or Female)
          example: Female
        payrollId:
          type: string
          nullable: true
          description: >-
            Payroll id (optional), only used for payroll runs PayId field in
            HMRC Full Payment Submission Report
          example: PAY123
        employeeCode:
          type: string
          nullable: true
          description: Employee code. An optional identifier for the employee.
          example: EMP001
        hoursWorkedCategory:
          type: string
          enum:
            - UpTo16Hours
            - From16To24Hours
            - From24To30Hours
            - Above30Hours
            - Other
          description: Weekly hours worked category.
          example: Above30Hours
        taxCode:
          $ref: '#/components/schemas/EmployeeTaxCodeDto'
          description: >-
            The tax code in force for this pay period, which the payslip was
            calculated with.
        nationalInsuranceCategory:
          type: string
          description: National insurance category
          example: A
        nationalInsuranceNumber:
          type: string
          description: National insurance number
          example: AB123456C
        passportNumber:
          type: string
          nullable: true
          description: Passport number (optional)
          example: '123456789'
        starterDetails:
          $ref: '#/components/schemas/EmployeeStarterDetailsDto'
          description: The employee's starter details when the payslip was calculated.
        studentDetails:
          $ref: '#/components/schemas/EmployeeStudentDetailsDto'
          nullable: true
          description: >-
            The employee's student and postgraduate loan details when the
            payslip was calculated.
        directorDetails:
          $ref: '#/components/schemas/EmployeeDirectorDetailsDto'
          nullable: true
          description: The employee's director details when the payslip was calculated.
        leaverDetails:
          $ref: '#/components/schemas/EmployeeLeaverDetailsDto'
          nullable: true
          description: The employee's leaver details when the payslip was calculated.
        workplaceDetails:
          $ref: '#/components/schemas/EmployeeWorkplaceDetailsDto'
          nullable: true
          description: The employee's workplace details when the payslip was calculated.
        bankAccounts:
          type: array
          items:
            $ref: '#/components/schemas/BankAccountDto'
          nullable: true
          description: Bank accounts
          example:
            - accountNumber: '12345678'
              sortCode: '123456'
              accountHolderName: John Doe
              isPrimaryPayrollAccount: true
              allocationPercentage: 100
        department:
          type: string
          nullable: true
          description: The employee's department.
        jobTitle:
          type: string
          nullable: true
          description: The employee's job title.
        pensionDetails:
          $ref: '#/components/schemas/PensionEmployeeConfigDto'
          nullable: true
          description: >-
            Deprecated: stops being returned on 14 January 2027. Read the
            pension contribution items under summaryItems instead:
            pensionLineType names the kind of contribution,
            pensionMetadata.pensionType the pension type, and
            pensionMetadata.pensionGroupId the group. Until then it carries the
            configuration the group contribution line was calculated from, and
            is absent when the employee has no pension contribution this period.
          deprecated: true
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagDto'
          nullable: true
          description: Tags assigned to this employee.
        isPaymentAfterLeaving:
          type: boolean
          description: >-
            This payslip pays someone who had already left and been given their
            P45. HMRC requires a 0T week 1/month 1 tax code, sends the payment
            on the FPS with the payment-after-leaving indicator set alongside
            the original leaving date, and forbids issuing a second P45.
          example: false
    PayslipEmployerDetailsDto:
      type: object
      required:
        - id
        - organisationInformation
        - taxReferenceNumbers
      properties:
        id:
          type: string
          description: Organisation id as per our platform
          example: LOAD_TEST
        organisationInformation:
          $ref: '#/components/schemas/OrganisationInformationDto'
          description: The organisation's details when the payslip was calculated.
        taxReferenceNumbers:
          $ref: '#/components/schemas/TaxReferenceNumbersDto'
          description: The organisation's HMRC references when the payslip was calculated.
    PayslipSummaryItemDto:
      type: object
      required:
        - id
        - description
        - amount
        - type
        - category
        - payRate
        - payElementId
        - unitName
        - units
        - date
        - isNetDeduction
        - canEdit
        - billingStatus
        - wasReducedByProtectedEarnings
      properties:
        id:
          type: string
          description: Unique identifier for the summary item
          example: PAYLINE-01JPW80Q2B5B76SQ2K56BZ3DHA
        description:
          type: string
          description: Description of the item
          example: Regular Hours
        amount:
          type: number
          format: decimal
          description: Amount for this item (payRate * units)
          example: 306
        type:
          type: string
          enum:
            - Employee
            - Employer
          description: >-
            Indicate if this line is linked to the employee or employer. 0 is
            Employee and 1 is Employer
        category:
          type: string
          enum:
            - Earning
            - Deduction
            - Informational
          description: Category of the item
        payRate:
          type: number
          format: decimal
          description: Pay rate for the item
          example: 10.5
        payElementId:
          type: string
          description: Pay element id
          example: base_salary
        unitName:
          type: string
          enum:
            - Hour
            - Day
            - Week
            - Month
            - Year
            - Fixed
            - Informational
            - Percentage
          description: Unit name
        units:
          type: number
          format: decimal
          description: Units
        chargeRate:
          type: number
          format: decimal
          nullable: true
          description: Charge rate
        chargeUnits:
          type: number
          format: decimal
          nullable: true
          description: >-
            How many units the client is charged for, copied from the payroll
            line.
          example: 1
        chargeValue:
          type: number
          format: decimal
          nullable: true
          description: The charge value times the charge units
          example: 100
        chargeDescription:
          type: string
          nullable: true
          description: Charge description for billing.
        date:
          type: string
          description: Date of the item
          example: '2024-02-28'
        isNetDeduction:
          type: boolean
          description: Is net deduction
          example: false
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagDto'
          nullable: true
          description: Tags copied from the payroll line the item came from.
        unitType:
          type: string
          enum:
            - Amount
            - Percentage
          description: >-
            The unit type for calculation. Amount uses payRate * units,
            Percentage uses payRate * (units / 100). Defaults to Amount if not
            provided.
        originalValue:
          type: number
          format: decimal
          nullable: true
          description: >-
            The original deduction amount before protected earnings adjustment.
            Shows what should have been deducted when deduction is reduced or
            zero.
        lineItemSequence:
          type: integer
          format: int32
          nullable: true
          description: Line item sequence number for court orders
        courtOrderId:
          type: string
          nullable: true
          description: Court order ID for court order line items
        courtOrderType:
          type: string
          enum:
            - None
            - CmsDeo
            - AeoPriority
            - AeoNonPriority
            - Dea
            - Ctaeo
            - Ea
            - Mcaeo
            - Cma
            - Cao
            - NiFinesAeo
            - NiEjoAeo
          description: >-
            Court order type. One of CmsDeo, AeoPriority, AeoNonPriority, Dea,
            Ctaeo, Ea, Mcaeo, Cma (current maintenance arrestment, Scotland),
            Cao (conjoined arrestment order, Scotland), NiFinesAeo (attachment
            of earnings order for fines, Northern Ireland) or NiEjoAeo
            (attachment of earnings order made by the Enforcement of Judgments
            Office, Northern Ireland).
        canEdit:
          type: boolean
          description: >-
            Indicates whether this summary item can be edited. Court order items
            are not editable.
          example: true
        eligibility:
          $ref: '#/components/schemas/EligibilityDto'
          nullable: true
          description: >-
            Which court order types may take money from this pay. Read-only: set
            from payType, taxType and isClass1ANiable.
        paymentDetails:
          $ref: '#/components/schemas/PaymentDetailsDto'
          nullable: true
          description: >-
            Payment details (BACS information) that can override default
            employee bank account
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/AttachmentResponseDto'
          nullable: true
          description: >-
            List of attachments with download URLs (only present when
            attachments exist)
        poNumber:
          type: string
          nullable: true
          description: Purchase order number for billing purposes
          example: PO-2025-001
        clientId:
          type: string
          nullable: true
          description: Client ID
          example: CLIENT-001
        invoiceId:
          type: string
          nullable: true
          description: Invoice id when this line item has been allocated to an invoice.
        billingStatus:
          type: string
          enum:
            - None
            - Accrued
            - Invoiced
          description: Billing status for billable line items.
        calculationFlags:
          $ref: '#/components/schemas/PayslipSummaryItemCalculationFlagsDto'
          nullable: true
          description: >-
            Eligibility flags taken from the source pay element. Use them to
            apportion per-element costs without re-reading the pay element's
            configuration.
        wasReducedByProtectedEarnings:
          type: boolean
          description: >-
            Whether this deduction line was reduced by the court order
            protected-earnings cap.
        tax:
          type: number
          format: decimal
          nullable: true
          description: >-
            This line's share of forPeriod.tax (PAYE). Null when the line is not
            taxable; 0 when taxable but the apportioned share is zero this
            period. Σ across all items equals forPeriod.tax (penny-perfect via
            Hamilton's largest-remainder method).
        employeeNi:
          type: number
          format: decimal
          nullable: true
          description: >-
            This line's share of forPeriod.ni (employee NI). Null when not
            Niable; 0 when eligible but the share is zero. Σ = forPeriod.ni.
        employeePension:
          type: number
          format: decimal
          nullable: true
          description: >-
            This line's share of forPeriod.pension (employee pension). Null when
            not pensionable; 0 when eligible but the share is zero. In
            SalarySacrifice mode this is 0 on every item because
            forPeriod.pension is 0, so the contribution lives on
            pensionContributionsByType[SalarySacrifice] and
            pensionSacrificeAmount on the synthetic sacrifice item.
        studentLoan:
          type: number
          format: decimal
          nullable: true
          description: >-
            This line's share of forPeriod.studentLoan. Null when not taxable; 0
            when eligible but the share is zero. Σ = forPeriod.studentLoan.
        postgraduateLoan:
          type: number
          format: decimal
          nullable: true
          description: >-
            This line's share of forPeriod.postgraduateLoan. Same eligibility as
            tax. Σ = forPeriod.postgraduateLoan.
        employerNi:
          type: number
          format: decimal
          nullable: true
          description: >-
            This line's share of forPeriod.employerNi. Null when neither Niable
            nor EmployerOnly; 0 when eligible but the share is zero. Σ =
            forPeriod.employerNi.
        employerClass1ANi:
          type: number
          format: decimal
          nullable: true
          description: >-
            This line's share of forPeriod.employerClass1ANI (employer Class 1A
            NI on BIKs). Null when not Class 1A niable; 0 when eligible but the
            share is zero (Class 1A is normally settled annually on P11D, not
            per-pay-period).
        employerPension:
          type: number
          format: decimal
          nullable: true
          description: >-
            This line's share of forPeriod.employerPension. Null when not
            pensionable; 0 when eligible but the share is zero. Σ =
            forPeriod.employerPension.
        apprenticeshipLevy:
          type: number
          format: decimal
          nullable: true
          description: >-
            This line's share of forPeriod.apprenticeshipLevy. Same eligibility
            as employerNi. Σ = forPeriod.apprenticeshipLevy.
        employmentAllowance:
          type: number
          format: decimal
          nullable: true
          description: >-
            Historical only: per-item Employment Allowance slices are no longer
            written. Retained on summary items created while per-payslip
            apportionment existed; null on items written since. The run-level
            figure lives on the pay run's totalBalances.
        apprenticeshipLevyAllowance:
          type: number
          format: decimal
          nullable: true
          description: >-
            Historical only: per-item Apprenticeship Levy allowance slices are
            no longer written. Retained on summary items created while
            per-payslip apportionment existed; null on items written since. The
            run-level figure lives on the pay run's totalBalances.
        pensionSacrificeAmount:
          type: number
          format: decimal
          nullable: true
          description: >-
            The sacrificed amount on this line in SalarySacrifice pension
            schemes. Populated only on the internal_pension_salary_sacrifice
            synthetic item when the pension type is SalarySacrifice; null on
            every other item.
        pensionEmployerContribution:
          type: number
          format: decimal
          nullable: true
          description: >-
            The employer contribution calculated for this pension contribution
            line under line-item contributions. Display metadata riding on the
            deduction item, already included in forPeriod.employerPension and
            never additive.
        pensionLineType:
          type: string
          enum:
            - Contribution
            - RecurringAdditionalVoluntaryContribution
            - AdditionalVoluntaryContribution
            - OptOutRefund
          description: >-
            Classifies a pension summary item so consumers never parse line ids.
            Contribution = a scheme contribution (group percentage/fixed,
            per-employee override, or a manually-added line on a pension pay
            element, including legacy salary sacrifice).
            RecurringAdditionalVoluntaryContribution = a standing additional
            voluntary contribution on top of the scheme contribution.
            AdditionalVoluntaryContribution = a single-period additional
            voluntary contribution. OptOutRefund = the payable line refunding
            the member's contributions after a valid opt-out. Null on every
            non-pension item.
        ordinaryDebtDeducted:
          type: number
          format: decimal
          nullable: true
          description: >-
            Conjoined arrestment orders only: how much of the amount paid the
            ordinary debts; the rest paid maintenance. Null on every other item.
        pensionMetadata:
          allOf:
            - $ref: '#/components/schemas/PensionMetadataSectionDto'
          nullable: true
          description: >-
            The pension context this item calculated under (group id, basis,
            employer share, and contributionSource saying where the settings
            came from). Null on non-pension items and on payslips stored before
            the field existed.
    BaseValuesDto:
      type: object
      properties:
        gross:
          type: number
          format: decimal
          description: Gross pay
          example: 306
        grossTaxable:
          type: number
          format: decimal
          description: Gross taxable pay
          example: 306
        grossNi:
          type: number
          format: decimal
          description: Gross pay for National Insurance purposes
          example: 306
        grossForEmployerNi:
          type: number
          format: decimal
          description: Gross pay for employer National Insurance purposes
          example: 306
        grossForEmployerClass1ANi:
          type: number
          format: decimal
          description: Gross pay for employer Class 1A National Insurance purposes
          example: 306
        grossPensionable:
          type: number
          format: decimal
          description: Gross pensionable pay
          example: 306
        grossForCourtOrders:
          type: number
          format: decimal
          description: Gross pay for court orders
          example: 306
        tax:
          type: number
          format: decimal
          description: Tax amount
          example: 45.2
        ni:
          type: number
          format: decimal
          description: Employee National Insurance contribution
          example: 25.3
        pension:
          type: number
          format: decimal
          description: >-
            The member's pension movement for the slice this object covers
            (period, year to date or employment to date): contributions deducted
            from pay, including additional voluntary contributions, minus any
            opt-out refunds paid back. Negative in a period that refunds more
            than it deducts. Salary-sacrifice contributions are employer money
            and live in employerPension, never here. Reconciles with the pension
            summary items: read one source or the other, never both.
          example: 0
        employerNi:
          type: number
          format: decimal
          description: Employer National Insurance contribution
          example: 35.4
        employerClass1ANI:
          type: number
          format: decimal
          description: Employer Class 1A National Insurance contribution
          example: 35.4
        employerPension:
          type: number
          format: decimal
          description: >-
            The employer's pension contributions for the slice, including
            salary-sacrifice amounts (sacrificed pay is the employer's
            contribution), minus any salary-sacrifice opt-out refunds.
          example: 0
        studentLoan:
          type: number
          format: decimal
          description: Student loan repayment
          example: 0
        postgraduateLoan:
          type: number
          format: decimal
          description: Postgraduate loan repayment
          example: 0
        net:
          type: number
          format: decimal
          description: Net pay after deductions including net deductions
          example: 235.5
        netDeductions:
          type: number
          format: decimal
          description: Net deductions applied to the net pay
          example: 0
        totalPayable:
          type: number
          format: decimal
          description: Total payable
          example: 235.5
        totalEmployerCost:
          type: number
          format: decimal
          description: Total employer cost
          example: 306
        niBand:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NiCalculationResultDto'
          description: National Insurance band breakdown
        statutory:
          type: object
          additionalProperties:
            type: number
            format: decimal
          description: Statutory payments breakdown
          example:
            SSP: 0
            SMP: 0
        pensionContributionsByType:
          type: object
          additionalProperties:
            type: number
            format: decimal
          description: >-
            Pension contributions broken down by pension type. Contributions
            only: opt-out refunds never appear here, so read
            pensionRefundsByType for those. Net member movement per scheme =
            contributions minus refunds.
          example:
            NetPayArrangement: 0
            ReliefAtSource: 0
            SalarySacrifice: 0
        qualifyingEarningsForPension:
          type: number
          format: decimal
          description: Qualifying earnings for pension calculation
          example: 0
        apprenticeshipLevy:
          type: number
          format: decimal
          description: >-
            Per-payslip gross apprenticeship levy attributable to this period.
            Equal to 0.5 percent of grossForEmployerNi when the organisation
            pays AL, otherwise 0. The org-level £15,000 annual allowance is
            applied at the EPS level, not deducted per payslip — so summing this
            across a pay run gives the gross levy used for reconciliation
            against the organisation's monthly AL balance.
          example: 1.53
        employmentAllowance:
          type: number
          format: decimal
          description: >-
            Employment Allowance used by this pay run — an employer-level
            figure, populated on the pay run's totalBalances when the run
            completes. Not stamped on individual payslips: payslip
            forPeriod/yearToDate values are always 0 for payslips generated
            after per-payslip apportionment was removed; payslips written while
            it existed retain their historical share. Per-employee views
            (journal Employment Allowance lines) are derived from the run-level
            figure.
          example: 0
        apprenticeshipLevyAllowance:
          type: number
          format: decimal
          description: >-
            Apprenticeship Levy allowance (annual £15,000 pot, accrued monthly)
            used by this pay run — an employer-level figure, populated on the
            pay run's totalBalances when the run completes. Not stamped on
            individual payslips: payslip forPeriod/yearToDate values are always
            0 for payslips generated after per-payslip apportionment was
            removed; payslips written while it existed retain their historical
            share. Per-employee views are derived from the run-level figure.
          example: 0
        statutoryRecovery:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/StatutoryPaymentsReclaimDto'
          description: >-
            Per-statutory-type recovery this payslip contributes to the EPS.
            Keys are the StatutoryTypeEnum string values (StatutoryMaternityPay,
            StatutoryPaternityPay, SharedParentalPay, StatutoryAdoptionPay,
            StatutoryParentalBereavementPay, StatutoryNeonatalCarePay).
            Statutory Sick Pay is never recoverable per HMRC DANSP37000 and is
            omitted from this map.
          example:
            StatutoryMaternityPay:
              reclaimed: 100
              nicCompensationRecovered: 8.5
        isEmpty:
          type: boolean
          nullable: true
          description: >-
            Whether every value in this record is zero, as judged by the
            producer. A pay run's totalBalances is written asynchronously after
            the run completes and reads back as an all-zero record until then,
            so a consumer cannot tell "not written yet" from "genuinely nil" by
            inspecting the figures. Null means this producer did not supply the
            flag — treat it as unknown, never as false.
          example: false
        pensionRefundsByType:
          type: object
          additionalProperties:
            type: number
            format: decimal
          description: >-
            The MEMBER contributions paid back through this period, broken down
            by pension type. Absent unless a refund happened. The refund also
            appears as a Payable internal_pension_{scheme}_refund summary item
            and nets forPeriod.pension, so the period scalar can be negative in
            a refund period. The employer half is reported separately in
            employerPensionRefundsByType.
          example:
            ReliefAtSource: 146.76
        employerPensionRefundsByType:
          type: object
          additionalProperties:
            type: number
            format: decimal
          description: >-
            The EMPLOYER contributions reversed by an opt-out refund, broken
            down by pension type. Absent unless a refund happened. Employer
            money never passes through the member's net pay (the scheme repays
            the employer directly), but it is netted off employerPension for the
            period, and therefore off the monthly balance, the organisation
            year-to-date figures and the journal cost slices built from it. This
            field is the disclosure of what was reversed, so read it to explain
            a balance, never to subtract again.
          example:
            ReliefAtSource: 110.07
    PayslipMetadataDto:
      type: object
      properties:
        notes:
          type: string
          nullable: true
          description: Notes to be added or updated for the payslip
          example: Additional holiday pay included for this period
        paymentDateOverwrite:
          type: string
          nullable: true
          description: Payment date overwrite for the payslip
          example: '2024-02-28'
    PayslipAlertDto:
      type: object
      required:
        - code
        - severity
      properties:
        code:
          type: string
          enum:
            - MissingBankAccount
            - NationalMinimumWageBreach
            - NiCategoryChanged
            - LeaverOnThisPayRun
            - PaymentAfterLeaving
            - CourtOrderNoTableForPayFrequency
          description: Alert code identifying the rule that fired
          example: MissingBankAccount
        severity:
          type: string
          enum:
            - Info
            - Warning
            - Error
          description: Alert severity
          example: Warning
        context:
          type: object
          additionalProperties:
            type: string
          description: >-
            Optional structured details about the alert. For
            NationalMinimumWageBreach this includes age, ageBracket,
            requiredRate, effectiveRate, nmwHours and nmwAmount. For
            NiCategoryChanged this includes to, effectiveDate (yyyy-MM-dd) and,
            when resolvable, from. For LeaverOnThisPayRun this includes
            leavingDate (yyyy-MM-dd) and, when the cessation missed its own pay
            run, reportedLate. For PaymentAfterLeaving this includes leavingDate
            (yyyy-MM-dd) and the taxCode applied. For
            CourtOrderNoTableForPayFrequency, raised when a Northern Ireland
            fines attachment of earnings order meets a pay frequency other than
            weekly or monthly (the only frequencies with official tables) and so
            took nothing, this includes message, courtOrderType, courtOrderIds
            (comma-separated) and payFrequency.
    EmployeeNameDto:
      type: object
      required:
        - firstName
        - lastName
      properties:
        title:
          type: string
          nullable: true
          description: >-
            The person's title, such as Mr or Ms; optional, and checked against
            HMRC's title rules when sent.
          example: Mr
        firstName:
          type: string
          description: >-
            The first forename, reported to HMRC; 1 to 35 characters starting
            with a letter, using letters, spaces, hyphens and apostrophes.
          example: John
        lastName:
          type: string
          description: >-
            The surname, reported to HMRC; 1 to 35 characters starting with a
            letter, using letters, spaces, hyphens and apostrophes.
          example: Smith
        initials:
          type: string
          nullable: true
          description: The employee's initials.
        middleName:
          type: string
          nullable: true
          description: >-
            A second forename; optional, and checked against the same rules as
            firstName when sent.
          example: Edward
    AddressDto:
      type: object
      properties:
        line1:
          type: string
          nullable: true
          description: >-
            First line of the address; one of the address lines (line1, line2,
            county, city), each 1 to 35 characters starting with a letter or
            number.
          example: 123 Main Street
        line2:
          type: string
          nullable: true
          description: >-
            Second line of the address; one of the address lines (line1, line2,
            county, city), each 1 to 35 characters starting with a letter or
            number.
          example: Apt 4B
        city:
          type: string
          nullable: true
          description: >-
            Town or city; one of the address lines (line1, line2, county, city),
            each 1 to 35 characters starting with a letter or number.
          example: London
        county:
          type: string
          nullable: true
          description: >-
            County; one of the address lines (line1, line2, county, city), each
            1 to 35 characters starting with a letter or number.
          example: Greater London
        postcode:
          type: string
          nullable: true
          description: >-
            Postcode; checked against HMRC's UK postcode format when countryCode
            is GB or blank.
          example: SW1A 1AA
        countryCode:
          type: string
          nullable: true
          description: >-
            ISO 3166-1 alpha-2 country code. Defaults to "GB" when omitted or
            blank.
          example: GB
    EmployeeTaxCodeDto:
      type: object
      required:
        - code
      properties:
        code:
          type: string
          description: The tax code for the employee.
          example: 1257L
        effectiveDate:
          type: string
          nullable: true
          description: >-
            The effective date of the tax code, if none is set, created date is
            used.
          example: '2024-04-06'
        reason:
          type: string
          description: Reason for the tax code change
          example: Standard tax code
        issuedBy:
          type: string
          description: 'Who issued the tax code change. Valid values: ''HMRC'', ''Employer'''
          example: HMRC
        week1Month1:
          type: boolean
          description: Whether the tax code is week1Month1, meaning basis non cumulative
          example: false
    EmployeeStarterDetailsDto:
      type: object
      required:
        - startDate
        - starterDeclaration
      properties:
        startDate:
          type: string
          description: The start date of the employee.
          example: '2024-01-15'
        starterDeclaration:
          type: string
          enum:
            - ThisIsMyFirstJobSince6thApril
            - ThisIsMyOnlyJob
            - IHaveAnotherJobOrPension
            - None
          description: >-
            The starter declaration of the employee. Use
            'ThisIsMyFirstJobSince6thApril', 'ThisIsMyOnlyJob', or
            'IHaveAnotherJobOrPension' for a new starter. Use 'None' for an
            existing employee who has already been reported to HMRC (for
            example, one migrated mid-year from another payroll provider); in
            that case alreadySentToHmrcFps must be true.
          example: ThisIsMyOnlyJob
        secondedDetails:
          $ref: '#/components/schemas/EmployeeSecondedDetailsDto'
          nullable: true
          description: >-
            For an employee seconded to work in the UK, the secondment details
            reported to HMRC in place of a starter declaration; cannot be sent
            with starterDeclaration.
        alreadySentToHmrcFps:
          type: boolean
          description: >-
            Whether the employee's starter details have already been reported to
            HMRC on an FPS. Set to false for a new starter (the starter
            declaration is reported on the next FPS). Set to true for an
            existing employee already reported to HMRC; this is required when
            starterDeclaration is 'None'.
          example: false
    EmployeeStudentDetailsDto:
      type: object
      description: The student details of the employee
      properties:
        studentLoanDetails:
          $ref: '#/components/schemas/EmployeeStudentLoanDetailsDto'
          nullable: true
          description: The details of the student loan
        postgraduateLoanDetails:
          $ref: '#/components/schemas/EmployeePostgraduateLoanDetailsDto'
          nullable: true
          description: The details of the postgraduate loan
      example:
        studentLoanDetails:
          loanType: Plan2
          startDate: '2010-09-01'
          endDate: '2025-07-31'
        postgraduateLoanDetails:
          loanType: PostgraduateLoan
          startDate: '2015-09-01'
          endDate: '2028-07-31'
    EmployeeDirectorDetailsDto:
      type: object
      properties:
        directorsNICType:
          type: string
          enum:
            - Annual
            - Alternative
          description: >-
            Director's National Insurance contribution calculation method. Put
            'Annual' if you're using the standard annual method of work out the
            director's National Insurance contributions, or 'Alternative' if
            you're using the alternative method
          example: Annual
        appointmentDate:
          type: string
          description: The date of appointment of the employee's director.
          example: '2024-01-15'
        endDate:
          type: string
          nullable: true
          description: The date the employee ceased to be a director.
          example: '2025-03-31'
    EmployeeLeaverDetailsDto:
      type: object
      properties:
        leavingDate:
          type: string
          description: The date the employee left the company.
          example: '2024-12-31'
        reason:
          type: string
          nullable: true
          description: The reason the employee left the company.
          example: Retirement
        issuedBy:
          type: string
          nullable: true
          description: The entity that issued the leaver certificate.
          example: Employer
        reportedToHmrc:
          type: boolean
          description: Whether the leaver details have been reported to HMRC.
          example: false
        finalisedOnPayslip:
          type: boolean
          description: Whether the leaver has been reported on a finalised payslip.
    EmployeeWorkplaceDetailsDto:
      type: object
      properties:
        workplacePostcode:
          type: string
          nullable: true
          description: The postcode of the workplace this employee reports to.
          example: E1 6AN
    BankAccountDto:
      type: object
      required:
        - accountNumber
        - sortCode
      properties:
        accountNumber:
          type: string
          description: >-
            UK bank account number. Must be 6-8 digits (zero-padded to 8 for
            BACS).
          example: '12345678'
        sortCode:
          type: string
          description: >-
            UK bank sort code. Must be 6 digits. Hyphens are stripped before
            validation.
          example: '123456'
        accountHolderName:
          type: string
          description: >-
            Name of the account holder. Optional — falls back to employee name
            for payment files.
          example: John Smith
        isPrimaryPayrollAccount:
          type: boolean
          description: At least one bank account must be set as primary.
          example: true
        allocationPercentage:
          type: integer
          format: int32
          description: >-
            Percentage of salary allocated to this account. All accounts must
            total 100%.
          example: 100
    PensionEmployeeConfigDto:
      type: object
      description: >-
        Deprecated with pensionDetails (stops being returned on 14 January
        2027). The pension configuration a payslip's contribution was calculated
        from: the group, the pension type, the percentage rates (0 for a
        fixed-amount contribution) and whether it uses qualifying earnings.
      required:
        - employeeId
        - pensionGroupId
        - employeePensionRate
        - employerPensionRate
        - pensionType
        - nationalInsuranceSavingFactor
        - isQualifyingEarnings
      properties:
        employeeId:
          type: string
          description: The employee the payslip belongs to.
        pensionGroupId:
          type: string
          description: >-
            The pension group the contribution line was calculated under; empty
            when the line did not name one.
        employeePensionRate:
          type: number
          format: decimal
          description: >-
            The employee contribution percentage; 0 when the employee
            contributes a fixed amount.
        employerPensionRate:
          type: number
          format: decimal
          description: >-
            The employer contribution percentage; 0 when the employer
            contributes a fixed amount or nothing.
        pensionType:
          type: string
          enum:
            - NetPayArrangement
            - ReliefAtSource
            - SalarySacrifice
          description: ReliefAtSource, NetPayArrangement or SalarySacrifice.
        nationalInsuranceSavingFactor:
          type: number
          format: decimal
          description: >-
            Share of the employer NI saving passed into the pension, for salary
            sacrifice.
        isQualifyingEarnings:
          type: boolean
          description: >-
            Whether contributions are worked out on qualifying earnings rather
            than pensionable pay.
    TagDto:
      type: object
      properties:
        name:
          type: string
          description: The tag's name within its group.
          example: FullTime
        group:
          type: string
          description: The group the tag belongs to.
          example: EmploymentType
        value:
          type: string
          description: The tag's value for that name.
          example: FullTime
    OrganisationInformationDto:
      allOf:
        - $ref: '#/components/schemas/UpdatableOrganisationInformationDto'
        - type: object
          required:
            - organisationId
            - createdBy
            - createdDate
            - updatedBy
            - updatedDate
          properties:
            organisationId:
              type: string
              description: Organisation id of the organisation
              example: org_123
            createdBy:
              type: string
              description: >-
                Created by of the organisation information. This is the user who
                created the organisation information
              example: user_123
            createdDate:
              type: string
              format: date-time
              description: >-
                Created date of the organisation information. This is the date
                and time when the organisation information was created
              example: '2025-01-01T00:00:00Z'
            updatedBy:
              type: string
              description: >-
                Updated by of the organisation information. This is the user who
                updated the organisation information
              example: user_456
            updatedDate:
              type: string
              format: date-time
              description: >-
                Updated date of the organisation information. This is the date
                and time when the organisation information was updated
              example: '2025-01-02T00:00:00Z'
    TaxReferenceNumbersDto:
      type: object
      required:
        - employerPayeReference
        - accountsOfficeReference
      properties:
        employerPayeReference:
          $ref: '#/components/schemas/PayeReferenceNumberDto'
          description: >-
            The employer PAYE reference, split into the HMRC tax office number
            and the reference.
        accountsOfficeReference:
          type: string
          description: Accounts office reference.
          example: 123PX00123456
        selfAssessmentUniqueTaxpayerReference:
          type: string
          nullable: true
          description: Self assessment unique taxpayer reference.
          example: '1234567890'
        corporationTaxReferenceUniqueTaxpayerReference:
          type: string
          nullable: true
          description: Corporation tax reference unique taxpayer reference.
          example: '1234567890'
    EligibilityDto:
      type: object
      description: >-
        What this pay counts towards. Read-only: set by Flow Payroll from the
        pay element's other settings.
      properties:
        courtOrders:
          $ref: '#/components/schemas/CourtOrderEligibilityDto'
          nullable: true
          description: Which court order types may take money from this pay. Read-only.
      example:
        courtOrders:
          cmsDeo: true
          dea: true
          aeoPriority: true
          aeoNonPriority: true
          ctaeo: true
          ea: true
          mcaeo: true
          cma: true
          cao: true
          niFinesAeo: true
          niEjoAeo: true
    PaymentDetailsDto:
      type: object
      description: >-
        Payment details (BACS information) that can override default employee
        bank account
      properties:
        accountName:
          type: string
          nullable: true
          description: Account name
          example: CMS Central Account
        accountNumber:
          type: string
          nullable: true
          description: Account number
          example: '12345678'
        sortCode:
          type: string
          nullable: true
          description: Sort code
          example: 12-34-56
        paymentReference:
          type: string
          nullable: true
          description: >-
            Payment reference to include with BACS payment (e.g., court order
            remittance reference)
          example: CMS-2025-UK01
        paymentCategory:
          type: string
          enum:
            - CourtOrders
          description: Payment category for categorizing payment details
          example: CourtOrders
    AttachmentResponseDto:
      type: object
      required:
        - id
        - lineItemId
        - filename
        - contentType
        - fileSize
        - uploadedDate
        - uploadedBy
        - downloadUrl
        - downloadUrlExpiresAt
      properties:
        id:
          type: string
          description: The unique identifier for the attachment
        lineItemId:
          type: string
          description: The unique identifier of the associated payroll line item
        filename:
          type: string
          description: The original filename of the attachment
        contentType:
          type: string
          description: The MIME type of the file
        fileSize:
          type: integer
          format: int64
          description: The size of the file in bytes
        uploadedDate:
          type: string
          format: date-time
          description: The date and time the file was uploaded (ISO 8601 format)
        uploadedBy:
          type: string
          description: The identifier of the user who uploaded the file
        downloadUrl:
          type: string
          format: uri
          description: >-
            A link that downloads the file, valid for 60 minutes. Open it as it
            is; it needs no credentials.
        downloadUrlExpiresAt:
          type: string
          format: date-time
          description: When the download link stops working (ISO 8601 format)
    PayslipSummaryItemCalculationFlagsDto:
      type: object
      description: >-
        Eligibility flags taken from the source pay element, for apportioning
        per-element costs without re-reading the pay element's configuration.
      required:
        - niType
        - payType
        - isPensionable
        - accrueHoliday
        - isClass1ANiable
        - subjectToNmwCheck
      properties:
        niType:
          type: string
          enum:
            - Niable
            - NonNiable
            - EmployerOnly
          description: >-
            NI eligibility. Niable = both employee and employer NI apply;
            EmployerOnly = employer NI only (typical for some benefits in kind);
            NonNiable = no NI applies.
        payType:
          type: string
          enum:
            - Payable
            - Deductible
            - Informational
          description: >-
            Whether this line adds to gross (Payable), reduces it (Deductible),
            or is reporting-only (Informational).
        isPensionable:
          type: boolean
          description: Whether this line contributes to gross pensionable earnings.
        accrueHoliday:
          type: boolean
          description: Whether this line counts toward holiday accrual.
        isClass1ANiable:
          type: boolean
          description: >-
            Whether this line is subject to employer Class 1A NI (typically
            benefits in kind).
        subjectToNmwCheck:
          type: boolean
          description: >-
            Whether this item counts towards National Minimum Wage pay. Only
            Hour-unit items are assessed, so a Fixed-amount item is never part
            of the NMW calculation even when this is true.
        taxType:
          type: string
          enum:
            - Taxable
            - NonTaxable
          description: >-
            Tax eligibility. Payslips persisted before this was added may have
            it as null on legacy items.
    PensionMetadataSectionDto:
      type: object
      description: >-
        The pension context a contribution line calculates under. basis
        'QualifyingEarnings' banded against the statutory thresholds, anything
        else uses pensionable pay. Populated by the platform on the pension
        contribution lines it adds and read-only: it is ignored on
        caller-supplied lines.
      properties:
        pensionGroupId:
          type: string
          nullable: true
          description: The pension group the contribution line was calculated under.
        contributionSource:
          type: string
          enum:
            - Group
            - RecurringContributionOverride
            - ContributionOverride
          description: >-
            Where the contribution settings came from: Group (the pension
            group), RecurringContributionOverride (the employee's standing
            override) or ContributionOverride (a one-off override for this pay
            period only). Only set on the group contribution line; null
            elsewhere.
        basis:
          type: string
          nullable: true
          description: Pensionable | QualifyingEarnings
        employerContributionType:
          type: string
          enum:
            - Percentage
            - FixedAmount
          description: >-
            How the employer share is read. Null on lines with no employer share
            (additional voluntary contribution lines).
        employerContributionValue:
          type: number
          format: decimal
          nullable: true
          description: >-
            The employer percentage when employerContributionType is Percentage,
            or the employer per-period amount when it is FixedAmount.
        nationalInsuranceSavingsFactor:
          type: number
          format: decimal
          nullable: true
          description: >-
            Share (0-100) of the employer's NI saving added to the pension under
            salary sacrifice.
        employerRefundAmount:
          type: number
          format: decimal
          nullable: true
          description: >-
            The employer contribution paid back on an opt-out refund line. Set
            only on internal_pension_refund_* lines. Already netted off
            forPeriod.employerPension and reported in
            employerPensionRefundsByType, so it is disclosure and never
            additive. Ignored on any line the platform did not create.
        reliefAtSourceApplied:
          type: boolean
          nullable: true
          description: >-
            Relief at source lines only, whether the scheme's basic-rate relief
            was netted off the employee's deduction. false means the FULL gross
            contribution was deducted, because HMRC needs the member's National
            Insurance number for the scheme to reclaim the relief and this
            employee has none. That employee's deduction is therefore HIGHER
            than an identical colleague's while the same amount reaches their
            pot, which is correct and not a defect. Null where relief at source
            does not apply (net pay arrangement, salary sacrifice) and on
            payslips stored before this field existed.
        reliefAtSourceWithheldReason:
          type: string
          enum:
            - MissingNationalInsuranceNumber
          description: >-
            Why relief at source was withheld when it would otherwise have
            applied. Null whenever reliefAtSourceApplied is not false.
        pensionType:
          type: string
          nullable: true
          description: >-
            The pension type of the scheme the item belongs to. Set on the
            payslip items of pension contributions, additional voluntary
            contributions and opt-out refunds; ignored on input.
    NiCalculationResultDto:
      type: object
      properties:
        employeeNi:
          type: number
          format: decimal
          description: Employee National Insurance under this NI category letter.
        employerNi:
          type: number
          format: decimal
          description: Employer National Insurance under this NI category letter.
        totalNi:
          type: number
          format: decimal
          description: Employee and employer National Insurance added together.
        grossForEmployeeNi:
          type: number
          format: decimal
          description: >-
            Earnings that employee National Insurance was worked out on under
            this letter.
        grossForEmployerNi:
          type: number
          format: decimal
          description: >-
            Earnings that employer National Insurance was worked out on under
            this letter.
        bandResults:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NiBandResultDto'
          description: >-
            The same figures split by National Insurance band, keyed by band
            name.
      example:
        employeeNi: 290.1
        employerNi: 310.25
        totalNi: 600.35
        grossForEmployeeNi: 3500
        grossForEmployerNi: 3500
        bandResults:
          PT-UEL:
            grossInBand: 2000
            employeeNiForBand: 180
            employerNiForBand: 220
          UEL+:
            grossInBand: 500
            employeeNiForBand: 110.1
            employerNiForBand: 90.25
    StatutoryPaymentsReclaimDto:
      type: object
      properties:
        reclaimed:
          type: number
          format: decimal
          description: Amount reclaimed this tax year
          example: 100
        nicCompensationRecovered:
          type: number
          format: decimal
          description: National Insurance contribution compensation recovered this tax year
          example: 50
    EmployeeSecondedDetailsDto:
      type: object
      properties:
        stayStatus:
          type: string
          enum:
            - Stay183DaysOrMore
            - StayLessThan183Days
            - InOutUK
          description: >-
            Indicates the stay status of the employee Allowed values:
            'Stay183DaysOrMore', 'StayLessThan183Days', or 'InOutUK'.
          example: Stay183DaysOrMore
        eEACitizen:
          type: boolean
          description: Indicates if the employee is an EEA citizen.
          example: true
        ePM6:
          type: boolean
          description: Indicator that this is an EPM 6 (modified) scheme
          example: false
    EmployeeStudentLoanDetailsDto:
      type: object
      description: The details of the student loan
      properties:
        loanType:
          type: string
          enum:
            - Plan1
            - Plan2
            - Plan4
            - Plan5
          description: Type of student loan
          example: Plan2
        startDate:
          type: string
          nullable: true
          description: The start date of the student loan
          example: '2010-09-01'
        endDate:
          type: string
          nullable: true
          description: The end date of the student loan
          example: '2025-07-31'
      example:
        loanType: Plan2
        startDate: '2010-09-01'
        endDate: '2025-07-31'
    EmployeePostgraduateLoanDetailsDto:
      type: object
      description: The details of the postgraduate loan
      properties:
        loanType:
          type: string
          enum:
            - PostgraduateLoan
          description: Type of postgraduate loan
          example: PostgraduateLoan
        startDate:
          type: string
          nullable: true
          description: The start date of the postgraduate loan
          example: '2015-09-01'
        endDate:
          type: string
          nullable: true
          description: The end date of the postgraduate loan
          example: '2028-07-31'
      example:
        loanType: PostgraduateLoan
        startDate: '2015-09-01'
        endDate: '2028-07-31'
    UpdatableOrganisationInformationDto:
      type: object
      required:
        - name
        - organisationType
        - companyRegistrationNumber
        - businessType
        - registredOfficeAddress
        - correspondenceAddress
        - companyContactDetails
        - primaryContactDetails
      properties:
        name:
          $ref: '#/components/schemas/OrganisationNameDto'
          description: The organisation's legal name and optional trading name.
        organisationType:
          type: string
          enum:
            - Parent
            - Subsidiary
            - Independent
            - Franchise
            - Branch
          description: Organisation type of the organisation
        companyRegistrationNumber:
          type: string
          description: >-
            Company Registration Number (CRN), also known as a Companies House
            number, is a unique identifier assigned to a company when it's
            registered with Companies House. It's essentially a way to
            distinguish one company from another and verify its existence
          example: '12345678'
        businessType:
          type: string
          enum:
            - LimitedCompany
            - LimitedLiabilityPartnership
            - SoleTrader
            - Partnership
            - Charity
            - PublicSector
          description: Business type of the organisation
          example: LimitedCompany
        registredOfficeAddress:
          $ref: '#/components/schemas/AddressDto'
          description: >-
            The organisation's registered office address, printed as the
            employer address on payslips.
        correspondenceAddress:
          $ref: '#/components/schemas/AddressDto'
          description: The address the organisation receives correspondence at.
        companyContactDetails:
          $ref: '#/components/schemas/ContactDetailsDto'
          description: The organisation's general contact details.
        primaryContactDetails:
          $ref: '#/components/schemas/ContactDetailsDto'
          description: The details of the organisation's main contact person.
    PayeReferenceNumberDto:
      type: object
      required:
        - officeNumber
        - referenceNumber
      properties:
        officeNumber:
          type: string
          description: HMRC Office number.
          example: '123'
        referenceNumber:
          type: string
          description: Company's unique reference number.
          example: AB12345
    CourtOrderEligibilityDto:
      type: object
      description: >-
        Which court order types may take money from this pay. Read-only: Flow
        Payroll sets every flag from the pay element's payType, taxType,
        isClass1ANiable and statutory type, as UK law defines attachable
        earnings. Taxable pay (wages, bonus, commission, overtime, holiday pay,
        statutory sick pay, contractual top-ups) can be attached by every order
        type. Deductions, non-taxable payments, benefits in kind and statutory
        maternity, paternity, adoption, shared parental, parental bereavement
        and neonatal care pay cannot.
      required:
        - cmsDeo
        - dea
        - aeoPriority
        - aeoNonPriority
        - ctaeo
        - ea
        - mcaeo
        - cma
        - cao
        - niFinesAeo
        - niEjoAeo
      properties:
        cmsDeo:
          type: boolean
          description: >-
            Child Maintenance Service deduction from earnings order may take
            money from this pay.
          example: true
        dea:
          type: boolean
          description: Direct earnings attachment (DWP) may take money from this pay.
          example: true
        aeoPriority:
          type: boolean
          description: >-
            Attachment of earnings order, priority (maintenance) may take money
            from this pay.
          example: true
        aeoNonPriority:
          type: boolean
          description: >-
            Attachment of earnings order, non-priority (civil debt) may take
            money from this pay.
          example: true
        ctaeo:
          type: boolean
          description: >-
            Council tax attachment of earnings order may take money from this
            pay.
          example: true
        ea:
          type: boolean
          description: Earnings arrestment (Scotland) may take money from this pay.
          example: true
        mcaeo:
          type: boolean
          description: >-
            Magistrates' court attachment of earnings order (fines) may take
            money from this pay.
          example: true
        cma:
          type: boolean
          description: >-
            Current maintenance arrestment (Scotland) may take money from this
            pay.
          example: true
        cao:
          type: boolean
          description: Conjoined arrestment order (Scotland) may take money from this pay.
          example: true
        niFinesAeo:
          type: boolean
          description: >-
            Attachment of earnings order for fines (Northern Ireland) may take
            money from this pay.
          example: true
        niEjoAeo:
          type: boolean
          description: >-
            Attachment of earnings order made by the Enforcement of Judgments
            Office (Northern Ireland) may take money from this pay.
          example: true
    NiBandResultDto:
      type: object
      properties:
        grossInBand:
          type: number
          format: decimal
          description: Gross pay in this NI band
          example: 12570
        employeeNiForBand:
          type: number
          format: decimal
          description: Employee NI contribution for this band
          example: 0
        employerNiForBand:
          type: number
          format: decimal
          description: Employer NI contribution for this band
          example: 0
    OrganisationNameDto:
      type: object
      properties:
        legalName:
          type: string
          description: Legal name of the organisation
          example: Acme Corporation Ltd
        tradingName:
          type: string
          nullable: true
          description: Trading name of the organisation
          example: Acme Corp
    ContactDetailsDto:
      type: object
      properties:
        name:
          type: string
          description: Name of the contact.
          example: HR Department
        email:
          type: string
          description: Email of the contact.
          example: hr@acme.com
        phone:
          type: string
          nullable: true
          description: Phone of the contact.
          example: 0161 123 4567
  securitySchemes:
    XAuthToken:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: Access token obtained from OAuth2 client credentials flow
    XOrgId:
      type: apiKey
      in: header
      name: X-Org-Id
      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).

````

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