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

# Create Deduction Template

> Create a Deduction Template for a company that defines the rules for a class of deduction, such as a 401(k) or garnishment.

The fields you can include are determined by the schema returned from [Deduction Template Definition](/reference/employee-checks/deductions/get-deduction-template-definitions).


## OpenAPI

````yaml openapi/employee-checks.json post /deductionTemplate
openapi: 3.1.0
info:
  title: zeal-api
  version: '1.0'
servers:
  - url: https://api.zeal.com
security:
  - sec0: []
paths:
  /deductionTemplate:
    post:
      summary: Create Deduction Template
      description: Create a deduction template.
      operationId: create-deduction-template
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - companyID
                - custom_name
              properties:
                companyID:
                  type: string
                  description: ID of Company
                custom_name:
                  type: string
                  description: >-
                    Name assigned to deduction template (this is what will show
                    on paystubs)
                deduction_type:
                  type: string
                  description: Type of deduction
                  enum:
                    - 401k
                    - hsa
                    - garnishment
                    - miscellaneous
                    - section_125
                    - roth_401k
                    - 403b
                    - simple_ira
                    - roth_ira
                employee_contribution:
                  type: object
                  description: >-
                    Object containing all the fields which are needed to define
                    the employee contribution.
                  properties:
                    override_type:
                      type: string
                      description: 'Override type (Accepts: final, overridable, needs_input)'
                    contribution_type:
                      type: string
                      description: 'Type of contribution (Accepts: dollars, percentage)'
                    value:
                      type: number
                      description: The Value of the employee contribution
                      format: float
                employer_contribution:
                  type: object
                  description: >-
                    Object containing all the fields which are needed to define
                    the employer_contribution.
                  properties:
                    override_type:
                      type: string
                      description: 'Override type (Accepts: final, overridable, needs_input)'
                    contribution_type:
                      type: string
                      description: 'Type of contribution (Accepts: dollars, percentage)'
                    value:
                      type: number
                      description: The Value of the employee contribution
                      format: float
                additional_fields:
                  type: object
                  description: >-
                    If the Deduction Template Definition contains
                    additional_fields, pass those values here
                  properties: {}
                deduction_credit:
                  type: boolean
                  description: >-
                    (Customer Accounts Only - Early Access) Denotes whether the
                    deduction should be returned back to the company or not. By
                    default, garnishments and miscellaneous type deductions are
                    not returned back, and all others are.
            examples:
              401k:
                value:
                  companyID: fc235f012baa12312asdasdaseda
                  deduction_type: 401k
                  custom_name: Zeal Testing 401k
                  employee_contribution:
                    contribution_type: dollars
                    value: 20
                    override_type: overridable
                  employer_contribution:
                    contribution_type: dollars
                    matching: false
                    value: 30
                    override_type: overridable
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    success: true
                    data:
                      deductionTemplateID: 61cad98c3e6f8201c34c77c0
                      companyID: fc235f012baa12312asdasdaseda
                      custom_name:
                        const: Zeal Testing 401k
                      deduction_type:
                        const: 401k
                      employee_contribution:
                        properties:
                          contribution_type:
                            const: dollars
                          value:
                            type: number
                            default: 0
                          override_type:
                            const: overridable
                        required:
                          - value
                      employer_contribution:
                        properties:
                          contribution_type:
                            const: dollars
                          percentage_source:
                            enum:
                              - contribution
                              - paycheck
                          matching:
                            const: false
                          value:
                            type: number
                            default: 0
                          override_type:
                            const: overridable
                        required:
                          - value
                      additional_properties: {}
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                    default: true
                  data:
                    type: object
                    properties:
                      deductionTemplateID:
                        type: string
                        example: 61cad98c3e6f8201c34c77c0
                      companyID:
                        type: string
                        example: fc235f012baa12312asdasdaseda
                      custom_name:
                        type: object
                        properties:
                          const:
                            type: string
                            example: Zeal Testing 401k
                      deduction_type:
                        type: object
                        properties:
                          const:
                            type: string
                            example: 401k
                      employee_contribution:
                        type: object
                        properties:
                          properties:
                            type: object
                            properties:
                              contribution_type:
                                type: object
                                properties:
                                  const:
                                    type: string
                                    example: dollars
                              value:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    example: number
                                  default:
                                    type: integer
                                    example: 0
                                    default: 0
                              override_type:
                                type: object
                                properties:
                                  const:
                                    type: string
                                    example: overridable
                          required:
                            type: array
                            items:
                              type: string
                              example: value
                      employer_contribution:
                        type: object
                        properties:
                          properties:
                            type: object
                            properties:
                              contribution_type:
                                type: object
                                properties:
                                  const:
                                    type: string
                                    example: dollars
                              percentage_source:
                                type: object
                                properties:
                                  enum:
                                    type: array
                                    items:
                                      type: string
                                      example: contribution
                              matching:
                                type: object
                                properties:
                                  const:
                                    type: boolean
                                    example: false
                                    default: true
                              value:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    example: number
                                  default:
                                    type: integer
                                    example: 0
                                    default: 0
                              override_type:
                                type: object
                                properties:
                                  const:
                                    type: string
                                    example: overridable
                          required:
                            type: array
                            items:
                              type: string
                              example: value
                      additional_properties:
                        type: object
                        properties: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value:
                    success: false
                    errors:
                      - message: Provided deduction template name already exists
                        code: 13
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                    default: true
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        message:
                          type: string
                          example: Provided deduction template name already exists
                        code:
                          type: integer
                          example: 13
                          default: 0
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: bearer

````