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

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


## OpenAPI

````yaml post /v2/track
openapi: 3.1.0
info:
  title: Depict API
  version: '1.0'
servers: []
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
      security:
        - APIKeyQuery: []
        - APIKeyHeader: []
        - APIKeyCookie: []
components:
  schemas:
    TrackV2Request:
      properties:
        tenant:
          type: string
          minLength: 1
          title: Tenant
          description: Identifier associated with the API integration
        market:
          type: string
          minLength: 1
          title: Market
          description: Market identifier
        events:
          items:
            anyOf:
              - $ref: '#/components/schemas/UserTransactionMappingEvent'
              - $ref: '#/components/schemas/PurchaseEvent'
              - $ref: '#/components/schemas/ProductUnavailableEvent'
          type: array
          title: Events
      additionalProperties: false
      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
          description: User Id. Persistent between devices, typically on a logged in user.
        session_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Session Id
          description: >-
            Session Id. Unique to a browser/app and stored locally, e.g. cookie
            or localStorage.
        dsid:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Dsid
          description: >-
            Populated for integrations performed by Depict.ai only. Depict.ai
            Session Id.
        transaction_id:
          type: string
          minLength: 1
          title: Transaction Id
          description: Unique identifier for the transaction.
        event_type:
          anyOf:
            - const: transaction_mapping
            - type: 'null'
          title: Event Type
          description: 'The type identifier for this event: transaction_mapping.'
      additionalProperties: false
      type: object
      required:
        - transaction_id
      title: UserTransactionMappingEvent
    PurchaseEvent:
      properties:
        user_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: User Id
          description: User Id. Persistent between devices, typically on a logged in user.
        session_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Session Id
          description: >-
            Session Id. Unique to a browser/app and stored locally, e.g. cookie
            or localStorage.
        dsid:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Dsid
          description: >-
            Populated for integrations performed by Depict.ai only. Depict.ai
            Session Id.
        transaction_id:
          type: string
          minLength: 1
          title: Transaction Id
          description: Unique identifier for the transaction.
        event_type:
          anyOf:
            - const: purchase
            - type: 'null'
          title: Event Type
          description: 'The type identifier for this event: purchase.'
        currency:
          type: string
          pattern: >-
            ^AED|AFN|ALL|AMD|ANG|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BGN|BHD|BIF|BMD|BND|BOB|BRL|BSD|BTN|BWP|BYR|BZD|CAD|CDF|CHF|CLP|CNY|COP|CRC|CUC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GGP|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR|ILS|IMP|INR|IQD|IRR|ISK|JEP|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRO|MUR|MVR|MWK|MXN|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLL|SOS|SPL|SRD|STD|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TVD|TWD|TZS|UAH|UGX|USD|UYU|UZS|VEF|VND|VUV|WST|XAF|XCD|XDR|XOF|XPF|YER|ZAR|ZMW|ZWD$
          title: Currency
          description: Currency the purchase was paid in
        products:
          items:
            $ref: '#/components/schemas/PurchasedProduct'
          type: array
          minItems: 1
          title: Products
          description: All the products purchased in this transaction
      additionalProperties: false
      type: object
      required:
        - transaction_id
        - currency
        - products
      title: PurchaseEvent
    ProductUnavailableEvent:
      properties:
        user_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: User Id
          description: User Id. Persistent between devices, typically on a logged in user.
        session_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Session Id
          description: >-
            Session Id. Unique to a browser/app and stored locally, e.g. cookie
            or localStorage.
        dsid:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Dsid
          description: >-
            Populated for integrations performed by Depict.ai only. Depict.ai
            Session Id.
        event_type:
          const: product_unavailable
          title: Event Type
          description: 'The type identifier for this event: product_unavailable.'
        product_id:
          type: string
          minLength: 1
          title: Product Id
          description: Main product identifier
        unavailability_type:
          allOf:
            - $ref: '#/components/schemas/EUnavailabilityType'
          description: Reason the product isn't available for purchase
      additionalProperties: false
      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
          description: >-
            Stock keeping unit, a distinct item for sale. If you are using
            Google Analytics, it should be the same id used for products there.
        price:
          anyOf:
            - type: number
              minimum: 0
            - type: string
          title: Price
          description: >-
            Price per unit. If there are discounts because of quantity, the unit
            price should be adjusted accordingly.
        quantity:
          type: integer
          minimum: 1
          title: Quantity
          description: The number of times the product was purchased.
      additionalProperties: false
      type: object
      required:
        - sku
        - price
        - quantity
      title: PurchasedProduct
    EUnavailabilityType:
      type: string
      enum:
        - out_of_stock
        - missing
      title: EUnavailabilityType
  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

````