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

# Record a calculation

> Records an employee's pension calculation for a pay period.



## OpenAPI

````yaml /api-reference/specs/pension-v2.json post /pension-calculation
openapi: 3.0.4
info:
  title: FlowPayroll Pension API
  version: v2
servers:
  - url: https://api.sandbox.flowpayroll.ai/v2/pension
security: []
tags:
  - name: Pension providers
    description: >-
      Look up the pension providers available to your organisation. Providers
      are set up in the product, so the API exposes them read-only.
  - name: Pension schemes
    description: >-
      Your organisation's arrangements with providers. Scheme endpoints use the
      /pension-schema path.
  - name: Pension groups
    description: >-
      Contribution rule sets within a scheme: pension type, contribution basis,
      and employee and employer factors.
  - name: Employee enrolment
    description: >-
      Associate employees with pension groups, remove associations, and send
      enrolment letters.
  - name: Pension information
    description: >-
      An employee's full pension picture in one call: composition, latest
      assessment, and postponement.
  - name: Auto-enrolment
    description: >-
      Assessment results per pay run, employees with outstanding or no
      auto-enrolment, and a stateless assessment preview.
  - name: Postponement
    description: Defer auto-enrolment per employee, overriding the organisation defaults.
  - name: Organisation defaults
    description: >-
      The organisation's default pension group, postponement definitions, and
      auto-enrolment mode.
  - name: Pension calculations
    description: >-
      Per-period contribution amounts, the contributions CSV, and provider
      export files.
  - name: Provider submissions
    description: >-
      Send a completed pay run to its connected pension provider, approve the
      payment, and read back what the provider reported: opt-outs, stopped
      contributions, refunds and schedules.
paths:
  /pension-calculation:
    post:
      tags:
        - Pension calculations
      summary: Record a calculation
      description: Records an employee's pension calculation for a pay period.
      operationId: PostEmployeePensionCalculation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitEmployeePensionCalculationRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmployeePensionCalculationV2ResponseBody'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
