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

# Decide an opt-out refund

> Needs permission pension:write.

Records the employer's refund decision on an opt-out that has already ended. processRefund=true puts the employee's contributions back on their next payslip; otherwise noPayrollRefundReason says why not (for example, already refunded another way). A refund through payroll cannot be undone here: 409 once it has been made. The platform never decides this from a pension provider's own refund rules; the employer does.



## OpenAPI

````yaml /api-reference/specs/pension-v2.json put /employee-pension/{employeeId}/opt-out-refunds/{membershipEndDate}/decision
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:
  /employee-pension/{employeeId}/opt-out-refunds/{membershipEndDate}/decision:
    put:
      tags:
        - Employee enrolment
      summary: Decide an opt-out refund
      description: >-
        Needs permission pension:write.


        Records the employer's refund decision on an opt-out that has already
        ended. processRefund=true puts the employee's contributions back on
        their next payslip; otherwise noPayrollRefundReason says why not (for
        example, already refunded another way). A refund through payroll cannot
        be undone here: 409 once it has been made. The platform never decides
        this from a pension provider's own refund rules; the employer does.
      operationId: PutOptOutRefundDecision
      parameters:
        - name: employeeId
          in: path
          required: true
          schema:
            type: string
        - name: membershipEndDate
          in: path
          required: true
          schema:
            type: string
            format: date
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OptOutRefundDecisionRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PensionMembershipEndModelResponseBody'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
components:
  schemas:
    OptOutRefundDecisionRequest:
      type: object
      properties:
        processRefund:
          type: boolean
          description: >-
            True puts the refund of the employee's contributions on their next
            payslip.
        noPayrollRefundReason:
          type: string
          description: >-
            Why the employee is not being refunded through payroll, for example

            "Already refunded with a pay element". Required when processRefund
            is

            false; refused when it is true.
          nullable: true
        refundOutsideOptOutPeriodReason:
          type: string
          description: >-
            Why a refund is being made even though the opt-out was recorded as
            outside

            its opt-out period. Required only in that case.
          nullable: true
      additionalProperties: false
      description: >-
        The employer's refund decision for an opt-out. Exactly one of: refund

        through payroll, or a reason for not doing so. Whether the employee is
        owed

        money back through payroll is the employer's decision; the platform
        shows

        the amounts and records what was decided, it never decides from a

        provider's own refund rules.
    PensionMembershipEndModelResponseBody:
      required:
        - message
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/PensionMembershipEndModelContentResponse'
        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.
    ApiErrorResponse:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/ApiErrorMessage'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
      additionalProperties: false
    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`.
    PensionMembershipEndModelContentResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PensionMembershipEndModel'
        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
    ApiErrorMessage:
      type: object
      properties:
        text:
          type: string
          nullable: true
        token:
          type: string
          nullable: true
        tokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      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
    PensionMembershipEndModel:
      required:
        - awaitsRefundDecision
        - employeeId
        - employeeRefundTotal
        - employerRefundTotal
        - membershipEndDate
        - membershipEndReason
        - organisationId
        - recordedBy
        - recordedDate
        - refundProcessedThroughPayroll
        - refundedPeriods
      type: object
      properties:
        organisationId:
          type: string
          nullable: true
        employeeId:
          type: string
          nullable: true
        membershipEndDate:
          type: string
          description: The date the membership ended (the opt-out date, for an opt-out).
          nullable: true
        membershipEndReason:
          enum:
            - OptOut
            - MembershipCeased
            - AdministrativeRemoval
          type: string
          description: >-
            Why the membership ended, as the employer asserted it: "OptOut" (a
            valid

            opt-out notice), "MembershipCeased" (a later notice, so scheme rules

            govern any refund) or "AdministrativeRemoval" (a data correction, no

            statutory event).
          nullable: true
        enrolmentDate:
          type: string
          description: When the membership began, so the span the refund covers is visible.
          nullable: true
        pensionGroupId:
          type: string
          nullable: true
        pensionProviderId:
          type: string
          description: >-
            The provider that holds the money. It is the provider, not the
            employer,

            who repays employer contributions, and providers differ in how: some
            pay

            cash to a nominated bank account, others credit the employer's
            balance

            against the next contribution schedule.
          nullable: true
        refundProcessedThroughPayroll:
          type: boolean
          description: >-
            Whether the member refund was put through payroll. False when the

            operator chose to handle it outside payroll, or when there was
            nothing

            to refund.
        employeeRefundTotal:
          type: number
          description: >-
            Member contributions refunded through payroll. Always 0 for a salary

            sacrifice arrangement: the employee gave up salary rather than
            paying a

            contribution, so the whole amount is the employer's and appears in

            employerRefundTotal instead.
          format: double
        employerRefundTotal:
          type: number
          description: >-
            Employer contributions the scheme owes back to the employer. Never
            paid

            through the payslip and never part of the employee's pay: the scheme

            repays the employer directly (The Pensions Regulator's detailed
            guidance

            7, paragraphs 46 to 47). A scheme may retain it to offset its

            administrative expenses (paragraph 48), so treat this as the amount
            to

            reconcile against the provider rather than a guaranteed receipt.
          format: double
        refundedPeriods:
          type: array
          items:
            $ref: '#/components/schemas/RefundedPensionPeriodModel'
          description: The settled pay periods the refund covers, one entry per pay run.
          nullable: true
        enrolmentInformationSentDate:
          type: string
          description: >-
            When the member was given their enrolment information, as at the
            moment

            the membership ended. The opt-out period runs from the later of this
            and

            the enrolment date. Absent when the platform could not evidence it,
            or

            on endings recorded before it was kept.
          nullable: true
        optOutPeriodEndDate:
          type: string
          description: >-
            The last day an opt-out still carried a payroll refund, as assessed
            when

            the membership ended. Absent when no refund was requested, or on
            endings

            recorded before the window was assessed.
          nullable: true
        withinOptOutPeriod:
          type: boolean
          description: >-
            Whether the end date fell inside that window. Absent means it was
            not

            assessed, which is not the same as false.
          nullable: true
        refundOutsideOptOutPeriodReason:
          type: string
          description: >-
            Why a refund was made even though the membership ended outside the

            opt-out period. Present only on that case, and the audit trail for
            it.
          nullable: true
        noPayrollRefundReason:
          type: string
          description: >-
            Why the employer chose not to refund through payroll, in their
            words.

            Absent while nobody has decided, and after a refund through payroll.
          nullable: true
        awaitsRefundDecision:
          type: boolean
          description: >-
            True for an opt-out whose refund nobody has decided yet: not
            refunded

            through payroll and no reason recorded for not doing so. Decide it
            with

            PUT
            /employee-pension/{employeeId}/membership-ends/{membershipEndDate}/refund-decision.
        recordedBy:
          type: string
          nullable: true
        recordedDate:
          type: string
          nullable: true
      additionalProperties: false
      description: |-
        The record of a pension membership ending: why it ended, when, and what
        each side is owed. Kept after the enrolment itself is deleted, so an
        operator or an auditor can answer "what was refunded, and what is the
        provider sending back?" months later.
    RefundedPensionPeriodModel:
      required:
        - amount
        - employerAmount
        - period
        - taxYear
      type: object
      properties:
        taxYear:
          type: integer
          description: The tax year the pay period belongs to (e.g. 2026 for 2026/27).
          format: int32
        period:
          type: integer
          description: The pay period number within the tax year.
          format: int32
        amount:
          type: number
          description: Member contributions refunded for this pay period, via the payslip.
          format: double
        employerAmount:
          type: number
          description: >-
            Employer contributions for this pay period, returned by the provider
            to the employer.
          format: double
      additionalProperties: false
      description: One settled pay period inside a refund.

````

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