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

# Set which store each collection copy replicates from

> Sets `replication_merchant_id` on the given collection copies (null stops replicating); copies left out are unchanged. A merchant may only name stores of its own group; through an AI assistant, only the connected store itself or null. Side effect: writes mapping rows; the next publish of a source collection copies its setup to its replicas. Naming a source a copy does not already have requires multi-store in the caller's plan (402 otherwise); an entry that keeps its current source, and null, never do. Answers null; an empty list is a no-op.



## OpenAPI

````yaml /api-reference/openapi/lite.json post /multi-store/collection-replication
openapi: 3.1.0
info:
  title: Search & Merchandising API
  version: 1.0.0
  description: >-
    REST API behind Depict: Search & Merchandising, the native Shopify app:
    onboarding, collections, boost & bury, dashboards, A/B testing and
    multi-store management. Endpoints are served under the /api/lite prefix and
    are authenticated with the Shopify session token that App Bridge issues to
    the embedded app.
servers:
  - url: /api/lite
security:
  - ShopifySessionToken: []
paths:
  /multi-store/collection-replication:
    post:
      summary: Set which store each collection copy replicates from
      description: >-
        Sets `replication_merchant_id` on the given collection copies (null
        stops replicating); copies left out are unchanged. A merchant may only
        name stores of its own group; through an AI assistant, only the
        connected store itself or null. Side effect: writes mapping rows; the
        next publish of a source collection copies its setup to its replicas.
        Naming a source a copy does not already have requires multi-store in the
        caller's plan (402 otherwise); an entry that keeps its current source,
        and null, never do. Answers null; an empty list is a no-op.
      operationId: multiStoreCollectionReplicationUpdate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CollectionReplicationUpdate'
      responses:
        '200':
          description: Written.
          content:
            application/json:
              schema:
                type: 'null'
        '400':
          description: >-
            The query, path or body failed the schema; `detail` carries zod's
            messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '401':
          description: Not authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '402':
          description: >-
            The plan does not include multi-store (Merchandising at Large or
            above).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Paywall'
        '403':
          description: Authenticated, but this identity may not call the API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '404':
          description: The caller is in no group, or the body names a store outside it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '415':
          description: Content-Type is not application/json.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
components:
  schemas:
    CollectionReplicationUpdate:
      type: array
      items:
        type: object
        properties:
          merchant_id:
            type: string
          replication_merchant_id:
            type:
              - string
              - 'null'
            description: The store this copy replicates FROM; null stops replicating.
          collection:
            type: object
            properties:
              collection_id:
                type: string
            required:
              - collection_id
        required:
          - merchant_id
          - replication_merchant_id
          - collection
      description: >-
        One entry per collection copy to change; send only the copies you are
        changing, as copies left out keep their source. Through an AI assistant,
        each entry's `replication_merchant_id` must be the connected store
        itself or null, or the whole request is refused.
    Detail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
      description: 'Every 4xx/5xx body: `{detail}`.'
    Paywall:
      type: object
      properties:
        detail:
          type: string
        code:
          type: string
          enum:
            - product_required
            - collection_limit_exceeded
            - installation_frozen
        product:
          type: string
          enum:
            - search
            - recs
            - vm
        limit:
          type: integer
      required:
        - detail
        - code
      description: >-
        402: the merchant's plan does not include this. Branch on `code`; show
        `detail`.
  securitySchemes:
    ShopifySessionToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Shopify App Bridge session token of the embedded Depict: Search &
        Merchandising app. The shop in the token determines the merchant;
        merchant_id parameters must belong to that shop.

````