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

# Install or reinstall the app for the calling Shopify store

> Creates the merchant for the Shopify store in the caller's session token, or marks an existing one reinstalled, then exchanges and stores a fresh offline Admin API token. Call it from the app's install flow only: it writes config.merchant, the default market, default boost/bury rules and the Shopify config, and emits install analytics. Needs a Shopify session token (a staff identity cannot install). Returns the merchant record.



## OpenAPI

````yaml /api-reference/openapi/lite.json post /merchant-create/
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:
  /merchant-create/:
    post:
      summary: Install or reinstall the app for the calling Shopify store
      description: >-
        Creates the merchant for the Shopify store in the caller's session
        token, or marks an existing one reinstalled, then exchanges and stores a
        fresh offline Admin API token. Call it from the app's install flow only:
        it writes config.merchant, the default market, default boost/bury rules
        and the Shopify config, and emits install analytics. Needs a Shopify
        session token (a staff identity cannot install). Returns the merchant
        record.
      operationId: merchantCreate
      responses:
        '200':
          description: The created or reinstalled merchant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LiteMerchant'
        '401':
          description: Not authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '403':
          description: Authenticated, but this identity may not call the API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '502':
          description: Shopify could not answer (token exchange or store read).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
components:
  schemas:
    LiteMerchant:
      type: object
      properties:
        id:
          type: string
        display_name:
          type: string
        start_timestamp:
          type:
            - number
            - 'null'
          description: Install time, epoch seconds.
        base_currency:
          type: string
          description: Currency of the default market (ISO 4217).
        has_completed_onboarding:
          type: boolean
        auto_activate_all_collections:
          type: boolean
          description: New collections are activated for Depict sorting automatically.
        desktop_columns:
          type: integer
          description: Collection grid columns on desktop.
        mobile_columns:
          type: integer
          description: Collection grid columns on mobile.
        shopify_domain:
          type: string
          description: The shop's *.myshopify.com domain.
        shopify_app_installed:
          type: boolean
        has_run_at_least_one_ingestion:
          type:
            - boolean
            - 'null'
          description: The first full catalog import has finished.
        multi_store_group_id:
          type:
            - string
            - 'null'
          description: Multi-store group the merchant belongs to, if any.
        multi_store_activation_code:
          type:
            - string
            - 'null'
        variant_group_by_name:
          type:
            - string
            - 'null'
          description: >-
            Product option name used to group variants in the collection grid
            (e.g. Color); null = no grouping.
        shopify_is_multi_market:
          type: boolean
        uses_cloudflare_ingestion:
          type: boolean
        default_market_id:
          type:
            - string
            - 'null'
      required:
        - id
        - display_name
        - base_currency
        - desktop_columns
        - mobile_columns
        - shopify_domain
        - shopify_app_installed
        - has_run_at_least_one_ingestion
        - multi_store_group_id
        - multi_store_activation_code
        - variant_group_by_name
    Detail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
      description: 'Every 4xx/5xx body: `{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.

````