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

# Create a commission

> Supports historical created_at values. Status defaults to approved when omitted.



## OpenAPI

````yaml /api-reference/openapi.json post /v2/commissions
openapi: 3.1.0
info:
  title: Tolt Public API
  version: 2.0.0
servers:
  - url: https://platform.tolt.dev
    description: Development
security:
  - bearerAuth: []
paths:
  /v2/commissions:
    post:
      tags:
        - Commissions
      summary: Create a commission
      description: >-
        Supports historical created_at values. Status defaults to approved when
        omitted.
      operationId: createCommission
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                created_at:
                  type: string
                  format: date-time
                  description: >-
                    When the commission was earned, as a timestamp with a time
                    zone, for example 2026-03-01T12:00:00Z. Reports and filters
                    by creation date place the commission on this date; the
                    upcoming approvals forecast goes by its scheduled approval
                    date, which this does not change. Defaults to now.
                amount:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                  description: >-
                    What the partner earns for this commission, in minor units
                    of the program currency (cents for USD).
                customer_id:
                  type: string
                  minLength: 1
                  description: >-
                    Id of the customer the commission is for (cus_...), as
                    returned when listing customers. The commission goes to the
                    customer's partner and program; partner_id and program_id
                    can be left out, and when given they must match the
                    customer's.
                partner_id:
                  type: string
                  minLength: 1
                  description: >-
                    Id of the partner who earns the commission (part_...), as
                    returned when listing partners. Used with program_id when no
                    customer_id is given.
                program_id:
                  type: string
                  minLength: 1
                  description: >-
                    Id of the partner's program (prg_...). Required with
                    partner_id when no customer_id is given.
                revenue:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                  description: >-
                    The sale amount the commission is based on, in minor units
                    of the program currency.
                status:
                  type: string
                  enum:
                    - pending
                    - approved
                    - rejected
                source:
                  type: string
                  maxLength: 255
                  description: >-
                    Free-form label for where the commission came from, such as
                    stripe or api.
                charge_id:
                  type: string
                  maxLength: 255
                  description: >-
                    Id of the payment in your billing system that the commission
                    is for, such as a Stripe charge id.
                transaction_id:
                  type: string
                  description: >-
                    Id of the transaction the commission is for (txn_...). It
                    must belong to the commission's customer, or to its partner
                    and program, and must not be refunded.
              required:
                - amount
              example:
                customer_id: cus_LBfjvtfct9pVUeLojMHiGnXv
                transaction_id: txn_fB3egT1sKNVNu3ZYuU1ypYDA
                amount: 1000
                revenue: 5000
                status: approved
                source: api
              description: >-
                Send customer_id, or partner_id and program_id together when the
                commission has no customer. A request with neither returns 400.
      responses:
        '201':
          description: The created commission
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Request successful
                  data:
                    $ref: '#/components/schemas/Commission'
                required:
                  - success
                  - message
                  - data
              example:
                success: true
                message: Successfully created commission
                data:
                  id: comm_X85RLnefjTCNrypH4MA1PdSp
                  amount: '1000'
                  currency: null
                  revenue: '5000'
                  status: approved
                  type: null
                  source: api
                  partner_id: part_NLYzgNKuSuASvrvoxNtau6SY
                  customer_id: cus_LBfjvtfct9pVUeLojMHiGnXv
                  program_id: prg_T6z8aRW3XCmvFWP972RKxpAd
                  transaction_id: txn_fB3egT1sKNVNu3ZYuU1ypYDA
                  payout_id: null
                  charge_id: null
                  charge_status: null
                  is_ad_click: false
                  is_self_referral: false
                  approval_type: manual
                  scheduled_approval_date: null
                  created_at: '2026-10-01T12:00:00Z'
                  updated_at: '2026-10-01T12:00:00Z'
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                message: 'request: Invalid input: expected object, received null'
                code: validation_error
                doc_url: https://docs.tolt.com/errors#validation_error
                errors:
                  - field: request
                    message: 'Invalid input: expected object, received null'
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                message: Unauthorized
                code: unauthorized
                doc_url: https://docs.tolt.com/errors#unauthorized
        '409':
          description: Transaction is refunded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                message: Transaction is refunded
                code: transaction_refunded
                doc_url: https://docs.tolt.com/errors#transaction_refunded
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Commission:
      type: object
      properties:
        id:
          type: string
          example: comm_X85RLnefjTCNrypH4MA1PdSp
        amount:
          type:
            - string
            - 'null'
          description: >-
            Integer amount in the smallest currency unit (cents), serialized as
            a string.
          example: '1000'
        currency:
          type:
            - string
            - 'null'
          example: usd
        revenue:
          type:
            - string
            - 'null'
          description: >-
            Integer amount in the smallest currency unit (cents), serialized as
            a string.
          example: '5000'
        status:
          type:
            - string
            - 'null'
          example: approved
        type:
          type:
            - string
            - 'null'
          example: percentage
        source:
          type:
            - string
            - 'null'
          example: api
        partner_id:
          type:
            - string
            - 'null'
          example: part_NLYzgNKuSuASvrvoxNtau6SY
        customer_id:
          type:
            - string
            - 'null'
          example: cus_LBfjvtfct9pVUeLojMHiGnXv
        program_id:
          type:
            - string
            - 'null'
          example: prg_T6z8aRW3XCmvFWP972RKxpAd
        transaction_id:
          type:
            - string
            - 'null'
          example: txn_fB3egT1sKNVNu3ZYuU1ypYDA
        payout_id:
          type:
            - string
            - 'null'
          example: null
        charge_id:
          type:
            - string
            - 'null'
          example: ch_R8qW2mN6kP4vT9xY
        charge_status:
          type:
            - string
            - 'null'
          example: paid
        is_ad_click:
          type:
            - boolean
            - 'null'
          example: false
        is_self_referral:
          type:
            - boolean
            - 'null'
          example: false
        approval_type:
          type:
            - string
            - 'null'
          example: immediate
        scheduled_approval_date:
          anyOf:
            - type: string
              format: date-time
              example: '2026-10-01T12:00:00Z'
            - type: 'null'
          example: null
        created_at:
          type: string
          format: date-time
          example: '2026-10-01T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-10-01T12:00:00Z'
      required:
        - id
        - amount
        - currency
        - revenue
        - status
        - type
        - source
        - partner_id
        - customer_id
        - program_id
        - transaction_id
        - payout_id
        - charge_id
        - charge_status
        - is_ad_click
        - is_self_referral
        - approval_type
        - scheduled_approval_date
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: Human-readable explanation. May change; branch on code instead.
        code:
          type: string
          enum:
            - bad_request
            - validation_error
            - invalid_reference
            - invalid_cursor
            - unauthorized
            - forbidden
            - not_found
            - conflict
            - already_exists
            - commission_paid
            - commission_frozen
            - transaction_refunded
            - commission_exists
            - rate_limited
            - payload_too_large
            - internal_error
          description: Stable machine-readable error code.
          example: not_found
        doc_url:
          type: string
          example: https://docs.tolt.com/errors#not_found
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
            required:
              - field
              - message
          description: >-
            One entry per offending field. Present on validation_error and
            invalid_reference.
      required:
        - success
        - message
        - code
        - doc_url
  headers:
    X-RateLimit-Limit:
      description: Requests allowed in the current window.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix time, in seconds, when the window resets.
      schema:
        type: integer
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  responses:
    PayloadTooLarge:
      description: Request body exceeds 1 MB
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Request body exceeds 1 MB
            code: payload_too_large
            doc_url: https://docs.tolt.com/errors#payload_too_large
    RateLimited:
      description: The API key exceeded its rate limit
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Too many requests. Retry after the window resets.
            code: rate_limited
            doc_url: https://docs.tolt.com/errors#rate_limited
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Tolt API key sent as a bearer token.

````

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