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

# Create commission adjustments

> Requires `commission-adjustments:write`. See [Commission adjustments behavior](/developer-documentation/api/finance) and [common API rules](/developer-documentation/api/overview).

Requires `commission-adjustments:write`. See the [commission adjustments guide](https://www.referly.so/docs/developer-documentation/api/finance.md) for behavior and examples.


## OpenAPI

````yaml POST /commission-adjustments
openapi: 3.0.3
info:
  title: Referly API
  description: >-
    REST API for affiliates, referrals, sales, links, coupons, programs, groups,
    commission plans, commissions, adjustments, balances, payouts, analytics and
    webhooks. Send Authorization: Bearer <YOUR_API_KEY>. Keys have resource
    permissions and optional expiry. Requests default to the key’s original
    program; operational endpoints also support X-Program-Id for a program
    created by that exact key. See the authentication and operational API guides
    for scope, pagination, errors and retry behavior.
  version: 1.0.0
servers:
  - url: https://www.referly.so/api/v1
security:
  - bearerAuth: []
paths:
  /commission-adjustments:
    post:
      tags:
        - commission-adjustments
      summary: Create commission adjustments
      description: >-
        Requires `commission-adjustments:write`. See [Commission adjustments
        behavior](/developer-documentation/api/finance) and [common API
        rules](/developer-documentation/api/overview).
      operationId: post_commission_adjustments
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 8
            maxLength: 200
            pattern: ^[\x21-\x7e]+$
          description: >-
            Optional retry key, unique within the selected program. Reuse the
            same key, method, path and validated payload; a conflicting reuse
            returns 409.
        - name: X-Program-Id
          in: header
          required: false
          description: >-
            Select the key's original program or a program provisioned by this
            exact key. Other owned programs remain inaccessible.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OperationalAdjustment'
      responses:
        '201':
          description: >-
            Success. Monetary amounts use program currency; see companion
            documentation for resource fields.
          content:
            application/json:
              schema:
                $ref: dd697a55-4b16-4168-80c5-96a4305db77d
              example:
                id: adj_3e21a7c9
                programId: prog_acme_partners
                affiliateId: aff_9f2c1e42
                originalCommissionId: 4821
                commissionId: 4903
                amount: '-12.5'
                currency: USD
                reason: Partial commission reversal
                sourceReference: refund-4821
                createdAt: '2026-09-20T09:15:00.000Z'
        '400':
          description: Malformed JSON
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: invalid_json
                  message: Invalid JSON body
                  requestId: 5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21
        '401':
          description: Invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: unauthorized
                  message: Invalid, expired or revoked API key
                  requestId: 5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21
        '403':
          description: Scope or entitlement denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: insufficient_scope
                  message: Requires commission-adjustments:write
                  requestId: 5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21
        '404':
          description: Not found within this program
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not_found
                  message: Affiliate or original commission not found in this program
                  requestId: 5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21
        '409':
          description: State or idempotency conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: source_reference_conflict
                  message: This sourceReference was used for a different adjustment
                  requestId: 5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21
        '413':
          description: Body too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: body_too_large
                  message: Request body must be at most 64 KiB
                  requestId: 5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21
        '422':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: currency_mismatch
                  message: Amount must be in the program currency
                  requestId: 5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21
        '429':
          description: Rate limit exceeded; observe Retry-After
          content:
            application/json:
              schema:
                $ref: f48d42e5-fe37-407f-b348-be8b1adae0be
              example:
                error: Too many requests. Please slow down.
                retryAfter: 42
        '500':
          description: Internal failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: internal_error
                  message: Request failed
                  requestId: 5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21
        '502':
          description: Webhook provider failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: webhook_provider_error
                  message: The webhook provider request failed
                  requestId: 5c1f7a2e-2b39-4c2d-9c31-7a6e0f6a9b21
components:
  schemas:
    OperationalAdjustment:
      type: object
      properties:
        affiliateId:
          type: string
        originalCommissionId:
          type: integer
          minimum: 1
        amount:
          type: number
          minimum: -1000000000
          maximum: 1000000000
          description: >-
            Nonzero signed amount in major units, at most 6 decimals. Negative
            requires originalCommissionId.
        currency:
          type: string
          pattern: ^[A-Z]{3}$
        reason:
          type: string
          minLength: 1
          maxLength: 2000
        sourceReference:
          type: string
          minLength: 1
          maxLength: 200
      required:
        - affiliateId
        - amount
        - currency
        - reason
        - sourceReference
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human readable description of what went wrong
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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