> ## 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.

# Add Records By Variants

> Resolve "latest active prices for these specific variants"
into a republish batch. Used by the product detail page's
"Republish selected SKUs to…" flow.



## OpenAPI

````yaml /openapi/merchantops-public.json post /api/pricing/batches/{key}/add-records-by-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/{key}/add-records-by-variants:
    post:
      tags:
        - Pricing
        - Pricing
        - Price Batches
      summary: Add Records By Variants
      description: |-
        Resolve "latest active prices for these specific variants"
        into a republish batch. Used by the product detail page's
        "Republish selected SKUs to…" flow.
      operationId: add_records_by_variants
      parameters:
        - in: path
          name: key
          required: true
          schema:
            title: Key
            type: string
        - 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/AddRecordsByVariantsRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    AddRecordsByVariantsRequest:
      description: |-
        Resolve "latest active prices for these variants" into a
        republish batch. Used by the per-product "Republish selected
        SKUs to…" flow where the user has explicit variant_keys
        selected from the price-records list.
      properties:
        price_types:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Price Types
        variant_keys:
          items:
            type: string
          minItems: 1
          title: Variant Keys
          type: array
      required:
        - variant_keys
      title: AddRecordsByVariantsRequest
      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

````