components:
  schemas:
    SubmitEmployeePensionCalculationRequest:
      required:
        - employeeAmount
        - employeeId
        - employerAmount
        - externalReferenceId
        - frequency
        - nationalInsuranceNumber
        - payrollConfigId
        - pensionProviderId
        - period
        - periodEnd
        - periodStart
        - year
      type: object
      properties:
        employeeId:
          type: string
          nullable: true
        frequency:
          type: string
          nullable: true
        year:
          type: integer
          format: int32
        period:
          type: integer
          format: int32
        payrollConfigId:
          type: string
          nullable: true
        employeeAmount:
          type: number
          format: double
        employerAmount:
          type: number
          format: double
        periodStart:
          type: string
          format: date
        periodEnd:
          type: string
          format: date
        nationalInsuranceNumber:
          type: string
          nullable: true
        externalReferenceId:
          type: string
          nullable: true
        pensionProviderId:
          type: string
          nullable: true
      additionalProperties: false
    EmployeePensionCalculationV2ResponseBody:
      required:
        - message
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/EmployeePensionCalculationV2ContentResponse'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          description: >-
            Deprecated: the same issues as `validationIssues` (`reasonText` is
            `reason`, `reasonId` is `reasonToken`, `reasonParameters` is
            `reasonTokenArguments`). Read `validationIssues`; this will be
            removed.
          nullable: true
          readOnly: true
          deprecated: true
        metadata:
          allOf:
            - $ref: '#/components/schemas/ContentMetadataResponse'
          description: >-
            Deprecated: the same values as `content.metadata`. Read that; this
            will be removed.
          deprecated: true
      additionalProperties: false
      description: >-
        The response envelope every FlowPayroll API answers with: a `message`,
        the

        `content`, and any `validationIssues`. `errors` and the top-level

        `metadata` are deprecated copies of `validationIssues` and

        `content.metadata`, and will be removed.
    ObjectResponseBody:
      required:
        - message
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/ObjectContentResponse'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          description: >-
            Deprecated: the same issues as `validationIssues` (`reasonText` is
            `reason`, `reasonId` is `reasonToken`, `reasonParameters` is
            `reasonTokenArguments`). Read `validationIssues`; this will be
            removed.
          nullable: true
          readOnly: true
          deprecated: true
        metadata:
          allOf:
            - $ref: '#/components/schemas/ContentMetadataResponse'
          description: >-
            Deprecated: the same values as `content.metadata`. Read that; this
            will be removed.
          deprecated: true
      additionalProperties: false
      description: >-
        The response envelope every FlowPayroll API answers with: a `message`,
        the

        `content`, and any `validationIssues`. `errors` and the top-level

        `metadata` are deprecated copies of `validationIssues` and

        `content.metadata`, and will be removed.
    MessageWithTokenResponse:
      required:
        - token
      type: object
      properties:
        text:
          type: string
          nullable: true
        token:
          type: string
          description: >-
            Stable snake_case key for the message, for clients that translate
            it.
          nullable: true
        tokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
        textId:
          type: string
          description: >-
            Deprecated: the same value as `token`. Read that; this will be
            removed.
          nullable: true
          readOnly: true
          deprecated: true
        textParameters:
          type: array
          items:
            $ref: '#/components/schemas/Pair'
          description: >-
            Deprecated: the same values as `tokenArguments`. Read that; this
            will be removed.
          nullable: true
          readOnly: true
          deprecated: true
      additionalProperties: false
      description: >-
        What happened, as English `text` and a stable `token` to translate from.

        `textId` and `textParameters` are deprecated copies of `token` and
        `tokenArguments`.
    EmployeePensionCalculationV2ContentResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/EmployeePensionCalculationV2'
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssue:
      type: object
      properties:
        field:
          type: string
          nullable: true
        reason:
          type: string
          nullable: true
        reasonToken:
          type: string
          nullable: true
        reasonTokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    Error:
      type: object
      properties:
        field:
          type: string
          nullable: true
        reasonText:
          type: string
          nullable: true
        reasonId:
          type: string
          nullable: true
        reasonParameters:
          type: array
          items:
            $ref: '#/components/schemas/Pair'
          nullable: true
      additionalProperties: false
      description: >-
        Deprecated: an entry of the old `errors` list. Read `validationIssues`
        instead.
      deprecated: true
    ContentMetadataResponse:
      type: object
      properties:
        dateFormat:
          type: string
          nullable: true
        dateTimeFormat:
          type: string
          nullable: true
        paginationToken:
          type: string
          nullable: true
      additionalProperties: false
    ObjectContentResponse:
      type: object
      properties:
        data:
          nullable: true
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssueArgument:
      type: object
      properties:
        name:
          type: string
          nullable: true
        value:
          nullable: true
      additionalProperties: false
    Pair:
      type: object
      properties:
        key:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
      additionalProperties: false
      description: >-
        Deprecated: a key and value of the old `textParameters` and
        `reasonParameters`.
      deprecated: true
    EmployeePensionCalculationV2:
      required:
        - employeeAmount
        - employeeId
        - employerAmount
        - frequency
        - organisationId
        - payrollConfigId
        - period
        - year
      type: object
      properties:
        employeeId:
          type: string
          nullable: true
        frequency:
          type: string
          nullable: true
        year:
          type: integer
          format: int32
        period:
          type: integer
          format: int32
        payrollConfigId:
          type: string
          nullable: true
        organisationId:
          type: string
          nullable: true
        employeeAmount:
          type: number
          format: double
        employerAmount:
          type: number
          format: double
        additionalVoluntaryAmount:
          type: number
          description: >-
            The additional voluntary contribution portion of employeeAmount
            (standing

            plus any one-off top-up). Zero when the member pays only the scheme
            contribution.
          format: double
        periodStart:
          type: string
          format: date
        periodEnd:
          type: string
          format: date
        nationalInsuranceNumber:
          type: string
          nullable: true
        externalReferenceId:
          type: string
          nullable: true
        pensionProviderId:
          type: string
          nullable: true
        refunded:
          type: boolean
          description: >-
            Whether these contributions have since been refunded because the
            member

            opted out. The amounts above are left as they were settled (the
            period

            really did deduct them, and the provider file for that period
            reported

            them), so this flag is the only thing that says the money went back.

            Read it before presenting a past period's contributions as still
            held.

            The member's share is refunded through payroll; the employer's is
            repaid

            by the scheme to the employer, so see the pension membership endings

            endpoint for who owes what.
      additionalProperties: false

````

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