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

# Recommend For Products And User

<Warning>
  This page does not apply to installs made in 2025 or later of the Depict Shopify apps
</Warning>


## OpenAPI

````yaml post /v2/recommend/products/products
openapi: 3.1.0
info:
  title: Depict API
  version: '1.0'
servers: []
security: []
paths:
  /v2/recommend/products/products:
    post:
      tags:
        - Recommendations (v2)
      summary: Recommend For Products And User
      description: >-
        Returns an object with an array of recommendation displays.


        Each display will contain a recommendation_id (which is also present as
        a URL parameter in `display.page_url`).

        The recommendation_id should be sent to the `create-events` endpoint if
        the user interacts with the recommendation.

        This is typically achieved by storing the recommendation as a data
        attribute on the HTML element containing the recommendation.


        Example response:

        <pre>

        {
            "displays": [{
                "title": "Mechanical Keyboard",
                "price": "100.00",
                "image_url": "https://my_store.com/awesome_mechanical_keyboard.jpeg",
                "page_url": "https://my_store.com/awesome_mechanical_keyboard.html",
                "product_id": "awesome_mechanical_keyboard",
                "recommendation_id": "827ada29-92e7-4642-8805-8b7105a9c8a5"
            }]
        }

        </pre>
      operationId: Recommend_for_Products_and_User_v2_recommend_products_products_post
      parameters:
        - name: referer
          in: header
          required: false
          schema:
            type: string
            title: Referer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecommendForManyRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecommendResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyQuery: []
        - APIKeyHeader: []
        - APIKeyCookie: []
components:
  schemas:
    RecommendForManyRequest:
      properties:
        tenant:
          type: string
          title: Tenant
          description: Identifier associated with the API integration
        market:
          type: string
          title: Market
          description: Market identifier
        locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Locale
          description: Locale identifier
        type:
          type: string
          title: Type
          description: Type of the recommendation, e.g. `cross_sell`
        limit:
          anyOf:
            - type: integer
              maximum: 128
              minimum: 1
            - type: 'null'
          title: Limit
          description: Maximum number of recommendations returned.
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: Customer identifier
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
          description: Session identifier
        dsid:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Dsid
          description: >-
            Populated for integrations performed by Depict.ai only. Depict.ai
            Session Id
        document_referrer:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Referrer
        metadata:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Metadata
          description: >-
            Metadata that can be used to modify the behaviour of the
            recommendation system
        product_ids:
          items:
            type: string
          type: array
          title: Product Ids
      additionalProperties: false
      type: object
      required:
        - tenant
        - market
        - type
        - product_ids
      title: RecommendForManyRequest
    RecommendResponse:
      properties:
        displays:
          items:
            type: object
          type: array
          title: Displays
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        variant:
          anyOf:
            - type: integer
            - type: 'null'
          title: Variant
        experiment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Experiment Id
      additionalProperties: false
      type: object
      required:
        - displays
      title: RecommendResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyQuery:
      type: apiKey
      in: query
      name: api_key
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY
    APIKeyCookie:
      type: apiKey
      in: cookie
      name: X-API-KEY

````