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

# Generate Employee P45

> Issue the employee's P45 and return the certificate. 201 if this call issued a new
P45; 200 if one already existed (idempotent — use ``/reissue`` for a deliberate new one).



## OpenAPI

````yaml /api-reference/preview.json post /gb/organizations/{organization_id}/reports/p45/employees/{employee_id}/generate
openapi: 3.2.0
info:
  title: Intermezzo Global Payroll
  summary: Global Payroll Platform
  description: Intermezzo's global payroll apis, organized by country
  version: '2026-10-07'
  x-logo:
    url: /static/icon.svg
servers:
  - url: https://preview.intermezzo.ai
    description: Preview
security: []
paths:
  /gb/organizations/{organization_id}/reports/p45/employees/{employee_id}/generate:
    post:
      tags:
        - Great Britain
        - Reports
        - P45
      summary: Generate Employee P45
      description: >-
        Issue the employee's P45 and return the certificate. 201 if this call
        issued a new

        P45; 200 if one already existed (idempotent — use ``/reissue`` for a
        deliberate new one).
      operationId: >-
        generate_employee_p45_gb_organizations__organization_id__reports_p45_employees__employee_id__generate_post
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            title: Organization Id
        - name: employee_id
          in: path
          required: true
          schema:
            type: string
            title: Employee Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/P45Certificate'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerToken: []
components:
  schemas:
    P45Certificate:
      properties:
        tax_year:
          type: integer
          title: Tax Year
        employee_id:
          type: string
          title: Employee Id
        employee_name:
          type: string
          title: Employee Name
          default: ''
        ni_number:
          type: string
          title: Ni Number
          default: ''
        works_number:
          type: string
          title: Works Number
          default: ''
        employer:
          anyOf:
            - $ref: '#/components/schemas/P45Employer'
            - type: 'null'
        employment_spell_seq:
          type: integer
          title: Employment Spell Seq
          default: 1
        leaving_date:
          type: string
          format: date
          title: Leaving Date
        tax_code:
          type: string
          title: Tax Code
          default: ''
        is_week1_month1:
          type: boolean
          title: Is Week1 Month1
          default: false
        pay_to_date:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Pay To Date
          default: '0.00'
        tax_to_date:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Tax To Date
          default: '0.00'
        student_loan_plan:
          anyOf:
            - type: string
            - type: 'null'
          title: Student Loan Plan
        continue_student_loan:
          type: boolean
          title: Continue Student Loan
          default: false
        continue_postgrad_loan:
          type: boolean
          title: Continue Postgrad Loan
          default: false
        generated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Generated At
        reissued_from_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reissued From Id
      additionalProperties: false
      type: object
      required:
        - tax_year
        - employee_id
        - leaving_date
      title: P45Certificate
      description: >-
        Full per-employee P45 — the JSON response and the PDF template both
        render from this.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    P45Employer:
      properties:
        name:
          type: string
          title: Name
          default: ''
        paye_reference:
          type: string
          title: Paye Reference
          default: ''
        address:
          type: string
          title: Address
          default: ''
      additionalProperties: false
      type: object
      title: P45Employer
      description: >-
        Employer block — org legal name, PAYE reference, and registered address
        (P45 header).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Get token from Auth0 and paste it here

````

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