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

# Update a specific pay element by ID

> Updates a specific pay element by its ID for the current organisation



## OpenAPI

````yaml /api-reference/specs/pay-api.yaml put /organisation/pay-element/{payElementId}
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: Payroll
  - name: Payroll lines
  - name: PayrollConfig
  - name: Pay Elements
  - name: Calculator
  - name: Payslip
  - name: RTI
  - name: YearEnd
  - name: Organisation
paths:
  /organisation/pay-element/{payElementId}:
    put:
      tags:
        - Pay Elements
      summary: Update a specific pay element by ID
      description: Updates a specific pay element by its ID for the current organisation
      operationId: updatePayElement
      parameters:
        - name: payElementId
          in: path
          required: true
          schema:
            type: string
          description: The ID of the pay element to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePayElementDto'
      responses:
        '200':
          description: The pay element was updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ResponseBody'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/PayElementDto'
        '400':
          description: The request is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody'
        '404':
          description: >-
            Pay element not found or cannot be updated because it is a system
            code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseBody'
components:
  schemas:
    UpdatePayElementDto:
      type: object
      properties:
        description:
          type: string
          description: The description of the pay element
          example: Basic Salary
        taxType:
          type: string
          description: The tax type for the pay element
          enum:
            - Taxable
            - NonTaxable
          example: Taxable
        niType:
          type: string
          description: The National Insurance type for the pay element
          enum:
            - Niable
            - NonNiable
            - EmployerOnly
          example: Niable
        payType:
          type: string
          description: The pay type for the pay element
          enum:
            - Payable
            - Deductible
            - Informational
          example: Payable
        isPensionable:
          type: boolean
          description: Whether the pay element is pensionable
          example: true
        isClass1ANiable:
          type: boolean
          description: Whether the pay element is Class 1A National Insurance liable
          example: false
        accrueHoliday:
          type: boolean
          description: Whether the pay element accrues holiday
          example: true
        subjectToNmwCheck:
          type: boolean
          description: Whether the pay element is subject to National Minimum Wage checks
          example: true
        defaultUnitName:
          type: string
          nullable: true
          description: The default unit name for the pay element
          enum:
            - Hour
            - Day
            - Week
            - Month
            - Year
            - Fixed
            - Informational
            - Percentage
          example: Hour
        defaultPayRate:
          type: number
          format: decimal
          nullable: true
          description: The default pay rate for the pay element
          example: 15.5
        defaultUnitValue:
          type: number
          format: decimal
          nullable: true
          description: The default unit value for the pay element
          example: 1
        defaultChargeRate:
          type: number
          format: decimal
          nullable: true
          description: The default charge rate for the pay element
          example: 20
        eligibility:
          $ref: '#/components/schemas/EligibilityDto'
          nullable: true
          description: >-
            Eligibility flags for this pay element (court orders, pensions,
            etc.)
      required:
        - description
        - taxType
        - niType
        - payType
        - isPensionable
        - accrueHoliday
        - subjectToNmwCheck
    ResponseBody:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          type: object
          properties:
            data:
              type: object
              nullable: true
            metadata:
              type: object
              nullable: true
              properties:
                dateFormat:
                  type: string
                  default: yyyy-MM-dd
                dateTimeFormat:
                  type: string
                  default: yyyy-MM-ddTHH:mm:ss.fffZ
                paginationToken:
                  type: string
                  nullable: true
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
        messageToken:
          type: string
    PayElementDto:
      type: object
      description: Pay element details
      allOf:
        - $ref: '#/components/schemas/CreatePayElementDto'
        - type: object
          properties:
            organisationId:
              type: string
              description: The organisation ID to which the pay element belongs
              example: org_123
            isSystemCode:
              type: boolean
              description: Indicates if the pay element is a system code
              example: false
            createdBy:
              type: string
              description: The user who created the pay element
              example: user_123
            updatedBy:
              type: string
              description: The user who last updated the pay element
              example: user_456
            createdDate:
              type: string
              format: date-time
              description: The date and time when the pay element was created
              example: '2024-01-01T00:00:00Z'
            updatedDate:
              type: string
              format: date-time
              description: The date and time when the pay element was last updated
              example: '2024-01-02T00:00:00Z'
            eligibility:
              $ref: '#/components/schemas/EligibilityDto'
              nullable: true
              description: >-
                Eligibility flags for this pay element (court orders, pensions,
                etc.)
          required:
            - organisationId
            - createdBy
            - updatedBy
            - createdDate
            - updatedDate
    EligibilityDto:
      type: object
      description: Eligibility flags for different types (court orders, pensions, etc.)
      properties:
        courtOrders:
          $ref: '#/components/schemas/CourtOrderEligibilityDto'
          nullable: true
          description: Court order eligibility flags for this pay element
      example:
        courtOrders:
          cmsDeo: true
          dea: true
          aeoPriority: false
          aeoNonPriority: false
          ctaeo: false
          ea: false
          mcaeo: false
    MessageWithTokenResponse:
      type: object
      properties:
        text:
          type: string
        token:
          type: string
        tokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
    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.
      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
          nullable: true
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
    CreatePayElementDto:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the pay element
          example: PE001
        description:
          type: string
          description: The description of the pay element
          example: Basic Salary
        taxType:
          type: string
          description: The tax type for the pay element
          enum:
            - Taxable
            - NonTaxable
          example: Taxable
        niType:
          type: string
          description: The National Insurance type for the pay element
          enum:
            - Niable
            - NonNiable
            - EmployerOnly
          example: Niable
        payType:
          type: string
          description: The pay type for the pay element
          enum:
            - Payable
            - Deductible
            - Informational
          example: Payable
        isPensionable:
          type: boolean
          description: Whether the pay element is pensionable
          example: true
        isClass1ANiable:
          type: boolean
          description: Whether the pay element is Class 1A National Insurance liable
          example: false
        accrueHoliday:
          type: boolean
          description: Whether the pay element accrues holiday
          example: true
        subjectToNmwCheck:
          type: boolean
          description: Whether the pay element is subject to National Minimum Wage checks
          example: true
        defaultUnitName:
          type: string
          nullable: true
          description: The default unit name for the pay element
          enum:
            - Hour
            - Day
            - Week
            - Month
            - Year
            - Fixed
            - Informational
            - Percentage
          example: Hour
        defaultPayRate:
          type: number
          format: decimal
          nullable: true
          description: The default pay rate for the pay element
          example: 15.5
        defaultUnitValue:
          type: number
          format: decimal
          nullable: true
          description: The default unit value for the pay element
          example: 1
        defaultChargeRate:
          type: number
          format: decimal
          nullable: true
          description: The default charge rate for the pay element
          example: 20
        eligibility:
          $ref: '#/components/schemas/EligibilityDto'
          nullable: true
          description: >-
            Eligibility flags for this pay element (court orders, pensions,
            etc.)
      required:
        - id
        - description
        - taxType
        - niType
        - payType
        - isPensionable
        - accrueHoliday
        - subjectToNmwCheck
    CourtOrderEligibilityDto:
      type: object
      description: Court order eligibility flags for each order type
      properties:
        cmsDeo:
          type: boolean
          description: >-
            Eligible for CMS DEO (Child Maintenance Service Deduction from
            Earnings Order)
          example: true
        dea:
          type: boolean
          description: Eligible for DEA (Direct Earnings Attachment)
          example: true
        aeoPriority:
          type: boolean
          description: Eligible for AEO Priority (Attachment of Earnings Order - Priority)
          example: true
        aeoNonPriority:
          type: boolean
          description: >-
            Eligible for AEO Non-Priority (Attachment of Earnings Order -
            Non-Priority)
          example: true
        ctaeo:
          type: boolean
          description: Eligible for CTAEO (Council Tax Attachment of Earnings Order)
          example: true
        ea:
          type: boolean
          description: Eligible for EA (Earnings Attachment)
          example: false
        mcaeo:
          type: boolean
          description: >-
            Eligible for MCAEO (Maintenance Calculation Attachment of Earnings
            Order)
          example: false
    ValidationIssueArgument:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
  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).

````