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

# Set the commission calculation for a deal

> Override the commission calculation on a deal. This replaces the entire `calculation` structure. Use this to manually adjust commissions after they've been auto-applied from a commission rule. The structure matches the commission rule format — see POST /v1/commissions for the full calculation schema documentation.

Each entry may carry a manual `override` to set a fixed commission instead of the calculation: provide `amount` (whole currency units), `currency_code`, and optionally a markdown `note` and a `document_url` (pdf/csv/excel, fetched into Journeybee's CDN) or `document_asset_uuid`. Manual overrides require the company's commission-overrides setting to be enabled (otherwise `403`). Setting the commission recalculates the deal's pending payment records.



## OpenAPI

````yaml /openapi.json put /deals/{uuid}/commission
openapi: 3.1.0
info:
  title: Journeybee API
  description: >-
    Public REST API for the Journeybee PRM platform.


    Manage partners, leads, deals, products, pricing calculators, tasks, and
    more programmatically.


    All endpoints require authentication via API key. Use `Authorization: Bearer
    <api_key>` or `Api-Key <api_key>` header.


    See the [Authentication guide](/guides/authentication) for details.
  version: 1.0.0
servers:
  - url: https://api.journeybee.io/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Account
    description: >-
      Authenticated company account info, API key permissions, and enabled
      modules
  - name: Analytics
    description: >-
      Dashboard analytics and reporting — commission, engagement, LMS, and
      partner revenue metrics
  - name: Assets
    description: File and media asset management
  - name: Attributions
    description: Attribution type definitions
  - name: Audit Log
    description: Unified audit log of company activity (read-only)
  - name: Automations
    description: Workflow automation rule configurations
  - name: Campaign Audience
    description: Audience filters on a campaign
  - name: Campaign Partners
    description: Partners shared into a campaign audience
  - name: Campaigns
    description: Partner marketing campaigns
  - name: Card Assignees
    description: Assigned users on a card
  - name: Card Partners
    description: Partners linked to a card
  - name: Card Tags
    description: Tags on a card
  - name: Cards
    description: Kanban project cards
  - name: Categories
    description: Partner categories
  - name: Certification Categories
    description: Categories on a certification
  - name: Certification Enrollments
    description: User enrollments in a certification
  - name: Certification Folders
    description: Folders on a certification
  - name: Certification Resources
    description: Curriculum resources in a certification
  - name: Certifications
    description: LMS certifications
  - name: Commissions
    description: >-
      Commission rule configurations with calculation entries,
      tier/category/partnership scoping
  - name: Contacts
    description: Partner contacts across partnerships
  - name: Currencies
    description: Available currencies
  - name: Custom Field Options
    description: Options on select/multi-select custom fields
  - name: Custom Field Rules
    description: Visibility and requirement rules on custom fields
  - name: Custom Field Values
    description: Custom field values
  - name: Custom Fields
    description: Custom field definitions
  - name: Deal Commission
    description: Commission calculation on a deal
  - name: Deal Custom Field Values
    description: Custom field values on a deal
  - name: Deal Notes
    description: Notes on a deal
  - name: Deal Payments
    description: Payment records on a deal (read-only)
  - name: Deal Products
    description: Products attached to a deal
  - name: Deal Stages
    description: Deal pipeline stages
  - name: Deal Tags
    description: Tags on a deal
  - name: Deal Tasks
    description: Tasks on a deal
  - name: Deals
    description: Deal management
  - name: Folders
    description: Content folders
  - name: Lead Attributions
    description: Attribution records on a lead
  - name: Lead Contacts
    description: Partner contacts on a lead
  - name: Lead Custom Field Values
    description: Custom field values on a lead
  - name: Lead Distributor
    description: Distributors for a lead
  - name: Lead Notes
    description: Notes on a lead
  - name: Lead Products
    description: Products attached to a lead
  - name: Lead Quotes
    description: >-
      Quotes on a lead — generated from pricing calculators with line items and
      totals
  - name: Lead Tags
    description: Tags on a lead
  - name: Lead Tasks
    description: Tasks on a lead
  - name: Lead Users
    description: Assigned users on a lead
  - name: Leads
    description: Lead management
  - name: Marketing Templates
    description: Marketing email templates
  - name: Partner Contacts
    description: Contacts on a partner
  - name: Partner Custom Field Values
    description: Custom field values on a partner
  - name: Partner Domains
    description: Domains on a partner
  - name: Partner Notes
    description: Notes on a partner
  - name: Partner Resellers
    description: Reseller assignments on a distributor
  - name: Partner Stages
    description: Partner pipeline stages
  - name: Partner Tags
    description: Tags on a partner
  - name: Partner Users
    description: Assigned users on a partner
  - name: Partners
    description: Core partner CRUD
  - name: Pricing Calculator Fields
    description: Input fields on a pricing calculator
  - name: Pricing Calculator Formulas
    description: Discount/tax/surcharge formulas on a pricing calculator
  - name: Pricing Calculator Products
    description: Products attached to a pricing calculator
  - name: Pricing Calculators
    description: Pricing calculator configurations
  - name: Products
    description: Product catalog
  - name: Resource Blocks
    description: Content blocks within a resource
  - name: Resource Categories
    description: Categories on a resource
  - name: Resource Folders
    description: Folders on a resource
  - name: Resource Tags
    description: Tags on a resource
  - name: Resources
    description: Learning resources
  - name: Room Blocks
    description: Content blocks within a room
  - name: Room Categories
    description: Category-based room access control
  - name: Room Partnerships
    description: Direct partnership room access
  - name: Room Stages
    description: Stage-based room access control
  - name: Room Tags
    description: Tag-based room access control
  - name: Room Tiers
    description: Tier-based room access control
  - name: Rooms
    description: Partner portal rooms
  - name: Tags
    description: Tag definitions
  - name: Task Users
    description: Assigned users on a task
  - name: Tasks
    description: Task management
  - name: Tiers
    description: Partner tiers
  - name: Users
    description: Company team members
  - name: Webhook Events
    description: Outbound webhook payloads sent to your configured URLs when events occur
paths:
  /deals/{uuid}/commission:
    put:
      tags:
        - Deal Commission
      summary: Set the commission calculation for a deal
      description: >-
        Override the commission calculation on a deal. This replaces the entire
        `calculation` structure. Use this to manually adjust commissions after
        they've been auto-applied from a commission rule. The structure matches
        the commission rule format — see POST /v1/commissions for the full
        calculation schema documentation.


        Each entry may carry a manual `override` to set a fixed commission
        instead of the calculation: provide `amount` (whole currency units),
        `currency_code`, and optionally a markdown `note` and a `document_url`
        (pdf/csv/excel, fetched into Journeybee's CDN) or `document_asset_uuid`.
        Manual overrides require the company's commission-overrides setting to
        be enabled (otherwise `403`). Setting the commission recalculates the
        deal's pending payment records.
      operationId: setDealCommission
      parameters:
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: path
          name: uuid
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                calculation:
                  type: object
                  properties:
                    entries:
                      type: array
                      items:
                        type: object
                        properties:
                          payment_stage_id:
                            anyOf:
                              - type: number
                              - type: 'null'
                            description: >-
                              Deal stage ID that triggers payment. Null = manual
                              trigger.
                          calculation:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - oneOff
                                  - recurring
                                  - split
                              option:
                                description: >-
                                  fixed: flat amount. percentage: % of deal
                                  value. scaling: varies by custom field.
                                anyOf:
                                  - type: string
                                    enum:
                                      - fixed
                                      - percentage
                                      - scaling
                                  - type: 'null'
                              value:
                                description: Amount (fixed) or percentage
                                anyOf:
                                  - anyOf:
                                      - type: string
                                      - type: number
                                  - type: 'null'
                              scalingConfig:
                                anyOf:
                                  - type: object
                                    properties:
                                      customFieldId:
                                        type: number
                                        description: >-
                                          Custom field whose value determines the
                                          tier
                                      tiers:
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            optionId:
                                              type: number
                                              description: Custom field option ID
                                            option:
                                              type: string
                                              enum:
                                                - fixed
                                                - percentage
                                              description: Calculation method
                                            value:
                                              type: number
                                              description: Amount or percentage
                                          required:
                                            - optionId
                                            - option
                                            - value
                                          additionalProperties: false
                                    required:
                                      - customFieldId
                                      - tiers
                                    additionalProperties: false
                                    description: >-
                                      Scaling — commission varies based on a
                                      custom field option.
                                  - type: 'null'
                              recurring_period:
                                description: Payment frequency
                                anyOf:
                                  - type: string
                                    enum:
                                      - weekly
                                      - monthly
                                      - quarterly
                                      - yearly
                                  - type: 'null'
                              number_of_occurrences:
                                description: Total recurring payments
                                anyOf:
                                  - anyOf:
                                      - type: number
                                      - type: string
                                  - type: 'null'
                              periodRates:
                                anyOf:
                                  - type: object
                                    properties:
                                      enabled:
                                        type: boolean
                                      periods:
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            periodNumber:
                                              type: number
                                            startOccurrence:
                                              type: number
                                              description: First occurrence this rate applies to
                                            endOccurrence:
                                              anyOf:
                                                - type: number
                                                - type: 'null'
                                              description: Last occurrence (null = unlimited)
                                            option:
                                              type: string
                                              enum:
                                                - fixed
                                                - percentage
                                                - scaling
                                            value:
                                              type: number
                                            scalingConfig:
                                              type: object
                                              properties:
                                                customFieldId:
                                                  type: number
                                                  description: >-
                                                    Custom field whose value determines the
                                                    tier
                                                tiers:
                                                  type: array
                                                  items:
                                                    type: object
                                                    properties:
                                                      optionId:
                                                        type: number
                                                        description: Custom field option ID
                                                      option:
                                                        type: string
                                                        enum:
                                                          - fixed
                                                          - percentage
                                                        description: Calculation method
                                                      value:
                                                        type: number
                                                        description: Amount or percentage
                                                    required:
                                                      - optionId
                                                      - option
                                                      - value
                                                    additionalProperties: false
                                              required:
                                                - customFieldId
                                                - tiers
                                              additionalProperties: false
                                              description: >-
                                                Scaling — commission varies based on a
                                                custom field option.
                                          required:
                                            - periodNumber
                                            - startOccurrence
                                            - endOccurrence
                                            - option
                                            - value
                                          additionalProperties: false
                                    required:
                                      - enabled
                                      - periods
                                    additionalProperties: false
                                    description: >-
                                      Variable rates per period range in
                                      recurring commissions.
                                  - type: 'null'
                              split:
                                description: 'Split: combines one-time + recurring payments.'
                                type: object
                                properties:
                                  oneOff:
                                    type: object
                                    properties:
                                      type:
                                        description: >-
                                          oneOff: single payment when stage
                                          reached. recurring: periodic payments.
                                        anyOf:
                                          - type: string
                                            enum:
                                              - oneOff
                                              - recurring
                                          - type: 'null'
                                      option:
                                        description: >-
                                          fixed: flat amount. percentage: % of
                                          deal value. scaling: varies by custom
                                          field.
                                        anyOf:
                                          - type: string
                                            enum:
                                              - fixed
                                              - percentage
                                              - scaling
                                          - type: 'null'
                                      value:
                                        description: Amount (fixed) or percentage
                                        anyOf:
                                          - anyOf:
                                              - type: string
                                              - type: number
                                          - type: 'null'
                                      scalingConfig:
                                        anyOf:
                                          - type: object
                                            properties:
                                              customFieldId:
                                                type: number
                                                description: >-
                                                  Custom field whose value determines the
                                                  tier
                                              tiers:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    optionId:
                                                      type: number
                                                      description: Custom field option ID
                                                    option:
                                                      type: string
                                                      enum:
                                                        - fixed
                                                        - percentage
                                                      description: Calculation method
                                                    value:
                                                      type: number
                                                      description: Amount or percentage
                                                  required:
                                                    - optionId
                                                    - option
                                                    - value
                                                  additionalProperties: false
                                            required:
                                              - customFieldId
                                              - tiers
                                            additionalProperties: false
                                            description: >-
                                              Scaling — commission varies based on a
                                              custom field option.
                                          - type: 'null'
                                      recurring_period:
                                        description: Payment frequency
                                        anyOf:
                                          - type: string
                                            enum:
                                              - weekly
                                              - monthly
                                              - quarterly
                                              - yearly
                                          - type: 'null'
                                      number_of_occurrences:
                                        description: Total recurring payments
                                        anyOf:
                                          - anyOf:
                                              - type: number
                                              - type: string
                                          - type: 'null'
                                      periodRates:
                                        anyOf:
                                          - type: object
                                            properties:
                                              enabled:
                                                type: boolean
                                              periods:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    periodNumber:
                                                      type: number
                                                    startOccurrence:
                                                      type: number
                                                      description: First occurrence this rate applies to
                                                    endOccurrence:
                                                      anyOf:
                                                        - type: number
                                                        - type: 'null'
                                                      description: Last occurrence (null = unlimited)
                                                    option:
                                                      type: string
                                                      enum:
                                                        - fixed
                                                        - percentage
                                                        - scaling
                                                    value:
                                                      type: number
                                                    scalingConfig:
                                                      type: object
                                                      properties:
                                                        customFieldId:
                                                          type: number
                                                          description: >-
                                                            Custom field whose value determines the
                                                            tier
                                                        tiers:
                                                          type: array
                                                          items:
                                                            type: object
                                                            properties:
                                                              optionId:
                                                                type: number
                                                                description: Custom field option ID
                                                              option:
                                                                type: string
                                                                enum:
                                                                  - fixed
                                                                  - percentage
                                                                description: Calculation method
                                                              value:
                                                                type: number
                                                                description: Amount or percentage
                                                            required:
                                                              - optionId
                                                              - option
                                                              - value
                                                            additionalProperties: false
                                                      required:
                                                        - customFieldId
                                                        - tiers
                                                      additionalProperties: false
                                                      description: >-
                                                        Scaling — commission varies based on a
                                                        custom field option.
                                                  required:
                                                    - periodNumber
                                                    - startOccurrence
                                                    - endOccurrence
                                                    - option
                                                    - value
                                                  additionalProperties: false
                                            required:
                                              - enabled
                                              - periods
                                            additionalProperties: false
                                            description: >-
                                              Variable rates per period range in
                                              recurring commissions.
                                          - type: 'null'
                                    additionalProperties: false
                                    description: One-time payment component
                                  recurring:
                                    type: object
                                    properties:
                                      type:
                                        description: >-
                                          oneOff: single payment when stage
                                          reached. recurring: periodic payments.
                                        anyOf:
                                          - type: string
                                            enum:
                                              - oneOff
                                              - recurring
                                          - type: 'null'
                                      option:
                                        description: >-
                                          fixed: flat amount. percentage: % of
                                          deal value. scaling: varies by custom
                                          field.
                                        anyOf:
                                          - type: string
                                            enum:
                                              - fixed
                                              - percentage
                                              - scaling
                                          - type: 'null'
                                      value:
                                        description: Amount (fixed) or percentage
                                        anyOf:
                                          - anyOf:
                                              - type: string
                                              - type: number
                                          - type: 'null'
                                      scalingConfig:
                                        anyOf:
                                          - type: object
                                            properties:
                                              customFieldId:
                                                type: number
                                                description: >-
                                                  Custom field whose value determines the
                                                  tier
                                              tiers:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    optionId:
                                                      type: number
                                                      description: Custom field option ID
                                                    option:
                                                      type: string
                                                      enum:
                                                        - fixed
                                                        - percentage
                                                      description: Calculation method
                                                    value:
                                                      type: number
                                                      description: Amount or percentage
                                                  required:
                                                    - optionId
                                                    - option
                                                    - value
                                                  additionalProperties: false
                                            required:
                                              - customFieldId
                                              - tiers
                                            additionalProperties: false
                                            description: >-
                                              Scaling — commission varies based on a
                                              custom field option.
                                          - type: 'null'
                                      recurring_period:
                                        description: Payment frequency
                                        anyOf:
                                          - type: string
                                            enum:
                                              - weekly
                                              - monthly
                                              - quarterly
                                              - yearly
                                          - type: 'null'
                                      number_of_occurrences:
                                        description: Total recurring payments
                                        anyOf:
                                          - anyOf:
                                              - type: number
                                              - type: string
                                          - type: 'null'
                                      periodRates:
                                        anyOf:
                                          - type: object
                                            properties:
                                              enabled:
                                                type: boolean
                                              periods:
                                                type: array
                                                items:
                                                  type: object
                                                  properties:
                                                    periodNumber:
                                                      type: number
                                                    startOccurrence:
                                                      type: number
                                                      description: First occurrence this rate applies to
                                                    endOccurrence:
                                                      anyOf:
                                                        - type: number
                                                        - type: 'null'
                                                      description: Last occurrence (null = unlimited)
                                                    option:
                                                      type: string
                                                      enum:
                                                        - fixed
                                                        - percentage
                                                        - scaling
                                                    value:
                                                      type: number
                                                    scalingConfig:
                                                      type: object
                                                      properties:
                                                        customFieldId:
                                                          type: number
                                                          description: >-
                                                            Custom field whose value determines the
                                                            tier
                                                        tiers:
                                                          type: array
                                                          items:
                                                            type: object
                                                            properties:
                                                              optionId:
                                                                type: number
                                                                description: Custom field option ID
                                                              option:
                                                                type: string
                                                                enum:
                                                                  - fixed
                                                                  - percentage
                                                                description: Calculation method
                                                              value:
                                                                type: number
                                                                description: Amount or percentage
                                                            required:
                                                              - optionId
                                                              - option
                                                              - value
                                                            additionalProperties: false
                                                      required:
                                                        - customFieldId
                                                        - tiers
                                                      additionalProperties: false
                                                      description: >-
                                                        Scaling — commission varies based on a
                                                        custom field option.
                                                  required:
                                                    - periodNumber
                                                    - startOccurrence
                                                    - endOccurrence
                                                    - option
                                                    - value
                                                  additionalProperties: false
                                            required:
                                              - enabled
                                              - periods
                                            additionalProperties: false
                                            description: >-
                                              Variable rates per period range in
                                              recurring commissions.
                                          - type: 'null'
                                    additionalProperties: false
                                    description: Recurring payment component
                                required:
                                  - oneOff
                                  - recurring
                                additionalProperties: false
                            additionalProperties: false
                          override:
                            anyOf:
                              - type: object
                                properties:
                                  amount:
                                    type: number
                                    minimum: 0
                                    description: >-
                                      Manual commission amount in whole currency
                                      units (e.g. 1500 = 1500.00). Used as-is
                                      for the payment instead of the
                                      calculation.
                                  currency_code:
                                    type: string
                                    minLength: 3
                                    maxLength: 3
                                    description: >-
                                      ISO 4217 currency code for this override
                                      payment (e.g. USD).
                                  note:
                                    description: >-
                                      Optional note (markdown) explaining the
                                      override. Converted to rich text.
                                    anyOf:
                                      - type: string
                                        maxLength: 50000
                                      - type: 'null'
                                  document_url:
                                    description: >-
                                      Optional public URL of a document to
                                      attach (pdf, csv, excel). Fetched and
                                      stored in Journeybee's CDN.
                                    anyOf:
                                      - type: string
                                        maxLength: 2000
                                        format: uri
                                      - type: 'null'
                                  document_asset_uuid:
                                    description: >-
                                      Optional UUID of an already-uploaded asset
                                      to attach instead of document_url.
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                required:
                                  - amount
                                  - currency_code
                                additionalProperties: false
                                description: >-
                                  Manual override that replaces the calculated
                                  commission for this entry with a fixed amount.
                              - type: 'null'
                        required:
                          - payment_stage_id
                          - calculation
                        additionalProperties: false
                        description: >-
                          A deal payment trigger. Provide `override` to set a
                          fixed manual commission instead of using the
                          calculation.
                      description: Payment triggers
                  required:
                    - entries
                  additionalProperties: false
                  description: >-
                    Deal commission calculation. Entries may carry a manual
                    `override`.
              required:
                - calculation
              additionalProperties: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  calculation:
                    anyOf:
                      - type: object
                        properties:
                          entries:
                            type: array
                            items:
                              type: object
                              properties:
                                payment_stage_id:
                                  anyOf:
                                    - type: number
                                    - type: 'null'
                                  description: >-
                                    Deal stage ID that triggers payment. Null =
                                    manual trigger.
                                calculation:
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - oneOff
                                        - recurring
                                        - split
                                    option:
                                      description: >-
                                        fixed: flat amount. percentage: % of
                                        deal value. scaling: varies by custom
                                        field.
                                      anyOf:
                                        - type: string
                                          enum:
                                            - fixed
                                            - percentage
                                            - scaling
                                        - type: 'null'
                                    value:
                                      description: Amount (fixed) or percentage
                                      anyOf:
                                        - anyOf:
                                            - type: string
                                            - type: number
                                        - type: 'null'
                                    scalingConfig:
                                      anyOf:
                                        - type: object
                                          properties:
                                            customFieldId:
                                              type: number
                                              description: >-
                                                Custom field whose value determines the
                                                tier
                                            tiers:
                                              type: array
                                              items:
                                                type: object
                                                properties:
                                                  optionId:
                                                    type: number
                                                    description: Custom field option ID
                                                  option:
                                                    type: string
                                                    enum:
                                                      - fixed
                                                      - percentage
                                                    description: Calculation method
                                                  value:
                                                    type: number
                                                    description: Amount or percentage
                                                required:
                                                  - optionId
                                                  - option
                                                  - value
                                                additionalProperties: false
                                          required:
                                            - customFieldId
                                            - tiers
                                          additionalProperties: false
                                          description: >-
                                            Scaling — commission varies based on a
                                            custom field option.
                                        - type: 'null'
                                    recurring_period:
                                      description: Payment frequency
                                      anyOf:
                                        - type: string
                                          enum:
                                            - weekly
                                            - monthly
                                            - quarterly
                                            - yearly
                                        - type: 'null'
                                    number_of_occurrences:
                                      description: Total recurring payments
                                      anyOf:
                                        - anyOf:
                                            - type: number
                                            - type: string
                                        - type: 'null'
                                    periodRates:
                                      anyOf:
                                        - type: object
                                          properties:
                                            enabled:
                                              type: boolean
                                            periods:
                                              type: array
                                              items:
                                                type: object
                                                properties:
                                                  periodNumber:
                                                    type: number
                                                  startOccurrence:
                                                    type: number
                                                    description: First occurrence this rate applies to
                                                  endOccurrence:
                                                    anyOf:
                                                      - type: number
                                                      - type: 'null'
                                                    description: Last occurrence (null = unlimited)
                                                  option:
                                                    type: string
                                                    enum:
                                                      - fixed
                                                      - percentage
                                                      - scaling
                                                  value:
                                                    type: number
                                                  scalingConfig:
                                                    type: object
                                                    properties:
                                                      customFieldId:
                                                        type: number
                                                        description: >-
                                                          Custom field whose value determines the
                                                          tier
                                                      tiers:
                                                        type: array
                                                        items:
                                                          type: object
                                                          properties:
                                                            optionId:
                                                              type: number
                                                              description: Custom field option ID
                                                            option:
                                                              type: string
                                                              enum:
                                                                - fixed
                                                                - percentage
                                                              description: Calculation method
                                                            value:
                                                              type: number
                                                              description: Amount or percentage
                                                          required:
                                                            - optionId
                                                            - option
                                                            - value
                                                          additionalProperties: false
                                                    required:
                                                      - customFieldId
                                                      - tiers
                                                    additionalProperties: false
                                                    description: >-
                                                      Scaling — commission varies based on a
                                                      custom field option.
                                                required:
                                                  - periodNumber
                                                  - startOccurrence
                                                  - endOccurrence
                                                  - option
                                                  - value
                                                additionalProperties: false
                                          required:
                                            - enabled
                                            - periods
                                          additionalProperties: false
                                          description: >-
                                            Variable rates per period range in
                                            recurring commissions.
                                        - type: 'null'
                                    split:
                                      description: >-
                                        Split: combines one-time + recurring
                                        payments.
                                      type: object
                                      properties:
                                        oneOff:
                                          type: object
                                          properties:
                                            type:
                                              description: >-
                                                oneOff: single payment when stage
                                                reached. recurring: periodic payments.
                                              anyOf:
                                                - type: string
                                                  enum:
                                                    - oneOff
                                                    - recurring
                                                - type: 'null'
                                            option:
                                              description: >-
                                                fixed: flat amount. percentage: % of
                                                deal value. scaling: varies by custom
                                                field.
                                              anyOf:
                                                - type: string
                                                  enum:
                                                    - fixed
                                                    - percentage
                                                    - scaling
                                                - type: 'null'
                                            value:
                                              description: Amount (fixed) or percentage
                                              anyOf:
                                                - anyOf:
                                                    - type: string
                                                    - type: number
                                                - type: 'null'
                                            scalingConfig:
                                              anyOf:
                                                - type: object
                                                  properties:
                                                    customFieldId:
                                                      type: number
                                                      description: >-
                                                        Custom field whose value determines the
                                                        tier
                                                    tiers:
                                                      type: array
                                                      items:
                                                        type: object
                                                        properties:
                                                          optionId:
                                                            type: number
                                                            description: Custom field option ID
                                                          option:
                                                            type: string
                                                            enum:
                                                              - fixed
                                                              - percentage
                                                            description: Calculation method
                                                          value:
                                                            type: number
                                                            description: Amount or percentage
                                                        required:
                                                          - optionId
                                                          - option
                                                          - value
                                                        additionalProperties: false
                                                  required:
                                                    - customFieldId
                                                    - tiers
                                                  additionalProperties: false
                                                  description: >-
                                                    Scaling — commission varies based on a
                                                    custom field option.
                                                - type: 'null'
                                            recurring_period:
                                              description: Payment frequency
                                              anyOf:
                                                - type: string
                                                  enum:
                                                    - weekly
                                                    - monthly
                                                    - quarterly
                                                    - yearly
                                                - type: 'null'
                                            number_of_occurrences:
                                              description: Total recurring payments
                                              anyOf:
                                                - anyOf:
                                                    - type: number
                                                    - type: string
                                                - type: 'null'
                                            periodRates:
                                              anyOf:
                                                - type: object
                                                  properties:
                                                    enabled:
                                                      type: boolean
                                                    periods:
                                                      type: array
                                                      items:
                                                        type: object
                                                        properties:
                                                          periodNumber:
                                                            type: number
                                                          startOccurrence:
                                                            type: number
                                                            description: First occurrence this rate applies to
                                                          endOccurrence:
                                                            anyOf:
                                                              - type: number
                                                              - type: 'null'
                                                            description: Last occurrence (null = unlimited)
                                                          option:
                                                            type: string
                                                            enum:
                                                              - fixed
                                                              - percentage
                                                              - scaling
                                                          value:
                                                            type: number
                                                          scalingConfig:
                                                            type: object
                                                            properties:
                                                              customFieldId:
                                                                type: number
                                                                description: >-
                                                                  Custom field whose value determines the
                                                                  tier
                                                              tiers:
                                                                type: array
                                                                items:
                                                                  type: object
                                                                  properties:
                                                                    optionId:
                                                                      type: number
                                                                      description: Custom field option ID
                                                                    option:
                                                                      type: string
                                                                      enum:
                                                                        - {}
                                                                        - {}
                                                                      description: Calculation method
                                                                    value:
                                                                      type: number
                                                                      description: Amount or percentage
                                                                  required:
                                                                    - optionId
                                                                    - option
                                                                    - value
                                                                  additionalProperties: false
                                                            required:
                                                              - customFieldId
                                                              - tiers
                                                            additionalProperties: false
                                                            description: >-
                                                              Scaling — commission varies based on a
                                                              custom field option.
                                                        required:
                                                          - periodNumber
                                                          - startOccurrence
                                                          - endOccurrence
                                                          - option
                                                          - value
                                                        additionalProperties: false
                                                  required:
                                                    - enabled
                                                    - periods
                                                  additionalProperties: false
                                                  description: >-
                                                    Variable rates per period range in
                                                    recurring commissions.
                                                - type: 'null'
                                          additionalProperties: false
                                          description: One-time payment component
                                        recurring:
                                          type: object
                                          properties:
                                            type:
                                              description: >-
                                                oneOff: single payment when stage
                                                reached. recurring: periodic payments.
                                              anyOf:
                                                - type: string
                                                  enum:
                                                    - oneOff
                                                    - recurring
                                                - type: 'null'
                                            option:
                                              description: >-
                                                fixed: flat amount. percentage: % of
                                                deal value. scaling: varies by custom
                                                field.
                                              anyOf:
                                                - type: string
                                                  enum:
                                                    - fixed
                                                    - percentage
                                                    - scaling
                                                - type: 'null'
                                            value:
                                              description: Amount (fixed) or percentage
                                              anyOf:
                                                - anyOf:
                                                    - type: string
                                                    - type: number
                                                - type: 'null'
                                            scalingConfig:
                                              anyOf:
                                                - type: object
                                                  properties:
                                                    customFieldId:
                                                      type: number
                                                      description: >-
                                                        Custom field whose value determines the
                                                        tier
                                                    tiers:
                                                      type: array
                                                      items:
                                                        type: object
                                                        properties:
                                                          optionId:
                                                            type: number
                                                            description: Custom field option ID
                                                          option:
                                                            type: string
                                                            enum:
                                                              - fixed
                                                              - percentage
                                                            description: Calculation method
                                                          value:
                                                            type: number
                                                            description: Amount or percentage
                                                        required:
                                                          - optionId
                                                          - option
                                                          - value
                                                        additionalProperties: false
                                                  required:
                                                    - customFieldId
                                                    - tiers
                                                  additionalProperties: false
                                                  description: >-
                                                    Scaling — commission varies based on a
                                                    custom field option.
                                                - type: 'null'
                                            recurring_period:
                                              description: Payment frequency
                                              anyOf:
                                                - type: string
                                                  enum:
                                                    - weekly
                                                    - monthly
                                                    - quarterly
                                                    - yearly
                                                - type: 'null'
                                            number_of_occurrences:
                                              description: Total recurring payments
                                              anyOf:
                                                - anyOf:
                                                    - type: number
                                                    - type: string
                                                - type: 'null'
                                            periodRates:
                                              anyOf:
                                                - type: object
                                                  properties:
                                                    enabled:
                                                      type: boolean
                                                    periods:
                                                      type: array
                                                      items:
                                                        type: object
                                                        properties:
                                                          periodNumber:
                                                            type: number
                                                          startOccurrence:
                                                            type: number
                                                            description: First occurrence this rate applies to
                                                          endOccurrence:
                                                            anyOf:
                                                              - type: number
                                                              - type: 'null'
                                                            description: Last occurrence (null = unlimited)
                                                          option:
                                                            type: string
                                                            enum:
                                                              - fixed
                                                              - percentage
                                                              - scaling
                                                          value:
                                                            type: number
                                                          scalingConfig:
                                                            type: object
                                                            properties:
                                                              customFieldId:
                                                                type: number
                                                                description: >-
                                                                  Custom field whose value determines the
                                                                  tier
                                                              tiers:
                                                                type: array
                                                                items:
                                                                  type: object
                                                                  properties:
                                                                    optionId:
                                                                      type: number
                                                                      description: Custom field option ID
                                                                    option:
                                                                      type: string
                                                                      enum:
                                                                        - {}
                                                                        - {}
                                                                      description: Calculation method
                                                                    value:
                                                                      type: number
                                                                      description: Amount or percentage
                                                                  required:
                                                                    - optionId
                                                                    - option
                                                                    - value
                                                                  additionalProperties: false
                                                            required:
                                                              - customFieldId
                                                              - tiers
                                                            additionalProperties: false
                                                            description: >-
                                                              Scaling — commission varies based on a
                                                              custom field option.
                                                        required:
                                                          - periodNumber
                                                          - startOccurrence
                                                          - endOccurrence
                                                          - option
                                                          - value
                                                        additionalProperties: false
                                                  required:
                                                    - enabled
                                                    - periods
                                                  additionalProperties: false
                                                  description: >-
                                                    Variable rates per period range in
                                                    recurring commissions.
                                                - type: 'null'
                                          additionalProperties: false
                                          description: Recurring payment component
                                      required:
                                        - oneOff
                                        - recurring
                                      additionalProperties: false
                                  additionalProperties: false
                                override:
                                  anyOf:
                                    - type: object
                                      properties:
                                        amount:
                                          type: number
                                          description: Override amount in whole currency units
                                        currency:
                                          type: object
                                          properties:
                                            uuid:
                                              anyOf:
                                                - type: string
                                                - type: 'null'
                                            code:
                                              type: string
                                          required:
                                            - uuid
                                            - code
                                          additionalProperties: false
                                        note:
                                          anyOf:
                                            - type: string
                                            - type: 'null'
                                          description: Override note rendered as markdown
                                        document:
                                          anyOf:
                                            - type: object
                                              properties:
                                                uuid:
                                                  type: string
                                                file_url:
                                                  anyOf:
                                                    - type: string
                                                    - type: 'null'
                                                file_name:
                                                  anyOf:
                                                    - type: string
                                                    - type: 'null'
                                                mime_type:
                                                  anyOf:
                                                    - type: string
                                                    - type: 'null'
                                              required:
                                                - uuid
                                                - file_url
                                                - file_name
                                                - mime_type
                                              additionalProperties: false
                                            - type: 'null'
                                      required:
                                        - amount
                                        - currency
                                        - note
                                        - document
                                      additionalProperties: false
                                    - type: 'null'
                              required:
                                - payment_stage_id
                                - calculation
                              additionalProperties: false
                        required:
                          - entries
                        additionalProperties: false
                      - type: 'null'
                required:
                  - calculation
                additionalProperties: false
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: API key authentication. Use "Bearer <api_key>" or "Api-Key <api_key>".

````