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>",
"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
}
'import requests
url = "https://storefront.glood.ai/api/storefront/v3/headless/sections"
payload = {
"page_url": "<string>",
"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
}
headers = {
"x-shop": "<x-shop>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-shop': '<x-shop>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
page_url: '<string>',
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
})
};
fetch('https://storefront.glood.ai/api/storefront/v3/headless/sections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://storefront.glood.ai/api/storefront/v3/headless/sections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'page_url' => '<string>',
'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
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop: <x-shop>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://storefront.glood.ai/api/storefront/v3/headless/sections"
payload := strings.NewReader("{\n \"page_url\": \"<string>\",\n \"locale\": \"en\",\n \"client_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"product_id\": 123,\n \"cart_product_ids\": [\n 123\n ],\n \"market\": \"<string>\",\n \"sections\": [\n \"<string>\"\n ],\n \"placed_sections\": [\n \"<string>\"\n ],\n \"preview\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"currency\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"cart_value\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-shop", "<x-shop>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://storefront.glood.ai/api/storefront/v3/headless/sections")
.header("x-shop", "<x-shop>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"page_url\": \"<string>\",\n \"locale\": \"en\",\n \"client_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"product_id\": 123,\n \"cart_product_ids\": [\n 123\n ],\n \"market\": \"<string>\",\n \"sections\": [\n \"<string>\"\n ],\n \"placed_sections\": [\n \"<string>\"\n ],\n \"preview\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"currency\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"cart_value\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://storefront.glood.ai/api/storefront/v3/headless/sections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-shop"] = '<x-shop>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"page_url\": \"<string>\",\n \"locale\": \"en\",\n \"client_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"product_id\": 123,\n \"cart_product_ids\": [\n 123\n ],\n \"market\": \"<string>\",\n \"sections\": [\n \"<string>\"\n ],\n \"placed_sections\": [\n \"<string>\"\n ],\n \"preview\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"currency\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"cart_value\": 123\n}"
response = http.request(request)
puts response.read_body{
"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": {},
"display_price": 123,
"display_compare_at_price": 123,
"display_currency": "<string>",
"original_currency": "<string>",
"currency_rate": 123,
"available_for_sale": true,
"is_in_stock": true,
"total_inventory": 123,
"featured_media": {},
"media": [
{}
]
}
]
}
],
"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": {},
"display_price": 123,
"display_compare_at_price": 123,
"display_currency": "<string>",
"original_currency": "<string>",
"currency_rate": 123,
"available_for_sale": true,
"is_in_stock": true,
"total_inventory": 123,
"featured_media": {},
"media": [
{}
]
},
"token": "<string>",
"config": {},
"experience": {}
}{
"error": 123,
"message": "<string>"
}Get Headless Sections
Get recommendation sections with full product details for a given page context.
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>",
"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
}
'import requests
url = "https://storefront.glood.ai/api/storefront/v3/headless/sections"
payload = {
"page_url": "<string>",
"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
}
headers = {
"x-shop": "<x-shop>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-shop': '<x-shop>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
page_url: '<string>',
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
})
};
fetch('https://storefront.glood.ai/api/storefront/v3/headless/sections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://storefront.glood.ai/api/storefront/v3/headless/sections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'page_url' => '<string>',
'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
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-shop: <x-shop>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://storefront.glood.ai/api/storefront/v3/headless/sections"
payload := strings.NewReader("{\n \"page_url\": \"<string>\",\n \"locale\": \"en\",\n \"client_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"product_id\": 123,\n \"cart_product_ids\": [\n 123\n ],\n \"market\": \"<string>\",\n \"sections\": [\n \"<string>\"\n ],\n \"placed_sections\": [\n \"<string>\"\n ],\n \"preview\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"currency\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"cart_value\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-shop", "<x-shop>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://storefront.glood.ai/api/storefront/v3/headless/sections")
.header("x-shop", "<x-shop>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"page_url\": \"<string>\",\n \"locale\": \"en\",\n \"client_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"product_id\": 123,\n \"cart_product_ids\": [\n 123\n ],\n \"market\": \"<string>\",\n \"sections\": [\n \"<string>\"\n ],\n \"placed_sections\": [\n \"<string>\"\n ],\n \"preview\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"currency\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"cart_value\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://storefront.glood.ai/api/storefront/v3/headless/sections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-shop"] = '<x-shop>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"page_url\": \"<string>\",\n \"locale\": \"en\",\n \"client_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"customer_id\": \"<string>\",\n \"product_id\": 123,\n \"cart_product_ids\": [\n 123\n ],\n \"market\": \"<string>\",\n \"sections\": [\n \"<string>\"\n ],\n \"placed_sections\": [\n \"<string>\"\n ],\n \"preview\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"currency\": \"<string>\",\n \"zipcode\": \"<string>\",\n \"cart_value\": 123\n}"
response = http.request(request)
puts response.read_body{
"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": {},
"display_price": 123,
"display_compare_at_price": 123,
"display_currency": "<string>",
"original_currency": "<string>",
"currency_rate": 123,
"available_for_sale": true,
"is_in_stock": true,
"total_inventory": 123,
"featured_media": {},
"media": [
{}
]
}
]
}
],
"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": {},
"display_price": 123,
"display_compare_at_price": 123,
"display_currency": "<string>",
"original_currency": "<string>",
"currency_rate": 123,
"available_for_sale": true,
"is_in_stock": true,
"total_inventory": 123,
"featured_media": {},
"media": [
{}
]
},
"token": "<string>",
"config": {},
"experience": {}
}{
"error": 123,
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Shopify store URL
"shop.myshopify.com"
Body
Page context and section request payload
Full URL of the current page
Type of the current page
home, product, collection, cart, checkout, order_status, search, other BCP 47 locale code for the response language
"en"
Client/device identifier
Anonymous visitor identifier
Shopify customer ID for authenticated visitors
ID of the current product (required for product pages)
Product IDs currently in the visitor's cart
Shopify market handle for market-specific content
Specific section IDs to fetch. Omit to fetch all eligible sections for the page.
Section IDs already rendered on the page (used to avoid duplicates)
When true, returns sections in preview/draft mode
Product tags to scope recommendation results
Collection handle for collection-page context
Currency code for pricing (defaults to shop currency)
Visitor's zip/postal code for location-based recommendations
Total value of the visitor's current cart
Response
Sections with product details
Unique identifier for this request (use for event tracking)
Current visit session identifier
Show child attributes
Show child attributes
The current page's product (populated on product pages)
Show child attributes
Show child attributes
Refreshed session token
Shop configuration snapshot (same shape as HeadlessInitResponse.config)
A/B test experience assignment for this request
Was this page helpful?