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

# Create Product Type

> Create a new ProductType.

The key must be lowercase with underscores only.
All referenced properties must exist as PropertyDefinitions.

**Authentication Required**: Requires `product_type:write` permission.



## OpenAPI

````yaml /openapi/merchantops-public.json post /api/product-types/
openapi: 3.1.0
info:
  description: >-
    Public API for the MerchantOps product catalog, pricing, and publishing
    surface.
  title: MerchantOps API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.merchantops.ai
security: []
paths:
  /api/product-types/:
    post:
      tags:
        - Product Types
      summary: Create Product Type
      description: |-
        Create a new ProductType.

        The key must be lowercase with underscores only.
        All referenced properties must exist as PropertyDefinitions.

        **Authentication Required**: Requires `product_type:write` permission.
      operationId: create_product_type
      parameters:
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: X-Organization-ID
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Organization-Id
        - in: cookie
          name: stytch_session
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Stytch Session
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductTypeCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductTypeResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    ProductTypeCreateRequest:
      description: Request model for creating a ProductType.
      properties:
        category_key:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Key into product_type_categories (e.g. 'apparel'). Drives 3-tier
            prompt resolution.
          title: Category Key
        description:
          anyOf:
            - items:
                additionalProperties:
                  type: string
                type: object
              type: array
            - type: 'null'
          description: Localized descriptions
          title: Description
        isActive:
          default: true
          description: Active status
          title: Isactive
          type: boolean
        key:
          description: Unique identifier (lowercase with underscores)
          title: Key
          type: string
        name:
          description: Human-readable name
          title: Name
          type: string
        properties:
          description: Property references
          items:
            $ref: '#/components/schemas/PropertyReferenceDict'
          title: Properties
          type: array
      required:
        - key
        - name
      title: ProductTypeCreateRequest
      type: object
    ProductTypeResponse:
      description: Response model for a single ProductType.
      properties:
        category_key:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Key into product_type_categories — links this ProductType to a
            Category for 3-tier prompt resolution.
          title: Category Key
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          description: Creation timestamp
          title: Createdat
        createdBy:
          anyOf:
            - type: string
            - type: 'null'
          description: User who created this
          title: Createdby
        description:
          anyOf:
            - items:
                additionalProperties:
                  type: string
                type: object
              type: array
            - type: 'null'
          description: Localized descriptions
          title: Description
        id:
          description: MongoDB ObjectId as string
          title: Id
          type: string
        isActive:
          default: true
          description: Active status
          title: Isactive
          type: boolean
        is_system:
          default: false
          description: System-managed ProductType
          title: Is System
          type: boolean
        key:
          description: Unique identifier
          title: Key
          type: string
        lastModifiedAt:
          anyOf:
            - type: string
            - type: 'null'
          description: Last modification timestamp
          title: Lastmodifiedat
        lastModifiedBy:
          anyOf:
            - type: string
            - type: 'null'
          description: User who last modified this
          title: Lastmodifiedby
        name:
          description: Human-readable name
          title: Name
          type: string
        propertyCount:
          default: 0
          description: Number of properties
          title: Propertycount
          type: integer
        propertyKeys:
          description: List of property keys
          items:
            type: string
          title: Propertykeys
          type: array
      required:
        - id
        - key
        - name
      title: ProductTypeResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    PropertyReferenceDict:
      description: Request/response model for a PropertyReference.
      properties:
        ai_matching_guidance_override:
          anyOf:
            - type: string
            - type: 'null'
          description: Override AI matching guidance
          title: Ai Matching Guidance Override
        display_group:
          anyOf:
            - type: string
            - type: 'null'
          description: Override display group
          title: Display Group
        display_order:
          anyOf:
            - type: integer
            - type: 'null'
          description: Override display order
          title: Display Order
        enrichment_config_override:
          anyOf:
            - $ref: '#/components/schemas/EnrichmentConfigDict'
            - type: 'null'
          description: Override enrichment config
        is_hidden:
          default: false
          description: Hide inherited base template property
          title: Is Hidden
          type: boolean
        key:
          description: PropertyDefinition key
          title: Key
          type: string
        prompt_name_override:
          anyOf:
            - type: string
            - type: 'null'
          description: Override Langfuse prompt name
          title: Prompt Name Override
      required:
        - key
      title: PropertyReferenceDict
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    EnrichmentConfigDict:
      description: Request/response model for an enrichment config.
      properties:
        extraction_hint:
          anyOf:
            - type: string
            - type: 'null'
          title: Extraction Hint
        generation_context_fields:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Generation Context Fields
        generation_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Generation Prompt
        llm_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Model
        max_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Length
        overwrite_merchant_input:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Overwrite Merchant Input
        source_priority:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Source Priority
        strategies:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Strategies
      title: EnrichmentConfigDict
      type: object

````