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

# Track V2



## OpenAPI

````yaml /api-reference/openapi/storefront.json post /v2/track
openapi: 3.1.0
info:
  title: Depict Platform API
  version: '1.0'
  description: >-
    The Depict platform API at api.depict.ai: storefront-facing search,
    listings, recommendations and event tracking for headless integrations. Not
    to be confused with the storefront search API (runway.depict.ai) used by the
    Search by Depict Shopify app.
servers:
  - url: https://api.depict.ai
security: []
paths:
  /v2/track:
    post:
      tags:
        - Events
        - V2
      summary: Track V2
      operationId: track_v2_v2_track_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrackV2Request'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      deprecated: true
components:
  schemas:
    TrackV2Request:
      properties:
        tenant:
          type: string
          minLength: 1
          title: Tenant
        market:
          type: string
          minLength: 1
          title: Market
        events:
          items:
            anyOf:
              - $ref: '#/components/schemas/UserTransactionMappingEvent'
              - $ref: '#/components/schemas/PurchaseEvent'
              - $ref: '#/components/schemas/ProductUnavailableEvent'
          type: array
          title: Events
      type: object
      required:
        - tenant
        - market
        - events
      title: TrackV2Request
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UserTransactionMappingEvent:
      properties:
        user_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: User Id
        session_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Session Id
        dsid:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Dsid
        transaction_id:
          type: string
          minLength: 1
          title: Transaction Id
        event_type:
          anyOf:
            - type: string
              const: transaction_mapping
            - type: 'null'
          title: Event Type
      type: object
      required:
        - transaction_id
      title: UserTransactionMappingEvent
    PurchaseEvent:
      properties:
        user_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: User Id
        session_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Session Id
        dsid:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Dsid
        transaction_id:
          type: string
          minLength: 1
          title: Transaction Id
        event_type:
          anyOf:
            - type: string
              const: purchase
            - type: 'null'
          title: Event Type
        currency:
          type: string
          title: Currency
        products:
          items:
            $ref: '#/components/schemas/PurchasedProduct'
          type: array
          minItems: 1
          title: Products
        depict_ab_variant:
          anyOf:
            - type: string
            - type: 'null'
          title: Depict Ab Variant
      type: object
      required:
        - transaction_id
        - currency
        - products
      title: PurchaseEvent
    ProductUnavailableEvent:
      properties:
        user_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: User Id
        session_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Session Id
        dsid:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Dsid
        event_type:
          type: string
          const: product_unavailable
          title: Event Type
        product_id:
          type: string
          minLength: 1
          title: Product Id
        unavailability_type:
          $ref: '#/components/schemas/EUnavailabilityType'
      type: object
      required:
        - event_type
        - product_id
        - unavailability_type
      title: ProductUnavailableEvent
    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
    PurchasedProduct:
      properties:
        sku:
          type: string
          minLength: 1
          title: Sku
        price:
          type: number
          minimum: 0
          title: Price
        quantity:
          type: integer
          minimum: 1
          title: Quantity
      type: object
      required:
        - sku
        - price
        - quantity
      title: PurchasedProduct
    EUnavailabilityType:
      type: string
      enum:
        - out_of_stock
        - missing
      title: EUnavailabilityType

````