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

# Set policy brokerage fees



## OpenAPI

````yaml /openapi.json post /policies/{policyId}/fees
openapi: 3.0.0
info:
  title: Korint Documentation
  description: Korint API Documentation
  version: 1.0.0
  contact: {}
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /policies/{policyId}/fees:
    post:
      tags:
        - policy
      summary: Set policy brokerage fees
      operationId: PolicyController_setPolicyFees
      parameters:
        - name: whenAt
          required: false
          in: query
          description: 'Optional: the whenAt datetime'
          schema:
            type: string
        - name: branchId
          required: false
          in: query
          description: 'Optional: the branchId'
          schema:
            type: string
        - name: policyId
          required: true
          in: path
          description: the policy id
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetPolicyFeesBody'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetPolicyFeesOutput'
        '400':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/InvalidCommissionRangeErrorDto'
                  - $ref: '#/components/schemas/InvalidBrokerageFeeErrorDto'
                  - $ref: '#/components/schemas/InvalidTotalBrokerageFeeErrorDto'
              examples:
                INVALID_COMMISSION_RANGE:
                  $ref: '#/components/schemas/InvalidCommissionRangeErrorDto'
                INVALID_BROKERAGE_FEE:
                  $ref: '#/components/schemas/InvalidBrokerageFeeErrorDto'
                INVALID_TOTAL_BROKERAGE_FEE:
                  $ref: '#/components/schemas/InvalidTotalBrokerageFeeErrorDto'
          description: ''
        '404':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PolicyNotFoundErrorDto'
              examples:
                POLICY_NOT_FOUND:
                  $ref: '#/components/schemas/PolicyNotFoundErrorDto'
          description: ''
components:
  schemas:
    SetPolicyFeesBody:
      type: object
      properties:
        fees:
          type: array
          items:
            $ref: '#/components/schemas/BrokerageFeeOnPolicy'
      required:
        - fees
    SetPolicyFeesOutput:
      type: object
      properties: {}
    InvalidCommissionRangeErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_COMMISSION_RANGE
        message:
          type: string
          example: >-
            Invalid commission range for {product}, allowed range must be
            between {min} and {max}
        details:
          $ref: '#/components/schemas/InvalidCommissionFeeDetailsDto'
      required:
        - code
        - message
        - details
    InvalidBrokerageFeeErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_BROKERAGE_FEE
        message:
          type: string
          example: >-
            Impossible brokerage fee, {attempted} must be between {min} and
            {max} (compensatedWith: {compensatedWith})
        details:
          $ref: '#/components/schemas/InvalidBrokerageFeeDto'
      required:
        - code
        - message
        - details
    InvalidTotalBrokerageFeeErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_TOTAL_BROKERAGE_FEE
        message:
          type: string
          example: >-
            Total brokerage fee must be in range {min} and {max}, got
            {attempted} (compensatedWith: {compensatedWith})
        details:
          $ref: '#/components/schemas/InvalidBrokerageFeeDto'
      required:
        - code
        - message
        - details
    PolicyNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - POLICY_NOT_FOUND
        message:
          type: string
          example: Policy {policyId} ({branchId}) not found
        details:
          $ref: '#/components/schemas/PolicyNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    BrokerageFeeOnPolicy:
      type: object
      properties:
        brokerageFirmId:
          type: string
          description: Brokerage firm id
          maximum: 100
          minimum: 0
        fee:
          type: number
          description: Fee
          maximum: 100
          minimum: 0
      required:
        - brokerageFirmId
        - fee
    InvalidCommissionFeeDetailsDto:
      type: object
      properties:
        product:
          type: string
        min:
          type: number
        max:
          type: number
      required:
        - product
        - min
        - max
    InvalidBrokerageFeeDto:
      type: object
      properties:
        min:
          type: number
        max:
          type: number
        attempted:
          type: number
        compensatedWith:
          type: string
      required:
        - min
        - max
        - attempted
    PolicyNotFoundDetailsDto:
      type: object
      properties:
        policyId:
          type: string
        branchId:
          type: string
        whenAt:
          type: string
        simulatedAt:
          type: string
      required:
        - policyId

````