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

# Create a new compensation

> Creates a new compensation (complemento) for the authenticated company.

**Compensation Types:**
- `fixed`: Fixed amount (quantity required)
- `variable`: Variable amount or percentage (quantity OR percentage required)
- `additional`: Additional complement (quantity OR percentage required)

**Valid Periods for Payroll:**
- `weekly`: Weekly payment
- `biweekly`: Every two weeks
- `fortnightly`: First and second half of month
- `monthly`: Monthly payment

Note: `yearly` period is NOT valid for payroll compensations.

**Important:** When assigning to employees, the compensation's period and currency must match the employee's active salary.



## OpenAPI

````yaml POST /contract/v1/compensations
openapi: 3.0.0
info:
  description: ''
  version: 3.0.0
  title: Sesame Public API
servers:
  - url: https://api-{region}.sesametime.com
    variables:
      region:
        default: eu1
security: []
tags: []
paths:
  /contract/v1/compensations:
    post:
      tags:
        - Compensations
      summary: Create a new compensation
      description: >-
        Creates a new compensation (complemento) for the authenticated company.


        **Compensation Types:**

        - `fixed`: Fixed amount (quantity required)

        - `variable`: Variable amount or percentage (quantity OR percentage
        required)

        - `additional`: Additional complement (quantity OR percentage required)


        **Valid Periods for Payroll:**

        - `weekly`: Weekly payment

        - `biweekly`: Every two weeks

        - `fortnightly`: First and second half of month

        - `monthly`: Monthly payment


        Note: `yearly` period is NOT valid for payroll compensations.


        **Important:** When assigning to employees, the compensation's period
        and currency must match the employee's active salary.
      operationId: CreateCompensation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - compensationType
                - period
                - currency
                - status
              properties:
                name:
                  type: string
                  description: Compensation name
                  example: Comision por ventas
                compensationType:
                  type: string
                  enum:
                    - fixed
                    - variable
                    - additional
                  description: >-
                    Type: fixed requires quantity; variable/additional require
                    quantity OR percentage
                quantity:
                  type: number
                  nullable: true
                  description: >-
                    Fixed amount (required for fixed type, mutually exclusive
                    with percentage)
                  example: 1500
                percentage:
                  type: number
                  nullable: true
                  description: >-
                    Percentage of gross salary (mutually exclusive with
                    quantity)
                  example: 10.5
                period:
                  type: string
                  enum:
                    - weekly
                    - biweekly
                    - fortnightly
                    - monthly
                  description: Payment period (yearly is NOT valid for payroll)
                currency:
                  type: string
                  description: Currency code (ISO 4217)
                  example: MXN
                recurrence:
                  type: integer
                  description: 'Payment recurrence (default: 1)'
                  default: 1
                status:
                  type: string
                  enum:
                    - active
                    - inactive
                  description: Compensation status
                code:
                  type: string
                  nullable: true
                  description: External code (for Contpaqi integration)
                comment:
                  type: string
                  nullable: true
                  description: Optional comment
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Compensation ID
                      companyId:
                        type: string
                        format: uuid
                        description: Company ID
                      name:
                        type: string
                        description: Compensation name
                        example: Comision por ventas
                      compensationType:
                        type: string
                        enum:
                          - fixed
                          - variable
                          - additional
                        description: >-
                          Compensation type: fixed (requires quantity), variable
                          or additional (require quantity OR percentage)
                      quantity:
                        type: number
                        nullable: true
                        description: Fixed amount (mutually exclusive with percentage)
                        example: 1500
                      percentage:
                        type: number
                        nullable: true
                        description: >-
                          Percentage of gross salary (mutually exclusive with
                          quantity)
                        example: 10.5
                      period:
                        type: string
                        enum:
                          - weekly
                          - biweekly
                          - fortnightly
                          - monthly
                        description: Payment period (yearly is NOT valid for payroll)
                      currency:
                        type: string
                        description: Currency code (ISO 4217)
                        example: MXN
                      recurrence:
                        type: integer
                        description: Payment recurrence
                        example: 1
                      status:
                        type: string
                        enum:
                          - active
                          - inactive
                        description: Compensation status
                      origin:
                        type: string
                        enum:
                          - payroll
                          - general
                        nullable: true
                        description: Origin of the compensation
                      code:
                        type: string
                        nullable: true
                        description: External code (for Contpaqi integration)
                      comment:
                        type: string
                        nullable: true
                        description: Optional comment
                      createdAt:
                        type: string
                        format: Y-m-dTH:i:sP
                        example: '2020-01-01T10:00:00+01:00'
                      updatedAt:
                        type: string
                        format: Y-m-dTH:i:sP
                        example: '2020-01-01T10:00:00+01:00'
                  meta:
                    type: object
                    properties:
                      currentPage:
                        type: integer
                        example: 1
                      lastPage:
                        type: integer
                        example: 1
                      total:
                        type: integer
                        example: 1
                      perPage:
                        type: integer
                        example: 1
        '400':
          description: Bad Request - The request was invalid or cannot be served
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing what went wrong
                    example: Validation failed for the provided data
                  errors:
                    type: array
                    description: List of specific validation errors
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: The field that caused the error
                          example: questionId
                        message:
                          type: string
                          description: Specific error message for the field
                          example: This value is not a valid UUID.
              example:
                message: Validation failed
                errors:
                  - field: questionId
                    message: This value is not a valid UUID.
                  - field: answer
                    message: This field is required for text-based questions.
        '401':
          description: Unauthorized - Invalid or missing API Key
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message indicating authentication failure
                    example: Invalid or missing API Key
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: UNAUTHORIZED
              example:
                message: Invalid or missing API Key
                code: UNAUTHORIZED
        '409':
          description: >-
            Conflict - The request conflicts with the current state of the
            server
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the conflict
                    example: Evaluation has already been completed
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: EVALUATION_ALREADY_COMPLETED
                  conflictDetails:
                    type: object
                    description: Additional details about the conflict
                    properties:
                      currentState:
                        type: string
                        description: Current state that conflicts with the request
                        example: completed
                      completedAt:
                        type: string
                        format: date-time
                        description: When the evaluation was completed
                        example: '2024-01-15T10:30:00Z'
              example:
                message: >-
                  Cannot submit answers for an evaluation that has already been
                  completed
                code: EVALUATION_ALREADY_COMPLETED
                conflictDetails:
                  currentState: completed
                  completedAt: '2024-01-15T10:30:00Z'
        '429':
          description: Too Many Requests - Rate limit exceeded
      security:
        - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````