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

# Create or upsert a product

> Create a new product or update an existing one (upsert).

If external_id is provided and already exists for this site,
the product is updated. Otherwise a new product is created.

The sync_hash field enables delta updates: if the hash matches
the existing product's hash, re-embedding is skipped (only
metadata like price/availability is updated).



## OpenAPI

````yaml /api-reference/openapi.json post /api/knowledge/products
openapi: 3.1.0
info:
  title: Big Panda — Public API
  description: >-
    Externe REST-API für Connector-Plugins (JTL, Shopware), n8n-Integrationen
    und Custom-Clients. Tenant-Routing über Subdomain, Auth über Bearer-Token.
  version: 0.1.0
servers:
  - url: https://{tenant}.app.big-panda.ai
    description: Big Panda — Tenant-Subdomain. Ersetze {tenant} durch deinen Tenant-Slug.
    variables:
      tenant:
        default: demo
        description: Dein Big-Panda-Tenant-Slug (z.B. 'acme').
security:
  - BearerAuth: []
tags:
  - name: Products
  - name: Knowledge Entries
  - name: Categories
  - name: Sites
  - name: Search
  - name: OAuth
    description: >-
      OAuth-2.1-Authentifizierung — Discovery, Dynamic Client Registration,
      Authorize, Token, Revoke.
paths:
  /api/knowledge/products:
    post:
      tags:
        - Products
      summary: Create or upsert a product
      description: |-
        Create a new product or update an existing one (upsert).

        If external_id is provided and already exists for this site,
        the product is updated. Otherwise a new product is created.

        The sync_hash field enables delta updates: if the hash matches
        the existing product's hash, re-embedding is skipped (only
        metadata like price/availability is updated).
      operationId: create_product_products_post
      parameters:
        - name: site_id
          in: query
          required: true
          schema:
            type: string
            description: Site to push the product to (UUID or slug)
            title: Site Id
          description: Site to push the product to (UUID or slug)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ProductCreate:
      properties:
        external_id:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: External Id
        title:
          type: string
          minLength: 1
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        short_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Short Description
        sku:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Sku
        gtin:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Gtin
          description: GTIN/EAN barcode
        brand:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Brand
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        attributes:
          additionalProperties: true
          type: object
          title: Attributes
        properties:
          additionalProperties: true
          type: object
          title: Properties
        price_current:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price Current
        price_msrp:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price Msrp
        price_special:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price Special
        price_on_request:
          type: boolean
          title: Price On Request
          default: false
        currency:
          type: string
          maxLength: 3
          title: Currency
          default: EUR
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        additional_images:
          items:
            type: string
          type: array
          title: Additional Images
        product_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Url
        availability:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Availability
        rating_average:
          anyOf:
            - type: number
              maximum: 5
              minimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Rating Average
        rating_count:
          type: integer
          minimum: 0
          title: Rating Count
          default: 0
        language:
          type: string
          maxLength: 5
          minLength: 2
          title: Language
        parent_external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent External Id
          description: external_id of the parent product (for variants)
        is_variant:
          type: boolean
          title: Is Variant
          description: True for concrete variants (children of a parent).
          default: false
        is_parent:
          type: boolean
          title: Is Parent
          description: >-
            True for abstract parent/master products that have variant children.
            Excluded from search when the tenant runs with
            variant_strategy=children_only.
          default: false
        similarity_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Similarity Text
          description: >-
            Anchor text for the centroid_similar.py 'find related' path.
            Connector typically composes this from a small, stable set of
            attributes (e.g. perfume: 'Duft + Saison').
        search_keywords:
          items:
            type: string
          type: array
          title: Search Keywords
          description: >-
            Alternative spellings / synonyms / JTL-Suchbegriffe. Boosts
            BM25-matches without affecting semantic search.
        embedding_text_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Embedding Text Description
          description: >-
            Pre-assembled text for description embedding. If omitted, generated
            from title + description.
        embedding_text_properties:
          anyOf:
            - type: string
            - type: 'null'
          title: Embedding Text Properties
          description: >-
            Pre-assembled text for properties embedding. If omitted, generated
            from title + properties.
        embedding_text_attributes:
          anyOf:
            - type: string
            - type: 'null'
          title: Embedding Text Attributes
          description: >-
            Pre-assembled text for attributes embedding. If omitted, generated
            from title + attributes.
        sync_hash:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Sync Hash
          description: >-
            Hash of the source data. If unchanged from last sync, skip
            re-embedding.
      type: object
      required:
        - title
        - language
      title: ProductCreate
      description: |-
        Payload for creating/upserting a product.

        If external_id is provided and already exists for this site,
        the product is updated (upsert). Otherwise a new product is created.

        Embedding texts are optional — if provided, they are used directly
        for embedding generation. If omitted, the system generates them
        from title + description/properties/attributes.
    ProductResponse:
      properties:
        id:
          type: string
          title: Id
        tenant_id:
          type: string
          title: Tenant Id
        site_id:
          type: string
          title: Site Id
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
        title:
          type: string
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        short_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Short Description
        sku:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku
        gtin:
          anyOf:
            - type: string
            - type: 'null'
          title: Gtin
        brand:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        attributes:
          additionalProperties: true
          type: object
          title: Attributes
        properties:
          additionalProperties: true
          type: object
          title: Properties
        price_current:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price Current
        price_msrp:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price Msrp
        price_special:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Price Special
        price_on_request:
          type: boolean
          title: Price On Request
        currency:
          type: string
          title: Currency
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        additional_images:
          items: {}
          type: array
          title: Additional Images
        product_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Url
        availability:
          anyOf:
            - type: string
            - type: 'null'
          title: Availability
        rating_average:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Rating Average
        rating_count:
          type: integer
          title: Rating Count
        language:
          type: string
          title: Language
        translation_group_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Translation Group Id
        parent_product_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Product Id
        is_variant:
          type: boolean
          title: Is Variant
        is_parent:
          type: boolean
          title: Is Parent
        search_keywords:
          items:
            type: string
          type: array
          title: Search Keywords
        has_similarity_anchor:
          type: boolean
          title: Has Similarity Anchor
          default: false
        source:
          type: string
          title: Source
        sync_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Sync Hash
        last_synced_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Synced At
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - tenant_id
        - site_id
        - external_id
        - title
        - description
        - short_description
        - sku
        - gtin
        - brand
        - category
        - attributes
        - properties
        - price_current
        - price_msrp
        - price_special
        - price_on_request
        - currency
        - image_url
        - additional_images
        - product_url
        - availability
        - rating_average
        - rating_count
        - language
        - translation_group_id
        - parent_product_id
        - is_variant
        - is_parent
        - source
        - sync_hash
        - last_synced_at
        - created_at
        - updated_at
      title: ProductResponse
      description: Product data returned in API responses.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API-Token aus dem Big-Panda-Admin-UI unter Einstellungen → API-Keys.
        Header: `Authorization: Bearer <token>`.

````