Skip to main content
POST
/
api
/
storefront
/
v3
/
headless
/
events
cURL
curl --request POST \
  --url https://storefront.glood.ai/api/storefront/v3/headless/events \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "event": {
    "id": "<string>",
    "name": "page_viewed",
    "type": "standard",
    "timestamp": "2023-11-07T05:31:56Z",
    "data": {},
    "customData": {}
  },
  "session_id": "<string>",
  "channel": "web",
  "user_id": "<string>",
  "client_id": "<string>",
  "customer_id": "<string>",
  "shop_domain": "shop.myshopify.com",
  "device": {
    "type": "<string>",
    "os": "<string>",
    "os_version": "<string>",
    "app_version": "<string>"
  },
  "page_type": "home",
  "page_url": "<string>",
  "cart": {},
  "customer": {},
  "customer_privacy": {}
}
'
{
  "ok": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-shop
string

Shopify store URL (can be omitted if shop_domain is provided in the request body)

Example:

"shop.myshopify.com"

Body

application/json

Event payload

event
object
required
session_id
string
required

Current session identifier (from HeadlessInitResponse.visit_id)

channel
enum<string>
default:web

Storefront channel the event originated from

Available options:
web,
mobile,
headless,
hydrogen
user_id
string

Anonymous visitor identifier

client_id
string

Client/device identifier

customer_id
string

Shopify customer ID for authenticated visitors

shop_domain
string

Shopify store URL. Required if the x-shop header is not set.

Example:

"shop.myshopify.com"

device
object

Device information for the client

page_type
enum<string>

Type of the page from which the event was fired

Available options:
home,
product,
collection,
cart,
checkout,
order_status,
search,
other
page_url
string

Full URL of the page from which the event was fired

cart
object

Cart state at the time of the event

customer
object

Customer information at the time of the event

customer_privacy
object

Customer consent/privacy preferences

Response

Event accepted

ok
enum<boolean>

Indicates the event was accepted successfully

Available options:
true