> ## 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 Republish Batch From Variants

> Create a draft republish batch AND seed its
``referenced_record_keys`` from the selected variants in one
round-trip. Saves the UI from chaining create →
add-records-by-variants and avoids the empty-batch state
that would block submit-for-review.



## OpenAPI

````yaml /openapi/merchantops-public.json post /api/pricing/batches/republish-from-variants
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/pricing/batches/republish-from-variants:
    post:
      tags:
        - Pricing
        - Pricing
        - Price Batches
      summary: Create Republish Batch From Variants
      description: |-
        Create a draft republish batch AND seed its
        ``referenced_record_keys`` from the selected variants in one
        round-trip. Saves the UI from chaining create →
        add-records-by-variants and avoids the empty-batch state
        that would block submit-for-review.
      operationId: create_republish_batch_from_variants
      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/CreateRepublishBatchFromVariantsRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    CreateRepublishBatchFromVariantsRequest:
      description: |-
        Convenience body for the product-page "Republish selected
        to…" action: create a draft republish batch AND seed its
        referenced_record_keys from the selected variants in one
        round-trip. Saves the UI from chaining create → add-by-variants.
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        effective_date:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Effective Date
        name:
          description: Human-readable batch name
          title: Name
          type: string
        price_types:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Price Types
        target_env:
          anyOf:
            - type: string
            - type: 'null'
          description: e.g. 'qa' / 'prod'
          title: Target Env
        target_key:
          description: e.g. 'vtex_pricing'
          title: Target Key
          type: string
        variant_keys:
          items:
            type: string
          minItems: 1
          title: Variant Keys
          type: array
      required:
        - name
        - target_key
        - variant_keys
      title: CreateRepublishBatchFromVariantsRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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

````