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

# Detach a commission line

> Detaches a commission line from its payout and returns it to the pending pool so it can be picked up by a future payout batch. Returns 422 when the line is not attached to a payout.



## OpenAPI

````yaml /openapi.json post /api/v1/commission-lines/{id}/detach
openapi: 3.1.0
info:
  title: Introw API
  version: '2026-05-20'
  description: >-
    Customer-facing API for Introw. Manage partners, delegate commission payout
    operations to your finance software, embed the partner portal in your
    product with pre-authenticated sessions, and ingest affiliate conversions.
servers:
  - url: https://api.introw.io
  - url: https://api.staging.introw.io
security:
  - ApiKeyAuth: []
tags:
  - name: Partners
    description: >-
      Read and manage partners for the organisation associated with the
      authenticated API key.
  - name: Payouts
    description: >-
      Read and update commission payouts. Delegate approval, scheduling, and
      payment status to your ERP or accounts-payable stack.
  - name: Commission lines
    description: >-
      Create, read, update, decline, and detach commission line items. Lines can
      live in the pending pool or be attached to a payout.
  - name: Auth
    description: >-
      Create pre-authenticated partner portal sessions. Exchange a visitor email
      for a short-lived, single-use portal URL that you embed in an iframe
      inside your own product — one login, fully branded, no login screen for
      the partner.
  - name: Affiliate
    description: >-
      Ingest affiliate conversions from your backend or directly from the
      browser via affiliate.js. Every conversion is anchored to a signed,
      server-side click token (the first-party `_introw_aff` cookie),
      deduplicated, and mapped onto a campaign form submission — so attribution
      cannot be forged or double-counted.
paths:
  /api/v1/commission-lines/{id}/detach:
    post:
      tags:
        - Commission lines
      summary: Detach a commission line
      description: >-
        Detaches a commission line from its payout and returns it to the pending
        pool so it can be picked up by a future payout batch. Returns 422 when
        the line is not attached to a payout.
      operationId: detachCommissionLine
      parameters:
        - name: id
          in: path
          required: true
          description: Commission line identifier.
          schema:
            description: Commission line identifier.
            type: string
            minLength: 1
      responses:
        '200':
          description: Commission line detached successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommissionLineResponse'
              example:
                data:
                  id: cln_4d5e6f7g8h9i0j1k2l3m4n5o
                  partnerId: ptn_01HVK6Y8Z8Q7J8J8J8J8J8J8J8
                  payoutId: null
                  description: Q1 referral bonus
                  amount: '500.00'
                  sourceAmount: '10000.00'
                  currency: USD
                  status: PENDING
                  planName: Referral plan
                  periodEnd: '2026-03-31T23:59:59.000Z'
                  createdAt: '2026-04-05T09:00:00.000Z'
                  updatedAt: '2026-04-05T09:00:00.000Z'
          headers:
            x-ratelimit-limit-minute:
              description: Maximum number of requests allowed in the current minute.
              schema:
                type: string
            x-ratelimit-remaining-minute:
              description: Number of requests remaining in the current minute.
              schema:
                type: string
        '401':
          description: API key is missing, invalid, expired, or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '403':
          description: API key does not include the commissions:write scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '404':
          description: Commission line was not found in the authenticated organisation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '422':
          description: The line is not attached to a payout.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
components:
  schemas:
    CommissionLineResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              description: Introw commission line identifier.
              type: string
            partnerId:
              description: Introw partner the commission line belongs to.
              type: string
            payoutId:
              description: >-
                Payout the line is attached to, or null when the line is still
                in the pending pool.
              anyOf:
                - type: string
                - type: 'null'
            description:
              description: Free-text description of the commission line.
              anyOf:
                - type: string
                - type: 'null'
            amount:
              description: Commission amount as a decimal string, e.g. "500.00".
              type: string
            sourceAmount:
              description: >-
                Originating deal/source amount the commission was derived from,
                when known.
              anyOf:
                - type: string
                - type: 'null'
            currency:
              description: ISO 4217 currency code, e.g. "USD".
              type: string
              minLength: 3
              maxLength: 3
            status:
              description: Lifecycle status of the commission line.
              type: string
              enum:
                - EXPECTED
                - PENDING
                - IN_PAYOUT
                - VOIDED
            planName:
              description: >-
                Name of the commission plan that produced the line, when
                applicable.
              anyOf:
                - type: string
                - type: 'null'
            periodEnd:
              description: End of the commission period the line covers, when set.
              anyOf:
                - type: string
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                - type: 'null'
            createdAt:
              description: ISO 8601 timestamp for when the line was created.
              type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            updatedAt:
              description: ISO 8601 timestamp for when the line was last updated.
              type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          required:
            - id
            - partnerId
            - payoutId
            - description
            - amount
            - sourceAmount
            - currency
            - status
            - planName
            - periodEnd
            - createdAt
            - updatedAt
          additionalProperties: false
      required:
        - data
      additionalProperties: false
    PublicApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              description: Stable machine-readable error code.
              type: string
            message:
              description: Human-readable error message.
              type: string
            details:
              description: Optional structured details for validation and debugging.
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Introw API key shown once when the credential is created.

````