> ## Documentation Index
> Fetch the complete documentation index at: https://docs.glood.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Headless Events

> Send tracking events from headless, mobile, or hydrogen storefronts.



## OpenAPI

````yaml POST /api/storefront/v3/headless/events
openapi: 3.0.1
info:
  title: Glood.AI API Reference
  description: Glood.AI API Reference
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://storefront.glood.ai
security:
  - bearerAuth: []
paths:
  /api/storefront/v3/headless/events:
    post:
      description: Send tracking events from headless, mobile, or hydrogen storefronts.
      parameters:
        - name: x-shop
          in: header
          description: >-
            Shopify store URL (can be omitted if shop_domain is provided in the
            request body)
          required: false
          schema:
            type: string
            example: shop.myshopify.com
      requestBody:
        description: Event payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HeadlessEventsRequest'
            examples:
              sectionAddToCart:
                summary: >-
                  glood:section:add_to_cart — User added a recommended product
                  to cart
                value:
                  event:
                    id: evt-atc-001
                    name: glood:section:add_to_cart
                    type: custom
                    timestamp: '2026-04-17T10:30:00Z'
                    data: {}
                    customData:
                      track:
                        section: '221939'
                        parent:
                          productId: '15441118822774'
                          variantId: null
                        products:
                          - productId: '15441118953846'
                            variantId: '56640794886518'
                            quantity: 1
                        sectionServeId: 2ec3ae42-40f4-44ec-9aa8-dd907474b51c
                        recommendationType: similar_products
                  session_id: sess-abc123
                  client_id: client-xyz
                  channel: headless
                  page_type: product
                  page_url: https://example.com/products/classic-shirt
              sectionClick:
                summary: glood:section:click — User clicked a recommended product
                value:
                  event:
                    id: evt-click-001
                    name: glood:section:click
                    type: custom
                    timestamp: '2026-04-16T10:30:00Z'
                    data: {}
                    customData:
                      track:
                        section: '219670'
                        page: '46334'
                        products:
                          - productId: '14694200541547'
                            variantId: '51996137914731'
                            quantity: 1
                        parent:
                          productId: '14694203162987'
                          variantId: '51996141781355'
                        requestId: 1776322091-05bd288e-349e-4686-98b0-acf2982aba3f
                        sectionServeId: 612512cd-76b3-4ea4-9e9c-1403c0634bc9
                  session_id: sess-abc123
                  client_id: client-xyz
                  channel: headless
                  page_type: product
                  page_url: https://example.com/products/classic-shirt
              sectionRender:
                summary: glood:section:render — Recommendation section rendered on page
                value:
                  event:
                    id: evt-render-001
                    name: glood:section:render
                    type: custom
                    timestamp: '2026-04-16T10:29:55Z'
                    data: {}
                    customData:
                      track:
                        section: '220585'
                        parent:
                          productId: '9096784544001'
                          variantId: null
                        products:
                          - productId: '9088934117633'
                            variantId: '48242362614017'
                            quantity: 1
                          - productId: '9088798130433'
                            variantId: '48241879417089'
                            quantity: 1
                          - productId: '9093915279617'
                            variantId: '48257196065025'
                            quantity: 1
                          - productId: '9096777892097'
                            variantId: '48263537787137'
                            quantity: 1
                          - productId: '9093946081537'
                            variantId: '48257233158401'
                            quantity: 1
                          - productId: '9093898797313'
                            variantId: '48257176535297'
                            quantity: 1
                          - productId: '9090401992961'
                            variantId: '48248369250561'
                            quantity: 1
                          - productId: '9090377646337'
                            variantId: '48248134533377'
                            quantity: 1
                        sectionServeId: eb07f928-ab63-4dc0-9241-1189658c2f9d
                        recommendationType: similar_products
                  session_id: sess-abc123
                  client_id: client-xyz
                  channel: headless
                  page_type: product
                  page_url: https://example.com/products/premium-jacket
              sectionView:
                summary: glood:section:view — Recommendation section entered viewport
                value:
                  event:
                    id: evt-view-001
                    name: glood:section:view
                    type: custom
                    timestamp: '2026-04-16T10:29:58Z'
                    data: {}
                    customData:
                      track:
                        section: '91740'
                        parent:
                          productId: '8833600782669'
                          variantId: null
                        products:
                          - productId: '6695028293701'
                            variantId: '39789995884613'
                            quantity: 1
                          - productId: '8687660728653'
                            variantId: '47422555717965'
                            quantity: 1
                          - productId: '8770163573069'
                            variantId: '47823353250125'
                            quantity: 1
                          - productId: '6811965161541'
                            variantId: '40284213739589'
                            quantity: 1
                          - productId: '6640685744197'
                            variantId: '39535348187205'
                            quantity: 1
                          - productId: '9949236920653'
                            variantId: '50990938882381'
                            quantity: 1
                        sectionServeId: 3dd1d06b-b45c-4eeb-a246-c4cefa356842
                        recommendationType: similar_products
                  session_id: sess-abc123
                  client_id: client-xyz
                  channel: headless
                  page_type: product
                  page_url: https://example.com/products/summer-dress
      responses:
        '200':
          description: Event accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeadlessEventsResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    HeadlessEventsRequest:
      type: object
      required:
        - event
        - session_id
      properties:
        event:
          type: object
          required:
            - id
            - name
          properties:
            id:
              type: string
              description: Unique identifier for this event occurrence
            name:
              type: string
              description: Event name
              enum:
                - page_viewed
                - product_viewed
                - product_added_to_cart
                - product_removed_from_cart
                - cart_viewed
                - checkout_started
                - checkout_completed
                - checkout_shipping_info_submitted
                - checkout_contact_info_submitted
                - checkout_address_info_submitted
                - payment_info_submitted
                - collection_viewed
                - search_submitted
                - glood:section:view
                - glood:section:click
                - glood:section:add_to_cart
                - glood:section:render
                - glood:bundle:view
                - glood:bundle:click
                - glood:bundle:add_to_cart
                - glood:bundle:render
                - glood:checkout:render
                - glood:checkout:add_to_cart
                - glood:checkout:offer_accept
                - glood:checkout:offer_reject
                - glood:checkout:click
                - glood:init
                - glood:customer_preference
            type:
              type: string
              description: >-
                Whether this is a standard Shopify web pixel event or a custom
                Glood event
              enum:
                - standard
                - custom
            timestamp:
              type: string
              format: date-time
              description: ISO 8601 timestamp of when the event occurred
            data:
              type: object
              description: Event-specific payload data
            customData:
              type: object
              description: Additional custom data for Glood-specific events
        channel:
          type: string
          description: Storefront channel the event originated from
          enum:
            - web
            - mobile
            - headless
            - hydrogen
          default: web
        user_id:
          type: string
          description: Anonymous visitor identifier
        client_id:
          type: string
          description: Client/device identifier
        customer_id:
          type: string
          description: Shopify customer ID for authenticated visitors
        session_id:
          type: string
          description: Current session identifier (from HeadlessInitResponse.visit_id)
        shop_domain:
          type: string
          description: Shopify store URL. Required if the x-shop header is not set.
          example: shop.myshopify.com
        device:
          type: object
          description: Device information for the client
          properties:
            type:
              type: string
              description: Device type (e.g. phone, tablet, desktop)
            os:
              type: string
              description: Operating system name
            os_version:
              type: string
              description: Operating system version
            app_version:
              type: string
              description: Version of the client app (for mobile channels)
        page_type:
          type: string
          description: Type of the page from which the event was fired
          enum:
            - home
            - product
            - collection
            - cart
            - checkout
            - order_status
            - search
            - other
        page_url:
          type: string
          description: Full URL of the page from which the event was fired
        cart:
          type: object
          description: Cart state at the time of the event
        customer:
          type: object
          description: Customer information at the time of the event
        customer_privacy:
          type: object
          description: Customer consent/privacy preferences
    HeadlessEventsResponse:
      type: object
      properties:
        ok:
          type: boolean
          enum:
            - true
          description: Indicates the event was accepted successfully
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````