Skip to main content
POST
/
api
/
storefront
/
v3
/
headless
/
sections
cURL
curl --request POST \
  --url https://storefront.glood.ai/api/storefront/v3/headless/sections \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-shop: <x-shop>' \
  --data '
{
  "page_url": "<string>",
  "page_type": "home",
  "locale": "en",
  "client_id": "<string>",
  "user_id": "<string>",
  "customer_id": "<string>",
  "product_id": 123,
  "cart_product_ids": [
    123
  ],
  "market": "<string>",
  "sections": [
    "<string>"
  ],
  "placed_sections": [
    "<string>"
  ],
  "preview": true,
  "tags": [
    "<string>"
  ],
  "collection": "<string>",
  "currency": "<string>",
  "zipcode": "<string>",
  "cart_value": 123
}
'
{
  "request_id": "<string>",
  "visit_id": "<string>",
  "sections": [
    {
      "id": "<string>",
      "layout": "<string>",
      "location": "<string>",
      "type": "<string>",
      "position": 123,
      "title": "<string>",
      "extra": {},
      "discount_config": {},
      "show_discount_label": true,
      "translations": {},
      "products": [
        {
          "product_id": 123,
          "title": "<string>",
          "price": 123,
          "tags": "<string>",
          "product_type": "<string>",
          "vendor": "<string>",
          "image": {
            "id": "<string>",
            "url": "<string>",
            "height": 123,
            "width": 123,
            "altText": "<string>"
          },
          "handle": "<string>",
          "compare_at_price": 123,
          "options": [
            {
              "id": 123,
              "name": "<string>",
              "values": [
                "<string>"
              ],
              "position": 123
            }
          ],
          "variants": [
            {
              "variant_id": 123,
              "title": "<string>",
              "display_name": "<string>",
              "position": 123,
              "sku": "<string>",
              "selected_options": [
                {
                  "name": "<string>",
                  "value": "<string>"
                }
              ],
              "price": "<string>",
              "compare_at_price": "<string>",
              "image": {
                "id": "<string>",
                "url": "<string>",
                "height": 123,
                "width": 123,
                "altText": "<string>"
              },
              "sellable_online_quantity": 123,
              "is_in_stock": true,
              "available_for_sale": true
            }
          ],
          "metafields": {}
        }
      ]
    }
  ],
  "product": {
    "product_id": 123,
    "title": "<string>",
    "price": 123,
    "tags": "<string>",
    "product_type": "<string>",
    "vendor": "<string>",
    "image": {
      "id": "<string>",
      "url": "<string>",
      "height": 123,
      "width": 123,
      "altText": "<string>"
    },
    "handle": "<string>",
    "compare_at_price": 123,
    "options": [
      {
        "id": 123,
        "name": "<string>",
        "values": [
          "<string>"
        ],
        "position": 123
      }
    ],
    "variants": [
      {
        "variant_id": 123,
        "title": "<string>",
        "display_name": "<string>",
        "position": 123,
        "sku": "<string>",
        "selected_options": [
          {
            "name": "<string>",
            "value": "<string>"
          }
        ],
        "price": "<string>",
        "compare_at_price": "<string>",
        "image": {
          "id": "<string>",
          "url": "<string>",
          "height": 123,
          "width": 123,
          "altText": "<string>"
        },
        "sellable_online_quantity": 123,
        "is_in_stock": true,
        "available_for_sale": true
      }
    ],
    "metafields": {}
  },
  "token": "<string>",
  "config": {},
  "experience": {}
}

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

Page context and section request payload

page_url
string
required

Full URL of the current page

page_type
enum<string>
required

Type of the current page

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

BCP 47 locale code for the response language

Example:

"en"

client_id
string

Client/device identifier

user_id
string

Anonymous visitor identifier

customer_id
string

Shopify customer ID for authenticated visitors

product_id
integer

ID of the current product (required for product pages)

cart_product_ids
integer[]

Product IDs currently in the visitor's cart

market
string

Shopify market handle for market-specific content

sections
string[]

Specific section IDs to fetch. Omit to fetch all eligible sections for the page.

placed_sections
string[]

Section IDs already rendered on the page (used to avoid duplicates)

preview
boolean

When true, returns sections in preview/draft mode

tags
string[]

Product tags to scope recommendation results

collection
string

Collection handle for collection-page context

currency
string

Currency code for pricing (defaults to shop currency)

zipcode
string

Visitor's zip/postal code for location-based recommendations

cart_value
number

Total value of the visitor's current cart

Response

Sections with product details

request_id
string

Unique identifier for this request (use for event tracking)

visit_id
string

Current visit session identifier

sections
object[]
product
object

The current page's product (populated on product pages)

token
string

Refreshed session token

config
object

Shop configuration snapshot (same shape as HeadlessInitResponse.config)

experience
object

A/B test experience assignment for this request