> ## 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 Products Batch

> Create multiple products in batches.

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

Processes products in configurable batch sizes to avoid timeouts.
Failed products are tracked with error details.
Creates a Job to track the batch operation.



## OpenAPI

````yaml /openapi/merchantops-public.json post /api/products/batch
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/products/batch:
    post:
      tags:
        - Products
      summary: Create Products Batch
      description: |-
        Create multiple products in batches.

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

        Processes products in configurable batch sizes to avoid timeouts.
        Failed products are tracked with error details.
        Creates a Job to track the batch operation.
      operationId: create_products_batch
      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/ProductBatchRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductBatchResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    ProductBatchRequest:
      description: Request model for batch product creation.
      properties:
        batch_size:
          default: 25
          description: Batch size for processing (1-50)
          maximum: 50
          minimum: 1
          title: Batch Size
          type: integer
        products:
          description: List of products to create
          items:
            $ref: '#/components/schemas/ProductCreateRequest'
          title: Products
          type: array
        validate:
          default: false
          description: Validate against ProductType
          title: Validate
          type: boolean
      required:
        - products
      title: ProductBatchRequest
      type: object
    ProductBatchResponse:
      description: Response model for batch product creation.
      properties:
        created:
          description: Number successfully created
          title: Created
          type: integer
        errors:
          description: List of errors
          items:
            additionalProperties:
              type: string
            type: object
          title: Errors
          type: array
        failed:
          description: Number that failed
          title: Failed
          type: integer
        job_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Job ID for tracking batch progress
          title: Job Id
        skipped:
          default: 0
          description: Number unchanged (no new version created)
          title: Skipped
          type: integer
        total:
          description: Total products submitted
          title: Total
          type: integer
      required:
        - total
        - created
        - failed
      title: ProductBatchResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ProductCreateRequest:
      description: Request model for creating a Product.
      properties:
        enrichProduct:
          default: true
          title: Enrichproduct
          type: boolean
        isPublished:
          default: false
          title: Ispublished
          type: boolean
        key:
          title: Key
          type: string
        productType:
          additionalProperties: true
          title: Producttype
          type: object
        properties:
          additionalProperties: true
          description: Product properties dict
          title: Properties
          type: object
        properties_metadata:
          additionalProperties:
            additionalProperties: true
            type: object
          title: Properties Metadata
          type: object
        scrapeBrandSite:
          default: true
          title: Scrapebrandsite
          type: boolean
        searchLakehouse:
          default: true
          title: Searchlakehouse
          type: boolean
        source:
          title: Source
          type: string
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
      required:
        - key
        - source
        - productType
      title: ProductCreateRequest
      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

````