> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vinmake.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Finalize Payroll Run

> Lock a draft run (no more payslip edits) ready for payment.



## OpenAPI

````yaml /api/openapi-cutmake.json patch /api/v1/payroll-runs/{run_id}/finalize
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /api/v1/payroll-runs/{run_id}/finalize:
    patch:
      tags:
        - 'Admin Sector: Payroll'
      summary: Finalize Payroll Run
      description: Lock a draft run (no more payslip edits) ready for payment.
      operationId: finalize_payroll_run_api_v1_payroll_runs__run_id__finalize_patch
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            title: Run Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayrollRunDetail'
        '401':
          description: Unauthorized
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    PayrollRunDetail:
      properties:
        id:
          type: string
          title: Id
        orgId:
          type: string
          title: Orgid
        periodLabel:
          type: string
          title: Periodlabel
        periodStart:
          type: string
          title: Periodstart
        periodEnd:
          type: string
          title: Periodend
        status:
          type: string
          title: Status
        totalGross:
          type: number
          title: Totalgross
        totalDeductions:
          type: number
          title: Totaldeductions
        totalNet:
          type: number
          title: Totalnet
        currency:
          type: string
          title: Currency
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
        updatedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Updatedat
        payslips:
          items:
            $ref: '#/components/schemas/PayslipResponse'
          type: array
          title: Payslips
      type: object
      required:
        - id
        - orgId
        - periodLabel
        - periodStart
        - periodEnd
        - status
        - totalGross
        - totalDeductions
        - totalNet
        - currency
      title: PayrollRunDetail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PayslipResponse:
      properties:
        id:
          type: string
          title: Id
        orgId:
          type: string
          title: Orgid
        payrollRunId:
          type: string
          title: Payrollrunid
        employeeId:
          type: string
          title: Employeeid
        baseSalary:
          type: number
          title: Basesalary
        unpaidLeaveDays:
          type: number
          title: Unpaidleavedays
        grossPay:
          type: number
          title: Grosspay
        allowances:
          type: number
          title: Allowances
        deductions:
          type: number
          title: Deductions
        netPay:
          type: number
          title: Netpay
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
      type: object
      required:
        - id
        - orgId
        - payrollRunId
        - employeeId
        - baseSalary
        - unpaidLeaveDays
        - grossPay
        - allowances
        - deductions
        - netPay
      title: PayslipResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````