> ## 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.

# Create partner

> Create a new partner



## OpenAPI

````yaml /openapi/commercial.yaml post /api/v1/partners
openapi: 3.0.3
info:
  title: Commercial Service API
  version: 1.0.0
  description: |2-

        **Commercial Service API** - Lead management and campaign workflow system.

        ## Versioning
        The API uses URL path versioning (e.g., `/api/v1/`, `/api/v2/`).
        Current version: **v1**
        
servers:
  - url: https://api.capedigital.co.ke/commercial
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /api/v1/partners:
    post:
      tags:
        - Partners
      summary: Create partner
      description: Create a new partner
      operationId: partners_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerRequest'
            examples:
              CreatePartner:
                value:
                  name: XYZ Agency
                  partner_type_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  industry_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  services_ids:
                    - 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  contacts:
                    - name: Alice Wambui
                      email: alice@xyz.co.ke
                      phone: '+254711000000'
                      preferred_contact_method: email
                summary: Create partner
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PartnerRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PartnerRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Partner'
              examples:
                PartnerResponse:
                  value:
                    id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                    name: XYZ Agency
                    partner_type:
                      id: uuid
                      name: Agency
                    industry:
                      id: uuid
                      name: Advertising
                    status: active
                    services:
                      - id: uuid
                        name: TV Advertising
                    contacts:
                      - id: uuid
                        name: Alice Wambui
                        email: alice@xyz.co.ke
                        phone: '+254711000000'
                        preferred_contact_method: email
                    created_at: '2024-01-10T08:00:00Z'
                    updated_at: '2024-01-10T08:00:00Z'
                  summary: Partner response
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    PartnerRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Partner company name
          maxLength: 200
        partner_type_id:
          type: string
          format: uuid
          writeOnly: true
        industry_id:
          type: string
          format: uuid
          writeOnly: true
        status:
          type: string
          minLength: 1
          description: Current partner status
          maxLength: 20
        metadata:
          description: Additional flexible metadata
        services_ids:
          type: array
          items:
            type: string
            format: uuid
          writeOnly: true
          minItems: 1
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/PartnerContactRequest'
      required:
        - contacts
        - industry_id
        - name
        - partner_type_id
        - services_ids
    Partner:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Partner company name
          maxLength: 200
        partner_type:
          type: string
          readOnly: true
        industry:
          type: string
          readOnly: true
        status:
          type: string
          description: Current partner status
          maxLength: 20
        metadata:
          description: Additional flexible metadata
        services:
          type: string
          readOnly: true
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/PartnerContact'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - contacts
        - created_at
        - id
        - industry
        - name
        - partner_type
        - services
        - updated_at
    PartnerContactRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Contact name
          maxLength: 100
        email:
          type: string
          format: email
          minLength: 1
          description: Contact email address
          maxLength: 150
        phone:
          type: string
          description: Primary phone number
          maxLength: 30
        preferred_contact_method:
          enum:
            - email
            - phone
          type: string
          x-spec-enum-id: 17f11a3a6a4008ba
          description: |-
            Preferred method of contact

            * `email` - Email
            * `phone` - Phone
      required:
        - email
        - name
        - preferred_contact_method
    PartnerContact:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Contact name
          maxLength: 100
        email:
          type: string
          format: email
          description: Contact email address
          maxLength: 150
        phone:
          type: string
          description: Primary phone number
          maxLength: 30
        preferred_contact_method:
          enum:
            - email
            - phone
          type: string
          x-spec-enum-id: 17f11a3a6a4008ba
          description: |-
            Preferred method of contact

            * `email` - Email
            * `phone` - Phone
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - email
        - id
        - name
        - preferred_contact_method
        - updated_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````