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

# Bulk Upsert Product Variants Public

> Bulk upsert variants under a parent product item in a single call.

The product_id path parameter is the parent product catalog item database ID, not the business product_id field stored in row data.
Merges provided product-level fields into each variant and upserts using the catalog's configured unique id field (e.g., 'sku').



## OpenAPI

````yaml /api-reference/openapi.json post /public/catalogs/{catalog_id}/products/{product_id}/items/bulk
openapi: 3.1.0
info:
  title: Rastro Public API
  description: >-
    Public API for enrichment, catalog management, workflows, activities,
    snapshots, taxonomy, and MCP integrations.
  version: 0.1.0
servers:
  - url: https://catalogapi.rastro.ai/api
security:
  - bearerAuth: []
paths:
  /public/catalogs/{catalog_id}/products/{product_id}/items/bulk:
    post:
      tags:
        - Catalogs
      summary: Bulk Upsert Product Variants Public
      description: >-
        Bulk upsert variants under a parent product item in a single call.


        The product_id path parameter is the parent product catalog item
        database ID, not the business product_id field stored in row data.

        Merges provided product-level fields into each variant and upserts using
        the catalog's configured unique id field (e.g., 'sku').
      operationId: >-
        bulk_upsert_product_variants_public_api_public_catalogs__catalog_id__products__product_id__items_bulk_post
      parameters:
        - name: catalog_id
          in: path
          required: true
          description: >-
            Parent product catalog item database ID, not the business product_id
            field value.
          schema:
            type: string
            title: Catalog Id
        - name: product_id
          in: path
          required: true
          schema:
            type: string
            title: Product Id
        - name: X-Organization-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Organization-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkUpsertProductVariantsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkUpsertProductResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    BulkUpsertProductVariantsRequest:
      properties:
        product:
          additionalProperties: true
          type: object
          title: Product
          default: {}
        variants:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Variants
        source_info:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Source Info
        auto_evolve_schema:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Auto Evolve Schema
      type: object
      required:
        - variants
      title: BulkUpsertProductVariantsRequest
      description: >-
        Bulk upsert variants for a product using variants payload.


        - product: product-level fields (typically keys prefixed with
        'product_')

        - variants: list of variant objects

        - source_info: optional metadata recorded on items

        - auto_evolve_schema: accepted for compatibility; public bulk writes
        currently allow schema evolution from submitted item data
    BulkUpsertProductResponse:
      properties:
        product_id:
          type: string
          title: Product Id
        items_processed:
          type: integer
          title: Items Processed
        items_created:
          type: integer
          title: Items Created
        items_updated:
          type: integer
          title: Items Updated
        items_failed:
          type: integer
          title: Items Failed
        schema_evolved:
          type: boolean
          title: Schema Evolved
        new_schema_version:
          anyOf:
            - type: string
            - type: 'null'
          title: New Schema Version
        errors:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Errors
          default: []
        duplicates_in_payload:
          type: integer
          title: Duplicates In Payload
          default: 0
        error_summary:
          additionalProperties:
            type: integer
          type: object
          title: Error Summary
          default: {}
        warnings:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Warnings
          default: []
        warnings_summary:
          additionalProperties:
            type: integer
          type: object
          title: Warnings Summary
          default: {}
      type: object
      required:
        - product_id
        - items_processed
        - items_created
        - items_updated
        - items_failed
        - schema_evolved
      title: BulkUpsertProductResponse
    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
      bearerFormat: Rastro API key or user token

````