Skip to main content
POST
/
api
/
storefront
/
v3
/
headless
/
init
cURL
curl --request POST \
  --url https://storefront.glood.ai/api/storefront/v3/headless/init \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-shop: <x-shop>' \
  --data '
{
  "user_id": "<string>",
  "client_id": "<string>",
  "customer_id": "<string>",
  "page_type": "home",
  "page_url": "<string>"
}
'
{
  "visit_id": "<string>",
  "user_id": "<string>",
  "client_id": "<string>",
  "customer_id": "<string>",
  "visitor": {
    "browsed_products": [
      123
    ],
    "cart_products": [
      123
    ],
    "purchased_products": [
      123
    ]
  },
  "config": {
    "shop": {
      "money_format": "<string>",
      "currency": "<string>"
    },
    "integrations_enabled": true,
    "product_review_app": "<string>",
    "analytics_enabled": true,
    "skip_parent_product": true
  },
  "token": "<string>"
}

Authorizations

Authorization
string
header
required

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

Headers

x-shop
string
required

Shopify store URL

Example:

"shop.myshopify.com"

Body

application/json

Visitor identification payload

user_id
string

Anonymous visitor identifier (persisted across sessions)

client_id
string

Client/device identifier for the current session

customer_id
string

Shopify customer ID for authenticated visitors

page_type
enum<string>

Type of the current page

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

Full URL of the current page

Response

Visitor context and shop configuration

visit_id
string

Unique identifier for this visit session

user_id
string

Anonymous visitor identifier to persist on the client

client_id
string

Client/device identifier

customer_id
string

Shopify customer ID if authenticated

visitor
object

Visitor's historical activity context

config
object

Shop configuration relevant to the storefront

token
string

Short-lived session token to include in subsequent requests