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

# Post calculationspreview



## OpenAPI

````yaml /api-reference/specs/statutory-pay.json post /calculations/preview
openapi: 3.0.1
info:
  title: Statutory Service
  description: Statutory Pay API for FlowPayroll
  contact:
    name: FlowPayroll
    email: support@flowpayroll.com
  version: v1
servers:
  - url: https://api.sandbox.flowpayroll.ai/v1/statutory-pay
security:
  - X-Auth-Token: []
    X-Org-Id: []
tags:
  - name: Statutory payments
    description: >-
      Create, retrieve, update, and delete statutory payments, and list them for
      an employee or organisation.
  - name: Line items & schedule
    description: >-
      Inspect and adjust payment line items, weekly amounts, and export the
      schedule.
  - name: External payments
    description: Record payments already made outside the payroll.
  - name: Attachments
    description: Upload and manage supporting documents for a statutory payment.
  - name: Alabaster & earnings
    description: >-
      Average weekly earnings and Alabaster (pay-rise) detection and
      recalculation.
  - name: Import & reconcile
    description: Import statutory payments and reconcile against a pay run.
  - name: Statutory Calculations
  - name: Statutory Rates
paths:
  /calculations/preview:
    post:
      tags:
        - Statutory Calculations
      operationId: CalculateStatutoryPayPreview
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/StatutorySickPayPreviewBodyDto'
                - $ref: '#/components/schemas/StatutoryMaternityPayPreviewBodyDto'
                - $ref: '#/components/schemas/StatutoryPaternityPayPreviewBodyDto'
                - $ref: '#/components/schemas/StatutoryAdoptionPayPreviewBodyDto'
                - $ref: >-
                    #/components/schemas/StatutoryParentalBereavementPayPreviewBodyDto
                - $ref: >-
                    #/components/schemas/StatutorySharedParentalPayPreviewBodyDto
                - $ref: '#/components/schemas/StatutoryNeoNatalCarePayPreviewBodyDto'
              discriminator:
                propertyName: statutoryType
                mapping:
                  StatutorySickPay:
                    $ref: '#/components/schemas/StatutorySickPayPreviewBodyDto'
                  StatutoryMaternityPay:
                    $ref: '#/components/schemas/StatutoryMaternityPayPreviewBodyDto'
                  StatutoryPaternityPay:
                    $ref: '#/components/schemas/StatutoryPaternityPayPreviewBodyDto'
                  StatutoryAdoptionPay:
                    $ref: '#/components/schemas/StatutoryAdoptionPayPreviewBodyDto'
                  StatutoryParentalBereavementPay:
                    $ref: >-
                      #/components/schemas/StatutoryParentalBereavementPayPreviewBodyDto
                  StatutorySharedParentalPay:
                    $ref: >-
                      #/components/schemas/StatutorySharedParentalPayPreviewBodyDto
                  StatutoryNeoNatalCarePay:
                    $ref: >-
                      #/components/schemas/StatutoryNeoNatalCarePayPreviewBodyDto
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody_CalculatorOutputResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody_Object'
components:
  schemas:
    StatutorySickPayPreviewBodyDto:
      allOf:
        - $ref: '#/components/schemas/StatutoryCalculatorPreviewBodyDtoBase'
        - type: object
          properties:
            isReceivingStatutoryMaternityPay:
              type: boolean
            previousSicknessPeriods:
              type: array
              items:
                $ref: '#/components/schemas/SicknessPeriodDto'
              nullable: true
            statutoryType:
              enum:
                - None
                - StatutorySickPay
                - StatutoryMaternityPay
                - StatutoryPaternityPay
                - StatutoryAdoptionPay
                - StatutoryParentalBereavementPay
                - StatutorySharedParentalPay
                - StatutoryNeoNatalCarePay
              type: string
              readOnly: true
          additionalProperties: false
    StatutoryMaternityPayPreviewBodyDto:
      allOf:
        - $ref: '#/components/schemas/StatutoryCalculatorPreviewBodyDtoBase'
        - type: object
          properties:
            statutoryType:
              enum:
                - None
                - StatutorySickPay
                - StatutoryMaternityPay
                - StatutoryPaternityPay
                - StatutoryAdoptionPay
                - StatutoryParentalBereavementPay
                - StatutorySharedParentalPay
                - StatutoryNeoNatalCarePay
              type: string
              readOnly: true
          additionalProperties: false
    StatutoryPaternityPayPreviewBodyDto:
      allOf:
        - $ref: '#/components/schemas/StatutoryCalculatorPreviewBodyDtoBase'
        - type: object
          properties:
            statutoryType:
              enum:
                - None
                - StatutorySickPay
                - StatutoryMaternityPay
                - StatutoryPaternityPay
                - StatutoryAdoptionPay
                - StatutoryParentalBereavementPay
                - StatutorySharedParentalPay
                - StatutoryNeoNatalCarePay
              type: string
              readOnly: true
          additionalProperties: false
    StatutoryAdoptionPayPreviewBodyDto:
      allOf:
        - $ref: '#/components/schemas/StatutoryCalculatorPreviewBodyDtoBase'
        - type: object
          properties:
            statutoryType:
              enum:
                - None
                - StatutorySickPay
                - StatutoryMaternityPay
                - StatutoryPaternityPay
                - StatutoryAdoptionPay
                - StatutoryParentalBereavementPay
                - StatutorySharedParentalPay
                - StatutoryNeoNatalCarePay
              type: string
              readOnly: true
          additionalProperties: false
    StatutoryParentalBereavementPayPreviewBodyDto:
      allOf:
        - $ref: '#/components/schemas/StatutoryCalculatorPreviewBodyDtoBase'
        - type: object
          properties:
            statutoryType:
              enum:
                - None
                - StatutorySickPay
                - StatutoryMaternityPay
                - StatutoryPaternityPay
                - StatutoryAdoptionPay
                - StatutoryParentalBereavementPay
                - StatutorySharedParentalPay
                - StatutoryNeoNatalCarePay
              type: string
              readOnly: true
          additionalProperties: false
    StatutorySharedParentalPayPreviewBodyDto:
      allOf:
        - $ref: '#/components/schemas/StatutoryCalculatorPreviewBodyDtoBase'
        - type: object
          properties:
            isPrimaryParent:
              type: boolean
            previousPrimaryPayWeeks:
              type: integer
              format: int32
              nullable: true
            otherParentShppWeeks:
              type: integer
              format: int32
              nullable: true
            statutoryType:
              enum:
                - None
                - StatutorySickPay
                - StatutoryMaternityPay
                - StatutoryPaternityPay
                - StatutoryAdoptionPay
                - StatutoryParentalBereavementPay
                - StatutorySharedParentalPay
                - StatutoryNeoNatalCarePay
              type: string
              readOnly: true
          additionalProperties: false
    StatutoryNeoNatalCarePayPreviewBodyDto:
      allOf:
        - $ref: '#/components/schemas/StatutoryCalculatorPreviewBodyDtoBase'
        - type: object
          properties:
            neonatalCareStartDate:
              type: string
              nullable: true
            neonatalCareEndDate:
              type: string
              nullable: true
            statutoryType:
              enum:
                - None
                - StatutorySickPay
                - StatutoryMaternityPay
                - StatutoryPaternityPay
                - StatutoryAdoptionPay
                - StatutoryParentalBereavementPay
                - StatutorySharedParentalPay
                - StatutoryNeoNatalCarePay
              type: string
              readOnly: true
          additionalProperties: false
    ResponseBody_CalculatorOutputResponse:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/ContentResponse_CalculatorOutputResponse'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
      additionalProperties: false
    ResponseBody_Object:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/ContentResponse_Object'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
      additionalProperties: false
    StatutoryCalculatorPreviewBodyDtoBase:
      required:
        - earnings
        - employmentStartDate
        - payFrequency
        - startDate
        - statutoryType
      type: object
      properties:
        statutoryType:
          enum:
            - None
            - StatutorySickPay
            - StatutoryMaternityPay
            - StatutoryPaternityPay
            - StatutoryAdoptionPay
            - StatutoryParentalBereavementPay
            - StatutorySharedParentalPay
            - StatutoryNeoNatalCarePay
          type: string
          readOnly: true
        startDate:
          minLength: 1
          type: string
        endDate:
          type: string
          nullable: true
        employmentStartDate:
          minLength: 1
          type: string
        payFrequency:
          minLength: 1
          type: string
        earnings:
          type: array
          items:
            type: number
            format: double
        qualifyingEventDate:
          type: string
          nullable: true
        workingDays:
          $ref: '#/components/schemas/WorkingDaysConfigurationDto'
        paidWeeks:
          type: number
          format: double
          nullable: true
        paidUntilDate:
          type: string
          nullable: true
      additionalProperties: false
      discriminator:
        propertyName: statutoryType
        mapping:
          StatutorySickPay:
            $ref: '#/components/schemas/StatutorySickPayPreviewBodyDto'
          StatutoryMaternityPay:
            $ref: '#/components/schemas/StatutoryMaternityPayPreviewBodyDto'
          StatutoryPaternityPay:
            $ref: '#/components/schemas/StatutoryPaternityPayPreviewBodyDto'
          StatutoryAdoptionPay:
            $ref: '#/components/schemas/StatutoryAdoptionPayPreviewBodyDto'
          StatutoryParentalBereavementPay:
            $ref: '#/components/schemas/StatutoryParentalBereavementPayPreviewBodyDto'
          StatutorySharedParentalPay:
            $ref: '#/components/schemas/StatutorySharedParentalPayPreviewBodyDto'
          StatutoryNeoNatalCarePay:
            $ref: '#/components/schemas/StatutoryNeoNatalCarePayPreviewBodyDto'
    SicknessPeriodDto:
      type: object
      properties:
        startDate:
          type: string
        endDate:
          type: string
        wereFirstThreeDaysPaid:
          type: boolean
      additionalProperties: false
    MessageWithTokenResponse:
      type: object
      properties:
        text:
          type: string
        token:
          type: string
        tokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    ContentResponse_CalculatorOutputResponse:
      type: object
      properties:
        data:
          oneOf:
            - $ref: '#/components/schemas/StatutoryAdoptionPayCalculationResponse'
            - $ref: '#/components/schemas/StatutoryMaternityPayCalculationResponse'
            - $ref: '#/components/schemas/StatutoryNeoNatalCarePayCalculationResponse'
            - $ref: >-
                #/components/schemas/StatutoryParentalBereavementPayCalculationResponse
            - $ref: '#/components/schemas/StatutoryPaternityPayCalculationResponse'
            - $ref: >-
                #/components/schemas/StatutorySharedParentalPayCalculationResponse
            - $ref: '#/components/schemas/StatutorySickPayCalculationResponse'
          nullable: true
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssue:
      type: object
      properties:
        field:
          type: string
        reason:
          type: string
        reasonToken:
          type: string
        reasonTokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    ContentResponse_Object:
      type: object
      properties:
        data:
          nullable: true
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    WorkingDaysConfigurationDto:
      type: object
      properties:
        standardWorkingDays:
          $ref: '#/components/schemas/StandardWorkingDaysDto'
        shiftPattern:
          $ref: '#/components/schemas/ShiftPatternDto'
        workingPattern:
          type: string
          nullable: true
        explicitSchedule:
          $ref: '#/components/schemas/ExplicitScheduleDto'
      additionalProperties: false
    ValidationIssueArgument:
      type: object
      properties:
        name:
          type: string
        value:
          nullable: true
      additionalProperties: false
    StatutoryAdoptionPayCalculationResponse:
      allOf:
        - $ref: '#/components/schemas/CalculatorOutputResponse'
        - type: object
          properties:
            statutoryType:
              type: string
              readOnly: true
          additionalProperties: false
    StatutoryMaternityPayCalculationResponse:
      allOf:
        - $ref: '#/components/schemas/CalculatorOutputResponse'
        - type: object
          properties:
            statutoryType:
              type: string
              readOnly: true
          additionalProperties: false
    StatutoryNeoNatalCarePayCalculationResponse:
      allOf:
        - $ref: '#/components/schemas/CalculatorOutputResponse'
        - type: object
          properties:
            statutoryType:
              type: string
              readOnly: true
          additionalProperties: false
    StatutoryParentalBereavementPayCalculationResponse:
      allOf:
        - $ref: '#/components/schemas/CalculatorOutputResponse'
        - type: object
          properties:
            statutoryType:
              type: string
              readOnly: true
          additionalProperties: false
    StatutoryPaternityPayCalculationResponse:
      allOf:
        - $ref: '#/components/schemas/CalculatorOutputResponse'
        - type: object
          properties:
            statutoryType:
              type: string
              readOnly: true
          additionalProperties: false
    StatutorySharedParentalPayCalculationResponse:
      allOf:
        - $ref: '#/components/schemas/CalculatorOutputResponse'
        - type: object
          properties:
            statutoryType:
              type: string
              readOnly: true
          additionalProperties: false
    StatutorySickPayCalculationResponse:
      allOf:
        - $ref: '#/components/schemas/CalculatorOutputResponse'
        - type: object
          properties:
            statutoryType:
              type: string
              readOnly: true
          additionalProperties: false
    ContentMetadataResponse:
      type: object
      properties:
        dateFormat:
          type: string
        dateTimeFormat:
          type: string
        paginationToken:
          type: string
          nullable: true
      additionalProperties: false
    StandardWorkingDaysDto:
      type: object
      properties:
        monday:
          type: boolean
        tuesday:
          type: boolean
        wednesday:
          type: boolean
        thursday:
          type: boolean
        friday:
          type: boolean
        saturday:
          type: boolean
        sunday:
          type: boolean
      additionalProperties: false
    ShiftPatternDto:
      type: object
      properties:
        rotationStartDate:
          type: string
        shifts:
          type: array
          items:
            $ref: '#/components/schemas/ShiftDto'
        patternType:
          type: string
        patternWeeks:
          type: integer
          format: int32
      additionalProperties: false
    ExplicitScheduleDto:
      type: object
      properties:
        weeks:
          type: array
          items:
            $ref: '#/components/schemas/ScheduledWeekDto'
      additionalProperties: false
    CalculatorOutputResponse:
      allOf:
        - $ref: '#/components/schemas/StatutoryCalculationResponse'
        - required:
            - statutoryType
          type: object
          properties:
            statutoryType:
              type: string
          additionalProperties: false
          discriminator:
            propertyName: statutoryType
            mapping:
              StatutoryAdoptionPayCalculationResponse:
                $ref: '#/components/schemas/StatutoryAdoptionPayCalculationResponse'
              StatutoryMaternityPayCalculationResponse:
                $ref: '#/components/schemas/StatutoryMaternityPayCalculationResponse'
              StatutoryNeoNatalCarePayCalculationResponse:
                $ref: >-
                  #/components/schemas/StatutoryNeoNatalCarePayCalculationResponse
              StatutoryParentalBereavementPayCalculationResponse:
                $ref: >-
                  #/components/schemas/StatutoryParentalBereavementPayCalculationResponse
              StatutoryPaternityPayCalculationResponse:
                $ref: '#/components/schemas/StatutoryPaternityPayCalculationResponse'
              StatutorySharedParentalPayCalculationResponse:
                $ref: >-
                  #/components/schemas/StatutorySharedParentalPayCalculationResponse
              StatutorySickPayCalculationResponse:
                $ref: '#/components/schemas/StatutorySickPayCalculationResponse'
    ShiftDto:
      type: object
      properties:
        name:
          type: string
        workingDays:
          $ref: '#/components/schemas/StandardWorkingDaysDto'
        durationInDays:
          type: integer
          format: int32
        weekNumber:
          type: integer
          format: int32
      additionalProperties: false
    ScheduledWeekDto:
      type: object
      properties:
        weekCommencing:
          type: string
        workingDays:
          $ref: '#/components/schemas/StandardWorkingDaysDto'
      additionalProperties: false
    StatutoryCalculationResponse:
      required:
        - statutoryType
      type: object
      properties:
        statutoryType:
          minLength: 1
          type: string
          readOnly: true
        totalAmount:
          type: number
          format: double
        statutoryId:
          type: string
          nullable: true
        uploadUrls:
          type: array
          items:
            $ref: '#/components/schemas/StatutoryAttachmentUploadResponse'
          nullable: true
        nonRoundedTotalAmount:
          type: number
          format: double
        requestDate:
          type: string
        startDate:
          type: string
        endDate:
          type: string
        breakdown:
          type: array
          items:
            $ref: '#/components/schemas/CalculatorOutputItemResponse'
        maxEndDate:
          type: string
          nullable: true
        dailyBreakdown:
          type: array
          items:
            $ref: '#/components/schemas/StatutoryDailyBreakdown'
          nullable: true
        periodRange:
          type: string
          nullable: true
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/StatutoryWarningDto'
        averageWeeklyEarnings:
          type: number
          format: double
          nullable: true
        paidUntilDate:
          type: string
          nullable: true
        paidAmount:
          type: number
          format: double
        pendingAmount:
          type: number
          format: double
        paidThroughPayPeriodEnd:
          type: string
          nullable: true
        paidThroughYear:
          type: integer
          format: int32
          nullable: true
        paidThroughPeriod:
          type: integer
          format: int32
          nullable: true
      additionalProperties: false
      discriminator:
        propertyName: statutoryType
        mapping:
          StatutorySickPay:
            $ref: '#/components/schemas/StatutorySickPayCalculationResponse'
          StatutoryMaternityPay:
            $ref: '#/components/schemas/StatutoryMaternityPayCalculationResponse'
          StatutoryPaternityPay:
            $ref: '#/components/schemas/StatutoryPaternityPayCalculationResponse'
          StatutoryAdoptionPay:
            $ref: '#/components/schemas/StatutoryAdoptionPayCalculationResponse'
          StatutoryParentalBereavementPay:
            $ref: >-
              #/components/schemas/StatutoryParentalBereavementPayCalculationResponse
          StatutorySharedParentalPay:
            $ref: '#/components/schemas/StatutorySharedParentalPayCalculationResponse'
          StatutoryNeoNatalCarePay:
            $ref: '#/components/schemas/StatutoryNeoNatalCarePayCalculationResponse'
    StatutoryAttachmentUploadResponse:
      type: object
      properties:
        attachmentId:
          type: string
        filename:
          type: string
        uploadUrl:
          type: string
        expiresAt:
          type: string
      additionalProperties: false
    CalculatorOutputItemResponse:
      type: object
      properties:
        year:
          type: integer
          format: int32
        period:
          type: integer
          format: int32
        frequency:
          type: string
        week:
          type: integer
          format: int32
        value:
          type: number
          format: double
        nonRoundedValue:
          type: number
          format: double
        status:
          type: string
      additionalProperties: false
    StatutoryDailyBreakdown:
      type: object
      properties:
        date:
          type: string
        status:
          enum:
            - NonQualifyingDay
            - WaitingDay
            - PaidDay
            - LimitReached
            - NonWorkingDay
          type: string
        amount:
          type: number
          format: double
          nullable: true
        description:
          type: string
          nullable: true
        isLinked:
          type: boolean
      additionalProperties: false
    StatutoryWarningDto:
      type: object
      properties:
        code:
          enum:
            - BackdatedWeeksAccruedToNextOpenRun
          type: string
        message:
          type: string
        details:
          $ref: '#/components/schemas/StatutoryWarningDetailsDto'
      additionalProperties: false
    StatutoryWarningDetailsDto:
      type: object
      properties:
        accruedWeeks:
          type: integer
          format: int32
          nullable: true
        accruedAmount:
          type: number
          format: double
          nullable: true
        accrualPaymentDate:
          type: string
          nullable: true
        closedPeriods:
          type: array
          items:
            $ref: '#/components/schemas/ClosedPeriodSummaryDto'
          nullable: true
      additionalProperties: false
    ClosedPeriodSummaryDto:
      type: object
      properties:
        year:
          type: integer
          format: int32
        period:
          type: integer
          format: int32
        payPeriodStartDate:
          type: string
        payPeriodEndDate:
          type: string
        paymentDate:
          type: string
      additionalProperties: false
  securitySchemes:
    X-Auth-Token:
      type: apiKey
      description: Authentication token for API access
      name: X-Auth-Token
      in: header
    X-Org-Id:
      type: apiKey
      description: >-
        Organisation to scope the request to. Required when the principal can
        access more than one organisation; optional for single-organisation
        principals (the authorizer resolves it automatically).
      name: X-Org-Id
      in: header

````