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

# Connect another store to this merchant's multi-store group

> Joins `merchant_id` and the store whose activation code is given into one multi-store group (creating the group if neither has one). Call it when a merchant enters another store's activation code. Side effect: writes both merchants' group. Follow with create-collection-mappings to link their collections by handle. Refused when both stores are already in groups. Requires multi-store in the plan of the caller and of every store it would put into a group (402 otherwise).



## OpenAPI

````yaml /api-reference/openapi/lite.json post /multi-store/connect-store/{merchant_id}
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/connect-store/{merchant_id}:
    post:
      summary: Connect another store to this merchant's multi-store group
      description: >-
        Joins `merchant_id` and the store whose activation code is given into
        one multi-store group (creating the group if neither has one). Call it
        when a merchant enters another store's activation code. Side effect:
        writes both merchants' group. Follow with create-collection-mappings to
        link their collections by handle. Refused when both stores are already
        in groups. Requires multi-store in the plan of the caller and of every
        store it would put into a group (402 otherwise).
      operationId: multiStoreConnectStore
      parameters:
        - schema:
            type: string
            description: Lite merchant id, e.g. `shopify-<shop id>`.
          required: true
          description: Lite merchant id, e.g. `shopify-<shop id>`.
          name: merchant_id
          in: path
        - schema:
            type: string
            description: >-
              The OTHER store's multi-store activation code, as shown in its
              portal.
          required: true
          description: >-
            The OTHER store's multi-store activation code, as shown in its
            portal.
          name: activation_code
          in: query
      responses:
        '200':
          description: Connected; `message` names the other store.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultiStoreStatusMessage'
        '400':
          description: >-
            `activation_code` missing, or `error_code` OWN_ACTIVATION_CODE (the
            caller's own code) / CODE_ALREADY_USED (both stores already
            grouped).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  error_code:
                    type: string
                    enum:
                      - OWN_ACTIVATION_CODE
                      - CODE_ALREADY_USED
                required:
                  - 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: >-
            Merchant not found for this caller, or `error_code: INVALID_CODE`
            (no store has that code).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  error_code:
                    type: string
                    enum:
                      - INVALID_CODE
                required:
                  - detail
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
components:
  schemas:
    MultiStoreStatusMessage:
      type: object
      properties:
        status:
          type: string
          enum:
            - ok
        message:
          type: string
          description: Shown to the merchant.
      required:
        - status
        - message
    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.

````