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

# Payout

> Finance processes the payout (PENDING_FINANCE → PAID | REJECTED).



## OpenAPI

````yaml /openapi/payment.yaml post /api/v1/commissions/{application_id}/payout
openapi: 3.1.0
info:
  title: Cape Media - Payment Service
  description: >-
    Invoice requests, invoice uploads, payment tracking, and commission
    management.
  version: 1.0.0
servers:
  - url: https://api.capedigital.co.ke/payment
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /api/v1/commissions/{application_id}/payout:
    post:
      tags:
        - Commissions
      summary: Payout
      description: Finance processes the payout (PENDING_FINANCE → PAID | REJECTED).
      operationId: payout_api_v1_commissions__application_id__payout_post
      parameters:
        - name: application_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Application Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutAction'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    PayoutAction:
      properties:
        decision:
          type: string
          enum:
            - APPROVED
            - REJECTED
          title: Decision
          description: Outcome of this step.
        remarks:
          type: string
          title: Remarks
          description: Mandatory explanation — visible to the applicant.
        payment_method:
          anyOf:
            - $ref: '#/components/schemas/CommissionPaymentMethod'
            - type: 'null'
          description: Required when approving. Payout channel.
        payment_reference:
          anyOf:
            - type: string
            - type: 'null'
          title: Payment Reference
          description: Required when approving. Bank/M-PESA transaction reference.
        approved_amount:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: Approved Amount
          description: >-
            Required when approving. Final payout in KES — may differ from
            computed commission.
      type: object
      required:
        - decision
        - remarks
      title: PayoutAction
      description: >-
        Finance payout step — extends ApprovalAction with payment details
        required on approval.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CommissionPaymentMethod:
      type: string
      enum:
        - RTGS
        - EFT
        - MPESA_BUSINESS
        - INTERNAL_LEDGER
      title: CommissionPaymentMethod
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````