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

# Bulk Set Prices

> Create several prices at once for a set of variants.

Each line in ``body.lines`` becomes one price record per variant, routed to
the open batch for its effective date (always 'auto' — find-or-create keyed
on (org, effective_date)). Lines sharing an effective date coalesce into the
SAME batch; different dates land in separate batches. Lines are processed
SEQUENTIALLY so same-date lines reuse one batch (no duplicate-batch race).
Reuses the exact batch + record + tz logic as mass-create.



## OpenAPI

````yaml /openapi/merchantops-public.json post /api/pricing/records/bulk-set-prices
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/records/bulk-set-prices:
    post:
      tags:
        - Pricing
        - Pricing
        - Price Records
      summary: Bulk Set Prices
      description: >-
        Create several prices at once for a set of variants.


        Each line in ``body.lines`` becomes one price record per variant, routed
        to

        the open batch for its effective date (always 'auto' — find-or-create
        keyed

        on (org, effective_date)). Lines sharing an effective date coalesce into
        the

        SAME batch; different dates land in separate batches. Lines are
        processed

        SEQUENTIALLY so same-date lines reuse one batch (no duplicate-batch
        race).

        Reuses the exact batch + record + tz logic as mass-create.
      operationId: bulk_set_prices
      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/BulkSetPricesRequest'
        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:
    BulkSetPricesRequest:
      description: >-
        Create several prices at once for a set of variants. Each line in

        ``lines`` becomes one price record per variant, batched by effective
        date

        (always 'auto' — same rule as mass-create). Lines may repeat a price
        type

        (e.g. two sale dates) and may share or differ in effective date.
      properties:
        lines:
          items:
            $ref: '#/components/schemas/PriceLine'
          minItems: 1
          title: Lines
          type: array
        product_key:
          title: Product Key
          type: string
        variant_keys:
          items:
            type: string
          title: Variant Keys
          type: array
      required:
        - product_key
        - variant_keys
        - lines
      title: BulkSetPricesRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    PriceLine:
      description: >-
        One price line in a bulk Set-Prices submission: a price type + amount +

        effective date, applied to every selected variant. By default the line
        is

        routed to the open batch for its effective date (auto), creating one if

        absent. ``batch_key`` optionally pins it to a specific OPEN batch whose

        effective date matches ``effective_from`` (validated server-side).
      properties:
        amount:
          title: Amount
          type: number
        batch_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Batch Key
        effective_from:
          title: Effective From
          type: string
        price_type:
          title: Price Type
          type: string
      required:
        - price_type
        - amount
        - effective_from
      title: PriceLine
      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

````