curl --request POST \
--url https://storefront.glood.ai/api/storefront/v3/headless/recommendations/customer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop: <x-shop>' \
--data '
{
"customer_id": "9155793715519",
"email": "shopper@example.com",
"max_recommendations": 4,
"view": "product_ids"
}
'{
"status": "ok",
"serve_id": "4f2e9c1a-7d3b-4b8e-9a51-2c6f0d8e1b77",
"customer": {
"identified": true,
"signals": {
"browsing_history": { "available": true, "count": 6 },
"cart": { "available": true, "count": 1, "source": "pixel" },
"purchase_history": { "available": false, "count": 0 }
}
},
"blocks": {
"cart": {
"recommendation_serve_id": "9a1c2b3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"recommendation_type": "bought_together",
"checkpoint": {
"status": "personalized",
"reason": null,
"uses_customer_data": true,
"anchor_product_ids": [9311227904319],
"personalized_count": 4,
"fallback_count": 0,
"filled_from": null
},
"recommendations": [
{ "product_id": 9311227838783 },
{ "product_id": 9311227871551 },
{ "product_id": 9311227937087 },
{ "product_id": 9311227969855 }
]
},
"browsing_history": {
"recommendation_serve_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"recommendation_type": "similar_products",
"checkpoint": {
"status": "partial",
"reason": "insufficient_results",
"uses_customer_data": true,
"anchor_product_ids": [9311228002623, 9311228035391],
"personalized_count": 2,
"fallback_count": 2,
"filled_from": "trending"
},
"recommendations": [
{ "product_id": 9311228068159 },
{ "product_id": 9311228100927 },
{ "product_id": 9311228264767 },
{ "product_id": 9311228297535 }
]
},
"purchase_history": {
"recommendation_serve_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"recommendation_type": "cross_sell",
"checkpoint": {
"status": "fallback",
"reason": "no_customer_data",
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 4,
"filled_from": "trending"
},
"recommendations": [
{ "product_id": 9311228330303 },
{ "product_id": 9311228363071 },
{ "product_id": 9311228395839 },
{ "product_id": 9311228428607 }
]
},
"trending": {
"recommendation_serve_id": "3d4e5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
"recommendation_type": "trending",
"checkpoint": {
"status": "trending",
"reason": null,
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 0,
"filled_from": null
},
"recommendations": [
{ "product_id": 9311228133695 },
{ "product_id": 9311228166463 },
{ "product_id": 9311228199231 },
{ "product_id": 9311228231999 }
]
}
}
}
{
"status": "ok",
"serve_id": "4f2e9c1a-7d3b-4b8e-9a51-2c6f0d8e1b77",
"customer": { "identified": true, "signals": { "...": "..." } },
"blocks": {
"cart": {
"recommendation_serve_id": "9a1c2b3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"recommendation_type": "bought_together",
"checkpoint": {
"status": "personalized",
"reason": null,
"uses_customer_data": true,
"anchor_product_ids": [9311227904319],
"personalized_count": 1,
"fallback_count": 0,
"filled_from": null
},
"recommendations": [
{
"product_id": 9311227838783,
"title": "Classic Cotton T-Shirt",
"handle": "classic-cotton-t-shirt",
"price": 1025,
"compare_at_price": null,
"image": {
"id": "gid://shopify/ProductImage/123456",
"url": "https://cdn.shopify.com/s/files/1/example/products/t-shirt.jpg",
"altText": "Classic Cotton T-Shirt",
"width": 1600,
"height": 1600
},
"tags": "cotton, casual, bestseller",
"product_type": "T-Shirt",
"vendor": "Example Co",
"options": [
{ "id": 123, "name": "Title", "position": 1, "values": ["Default Title"] }
],
"variants": [
{
"variant_id": 48328566276415,
"title": "Default Title",
"display_name": "Classic Cotton T-Shirt - Default Title",
"price": "1025.00",
"compare_at_price": null,
"sku": "",
"position": 1,
"is_in_stock": true,
"available_for_sale": true,
"sellable_online_quantity": 50,
"selected_options": [{ "name": "Title", "value": "Default Title" }]
}
],
"metafields": []
}
]
},
"browsing_history": { "...": "..." },
"purchase_history": { "...": "..." },
"trending": { "...": "..." }
}
}
{
"status": "ok",
"serve_id": "5a3f0d2b-8e4c-4c9f-a062-3d7e1f9c2c88",
"customer": {
"identified": true,
"signals": {
"browsing_history": { "available": true, "count": 6 },
"cart": { "available": true, "count": 1, "source": "pixel" },
"purchase_history": { "available": false, "count": 0 }
}
},
"blocks": {
"cart": {
"recommendation_serve_id": "6b4a1e3c-9f5d-4da0-b173-4e8f2a0d3d99",
"recommendation_type": "bought_together",
"checkpoint": {
"status": "personalized",
"reason": null,
"uses_customer_data": true,
"anchor_product_ids": [9311227904319],
"personalized_count": 10,
"fallback_count": 0,
"filled_from": null
}
},
"browsing_history": {
"recommendation_serve_id": "7c5b2f4d-0a6e-4eb1-8284-5f9a3b1e4eaa",
"recommendation_type": "similar_products",
"checkpoint": {
"status": "partial",
"reason": "insufficient_results",
"uses_customer_data": true,
"anchor_product_ids": [9311228002623, 9311228035391],
"personalized_count": 6,
"fallback_count": 4,
"filled_from": "trending"
}
},
"purchase_history": {
"recommendation_serve_id": "8d6c3a5e-1b7f-4fc2-9395-6a0b4c2f5fbb",
"recommendation_type": "cross_sell",
"checkpoint": {
"status": "fallback",
"reason": "no_customer_data",
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 10,
"filled_from": "trending"
}
},
"trending": {
"recommendation_serve_id": "9e7d4b6f-2c80-4ad3-8406-7b1c5d3a6acc",
"recommendation_type": "trending",
"checkpoint": {
"status": "trending",
"reason": null,
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 0,
"filled_from": null
}
}
}
}
{
"errors": [
{
"message": "one of customer_id, email or phone is required",
"path": [],
"type": "customer.identity",
"context": {
"label": "value",
"value": {
"max_recommendations": 4,
"view": "product_details",
"blocks": ["cart", "browsing_history", "purchase_history", "trending"]
}
}
}
]
}
Get Customer Recommendations
Four recommendation blocks for one known customer, built from their cart, browsing and purchase history, with a checkpoint on each block saying how much of it is personalized.
curl --request POST \
--url https://storefront.glood.ai/api/storefront/v3/headless/recommendations/customer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-shop: <x-shop>' \
--data '
{
"customer_id": "9155793715519",
"email": "shopper@example.com",
"max_recommendations": 4,
"view": "product_ids"
}
'{
"status": "ok",
"serve_id": "4f2e9c1a-7d3b-4b8e-9a51-2c6f0d8e1b77",
"customer": {
"identified": true,
"signals": {
"browsing_history": { "available": true, "count": 6 },
"cart": { "available": true, "count": 1, "source": "pixel" },
"purchase_history": { "available": false, "count": 0 }
}
},
"blocks": {
"cart": {
"recommendation_serve_id": "9a1c2b3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"recommendation_type": "bought_together",
"checkpoint": {
"status": "personalized",
"reason": null,
"uses_customer_data": true,
"anchor_product_ids": [9311227904319],
"personalized_count": 4,
"fallback_count": 0,
"filled_from": null
},
"recommendations": [
{ "product_id": 9311227838783 },
{ "product_id": 9311227871551 },
{ "product_id": 9311227937087 },
{ "product_id": 9311227969855 }
]
},
"browsing_history": {
"recommendation_serve_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"recommendation_type": "similar_products",
"checkpoint": {
"status": "partial",
"reason": "insufficient_results",
"uses_customer_data": true,
"anchor_product_ids": [9311228002623, 9311228035391],
"personalized_count": 2,
"fallback_count": 2,
"filled_from": "trending"
},
"recommendations": [
{ "product_id": 9311228068159 },
{ "product_id": 9311228100927 },
{ "product_id": 9311228264767 },
{ "product_id": 9311228297535 }
]
},
"purchase_history": {
"recommendation_serve_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"recommendation_type": "cross_sell",
"checkpoint": {
"status": "fallback",
"reason": "no_customer_data",
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 4,
"filled_from": "trending"
},
"recommendations": [
{ "product_id": 9311228330303 },
{ "product_id": 9311228363071 },
{ "product_id": 9311228395839 },
{ "product_id": 9311228428607 }
]
},
"trending": {
"recommendation_serve_id": "3d4e5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
"recommendation_type": "trending",
"checkpoint": {
"status": "trending",
"reason": null,
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 0,
"filled_from": null
},
"recommendations": [
{ "product_id": 9311228133695 },
{ "product_id": 9311228166463 },
{ "product_id": 9311228199231 },
{ "product_id": 9311228231999 }
]
}
}
}
{
"status": "ok",
"serve_id": "4f2e9c1a-7d3b-4b8e-9a51-2c6f0d8e1b77",
"customer": { "identified": true, "signals": { "...": "..." } },
"blocks": {
"cart": {
"recommendation_serve_id": "9a1c2b3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"recommendation_type": "bought_together",
"checkpoint": {
"status": "personalized",
"reason": null,
"uses_customer_data": true,
"anchor_product_ids": [9311227904319],
"personalized_count": 1,
"fallback_count": 0,
"filled_from": null
},
"recommendations": [
{
"product_id": 9311227838783,
"title": "Classic Cotton T-Shirt",
"handle": "classic-cotton-t-shirt",
"price": 1025,
"compare_at_price": null,
"image": {
"id": "gid://shopify/ProductImage/123456",
"url": "https://cdn.shopify.com/s/files/1/example/products/t-shirt.jpg",
"altText": "Classic Cotton T-Shirt",
"width": 1600,
"height": 1600
},
"tags": "cotton, casual, bestseller",
"product_type": "T-Shirt",
"vendor": "Example Co",
"options": [
{ "id": 123, "name": "Title", "position": 1, "values": ["Default Title"] }
],
"variants": [
{
"variant_id": 48328566276415,
"title": "Default Title",
"display_name": "Classic Cotton T-Shirt - Default Title",
"price": "1025.00",
"compare_at_price": null,
"sku": "",
"position": 1,
"is_in_stock": true,
"available_for_sale": true,
"sellable_online_quantity": 50,
"selected_options": [{ "name": "Title", "value": "Default Title" }]
}
],
"metafields": []
}
]
},
"browsing_history": { "...": "..." },
"purchase_history": { "...": "..." },
"trending": { "...": "..." }
}
}
{
"status": "ok",
"serve_id": "5a3f0d2b-8e4c-4c9f-a062-3d7e1f9c2c88",
"customer": {
"identified": true,
"signals": {
"browsing_history": { "available": true, "count": 6 },
"cart": { "available": true, "count": 1, "source": "pixel" },
"purchase_history": { "available": false, "count": 0 }
}
},
"blocks": {
"cart": {
"recommendation_serve_id": "6b4a1e3c-9f5d-4da0-b173-4e8f2a0d3d99",
"recommendation_type": "bought_together",
"checkpoint": {
"status": "personalized",
"reason": null,
"uses_customer_data": true,
"anchor_product_ids": [9311227904319],
"personalized_count": 10,
"fallback_count": 0,
"filled_from": null
}
},
"browsing_history": {
"recommendation_serve_id": "7c5b2f4d-0a6e-4eb1-8284-5f9a3b1e4eaa",
"recommendation_type": "similar_products",
"checkpoint": {
"status": "partial",
"reason": "insufficient_results",
"uses_customer_data": true,
"anchor_product_ids": [9311228002623, 9311228035391],
"personalized_count": 6,
"fallback_count": 4,
"filled_from": "trending"
}
},
"purchase_history": {
"recommendation_serve_id": "8d6c3a5e-1b7f-4fc2-9395-6a0b4c2f5fbb",
"recommendation_type": "cross_sell",
"checkpoint": {
"status": "fallback",
"reason": "no_customer_data",
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 10,
"filled_from": "trending"
}
},
"trending": {
"recommendation_serve_id": "9e7d4b6f-2c80-4ad3-8406-7b1c5d3a6acc",
"recommendation_type": "trending",
"checkpoint": {
"status": "trending",
"reason": null,
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 0,
"filled_from": null
}
}
}
}
{
"errors": [
{
"message": "one of customer_id, email or phone is required",
"path": [],
"type": "customer.identity",
"context": {
"label": "value",
"value": {
"max_recommendations": 4,
"view": "product_details",
"blocks": ["cart", "browsing_history", "purchase_history", "trending"]
}
}
}
]
}
Overview
Send who the customer is, and Glood looks up their history server-side and returns four blocks:| Block | Built from | Algorithm |
|---|---|---|
cart | Products in the customer’s cart | Frequently bought together |
browsing_history | Products the customer viewed | Similar products |
purchase_history | Products the customer bought | Cross-sell |
trending | Nothing customer-specific | Trending |
product_ids are needed: each block is anchored on the customer’s own two most recent
products for that signal. This makes the endpoint a fit for marketing emails, CRM and CDP syncs,
account pages, and any surface that knows the customer but not the product they are looking at.
For recommendations around specific products, use Query recommendations.
Every block always comes back filled. When a customer has too little data for a block, Glood
tops it up with trending products, and the block’s checkpoint tells you how
much of it is personalized.
You can ask for only some of the blocks, or for
the checkpoints alone to decide what to show before fetching products.
Identifying the customer
Send at least one of these. A request with none of them is rejected with400.
| Field | Notes |
|---|---|
customer_id | Shopify customer ID, numeric (9155793715519) or GID (gid://shopify/Customer/9155793715519), as a string or a number. |
email | Case and surrounding whitespace are ignored. Also matched against the Shopify customer record and against orders, so guest checkouts are found. |
phone | Formatting is ignored (+1 (555) 010-9999 matches +15550109999). Matched against orders too. |
customer_id whenever you have it. A customer usually browses on several devices, and
customer_id reaches all of them. email alone reaches only the devices where an email was
captured, plus the customer’s orders.email
for one customer and a phone for another would merge both customers’ histories.client_id / user_id are not accepted here (400). For anonymous shoppers, use
Query recommendations.
An identifier that matches nobody is not an error: you get 200 with
customer.identified: false and three blocks filled from trending.
What each signal contains
| Signal | Source |
|---|---|
| Browsing history | Products viewed, across every matched device, newest first. |
| Cart | cart_product_ids if you send it. Otherwise the customer’s add-to-cart history, minus anything bought since. |
| Purchase history | Orders from the last 365 days (cancelled orders excluded), plus purchases tracked on the storefront. |
Sending the live cart
If your storefront knows the current cart, send it ascart_product_ids: up to 10 product IDs,
as an array or a comma-separated string. It replaces Glood’s add-to-cart history, which
cannot see removals. Send [] for an empty cart. Leave the field out only when you don’t know
the cart.
What is never recommended
- Products the customer has bought.
- Products in the customer’s cart.
- Products and tags the merchant excluded in Glood settings.
- A block’s own anchor products.
- The same product twice in one response. Blocks claim products in order:
cart, thenbrowsing_history, thenpurchase_history, thentrending. The trending block shows the shop’s top trending products before any of them are used to top up other blocks.
Choosing blocks
Sendblocks to get only some of the blocks, for example ["cart", "trending"]. Valid names
are cart, browsing_history, purchase_history and trending. Leave it out to get all four.
- The response contains only the blocks you asked for, always in the order above, whatever order you send them in.
- A block you did not ask for is not computed and claims no products. So a block can contain a product that, in a full response, an earlier block would have taken.
- Without
trending, short blocks are topped up from the very top of the trending list. customer.signalsalways reports all three signals.
Checkpoints only
Add?checkpoints_only=true to the URL to get every block’s checkpoint, and customer,
without the products. Each block then has recommendation_serve_id, recommendation_type and
checkpoint only. Use it to decide which blocks to show, or whether a customer has enough data
for a personalized campaign, before you fetch any products.
The checkpoints are the same as in a full response for the same request: Glood still builds
the blocks to count their products. The response is smaller, but the request costs the same.
It combines with blocks.
Context
context is an optional list of free-form labels for where the recommendations will be
shown, for example ["email", "win_back"]: up to 20 strings of up to 200 characters each. It
does not change which products are returned.
Checkpoints
Every block carries acheckpoint:
| Field | Meaning |
|---|---|
status | personalized: every product came from the customer’s data. partial: some did, the rest are trending. fallback: none did, all are trending. trending: the trending block itself. |
reason | Why a block is short of personalized products, or null. no_customer_data: the customer has no usable data for this signal. insufficient_results: there was data, but it produced fewer than max_recommendations products not already shown in an earlier block. error: this block failed and was filled from trending, while the rest of the response is unaffected. |
uses_customer_data | true when at least one product came from the customer’s data. Always false on the trending block. |
anchor_product_ids | The customer’s products this block was computed from (at most 2). |
personalized_count | The first personalized_count entries of recommendations are personalized. |
fallback_count | The remaining entries are trending products. |
filled_from | "trending" when fallback_count > 0, otherwise null. |
customer.signals reports how much history was found for each signal (count, capped at 10),
and customer.signals.cart.source says whether the cart came from your request (request) or
from Glood’s tracking (pixel).
status is personalized), to show only the first personalized_count products,
or to measure how often customers have enough data.Sales channels
Sendpublication_ids to return only products published on those sales channels, as on the
other headless recommendation endpoints. See Filter by Sales Channel.
Errors
| Status | When |
|---|---|
400 | No usable customer_id, email or phone; an unknown field (such as client_id, or publicationIds instead of publication_ids); max_recommendations outside 1–50; more than 10 cart_product_ids; a blocks list that is empty, repeats a block or names an unknown one; a context that is not a list of strings, or has more than 20 entries or one over 200 characters; a publication_ids value the shop has not configured; a checkpoints_only that is not true or false; or the shop has no active plan. |
401 | Missing or invalid storefront token, or missing x-shop. |
429 | Rate limit exceeded for the shop. |
Examples
curl -sS -X POST 'https://storefront.glood.ai/api/storefront/v3/headless/recommendations/customer' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <shop-storefront-token>' \
-H 'x-shop: shop.myshopify.com' \
-d '{
"customer_id": "9155793715519",
"email": "shopper@example.com",
"max_recommendations": 4,
"view": "product_ids"
}'
curl -sS -X POST 'https://storefront.glood.ai/api/storefront/v3/headless/recommendations/customer' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <shop-storefront-token>' \
-H 'x-shop: shop.myshopify.com' \
-d '{
"email": "shopper@example.com",
"cart_product_ids": [9311227838783, 9311227904319],
"max_recommendations": 8
}'
curl -sS -X POST 'https://storefront.glood.ai/api/storefront/v3/headless/recommendations/customer' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <shop-storefront-token>' \
-H 'x-shop: shop.myshopify.com' \
-d '{
"email": "shopper@example.com",
"blocks": ["browsing_history", "trending"],
"context": ["email", "win_back"],
"view": "product_ids"
}'
curl -sS -X POST 'https://storefront.glood.ai/api/storefront/v3/headless/recommendations/customer?checkpoints_only=true' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <shop-storefront-token>' \
-H 'x-shop: shop.myshopify.com' \
-d '{
"customer_id": "9155793715519"
}'
curl -sS -X POST 'https://edge.glood.ai/api/edge/storefront/v3/headless/recommendations/customer' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <shop-storefront-token>' \
-H 'x-shop: shop.myshopify.com' \
-d '{
"customer_id": "9155793715519",
"view": "product_ids"
}'
{
"status": "ok",
"serve_id": "4f2e9c1a-7d3b-4b8e-9a51-2c6f0d8e1b77",
"customer": {
"identified": true,
"signals": {
"browsing_history": { "available": true, "count": 6 },
"cart": { "available": true, "count": 1, "source": "pixel" },
"purchase_history": { "available": false, "count": 0 }
}
},
"blocks": {
"cart": {
"recommendation_serve_id": "9a1c2b3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"recommendation_type": "bought_together",
"checkpoint": {
"status": "personalized",
"reason": null,
"uses_customer_data": true,
"anchor_product_ids": [9311227904319],
"personalized_count": 4,
"fallback_count": 0,
"filled_from": null
},
"recommendations": [
{ "product_id": 9311227838783 },
{ "product_id": 9311227871551 },
{ "product_id": 9311227937087 },
{ "product_id": 9311227969855 }
]
},
"browsing_history": {
"recommendation_serve_id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
"recommendation_type": "similar_products",
"checkpoint": {
"status": "partial",
"reason": "insufficient_results",
"uses_customer_data": true,
"anchor_product_ids": [9311228002623, 9311228035391],
"personalized_count": 2,
"fallback_count": 2,
"filled_from": "trending"
},
"recommendations": [
{ "product_id": 9311228068159 },
{ "product_id": 9311228100927 },
{ "product_id": 9311228264767 },
{ "product_id": 9311228297535 }
]
},
"purchase_history": {
"recommendation_serve_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
"recommendation_type": "cross_sell",
"checkpoint": {
"status": "fallback",
"reason": "no_customer_data",
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 4,
"filled_from": "trending"
},
"recommendations": [
{ "product_id": 9311228330303 },
{ "product_id": 9311228363071 },
{ "product_id": 9311228395839 },
{ "product_id": 9311228428607 }
]
},
"trending": {
"recommendation_serve_id": "3d4e5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
"recommendation_type": "trending",
"checkpoint": {
"status": "trending",
"reason": null,
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 0,
"filled_from": null
},
"recommendations": [
{ "product_id": 9311228133695 },
{ "product_id": 9311228166463 },
{ "product_id": 9311228199231 },
{ "product_id": 9311228231999 }
]
}
}
}
{
"status": "ok",
"serve_id": "4f2e9c1a-7d3b-4b8e-9a51-2c6f0d8e1b77",
"customer": { "identified": true, "signals": { "...": "..." } },
"blocks": {
"cart": {
"recommendation_serve_id": "9a1c2b3d-4e5f-4a6b-8c7d-0e1f2a3b4c5d",
"recommendation_type": "bought_together",
"checkpoint": {
"status": "personalized",
"reason": null,
"uses_customer_data": true,
"anchor_product_ids": [9311227904319],
"personalized_count": 1,
"fallback_count": 0,
"filled_from": null
},
"recommendations": [
{
"product_id": 9311227838783,
"title": "Classic Cotton T-Shirt",
"handle": "classic-cotton-t-shirt",
"price": 1025,
"compare_at_price": null,
"image": {
"id": "gid://shopify/ProductImage/123456",
"url": "https://cdn.shopify.com/s/files/1/example/products/t-shirt.jpg",
"altText": "Classic Cotton T-Shirt",
"width": 1600,
"height": 1600
},
"tags": "cotton, casual, bestseller",
"product_type": "T-Shirt",
"vendor": "Example Co",
"options": [
{ "id": 123, "name": "Title", "position": 1, "values": ["Default Title"] }
],
"variants": [
{
"variant_id": 48328566276415,
"title": "Default Title",
"display_name": "Classic Cotton T-Shirt - Default Title",
"price": "1025.00",
"compare_at_price": null,
"sku": "",
"position": 1,
"is_in_stock": true,
"available_for_sale": true,
"sellable_online_quantity": 50,
"selected_options": [{ "name": "Title", "value": "Default Title" }]
}
],
"metafields": []
}
]
},
"browsing_history": { "...": "..." },
"purchase_history": { "...": "..." },
"trending": { "...": "..." }
}
}
{
"status": "ok",
"serve_id": "5a3f0d2b-8e4c-4c9f-a062-3d7e1f9c2c88",
"customer": {
"identified": true,
"signals": {
"browsing_history": { "available": true, "count": 6 },
"cart": { "available": true, "count": 1, "source": "pixel" },
"purchase_history": { "available": false, "count": 0 }
}
},
"blocks": {
"cart": {
"recommendation_serve_id": "6b4a1e3c-9f5d-4da0-b173-4e8f2a0d3d99",
"recommendation_type": "bought_together",
"checkpoint": {
"status": "personalized",
"reason": null,
"uses_customer_data": true,
"anchor_product_ids": [9311227904319],
"personalized_count": 10,
"fallback_count": 0,
"filled_from": null
}
},
"browsing_history": {
"recommendation_serve_id": "7c5b2f4d-0a6e-4eb1-8284-5f9a3b1e4eaa",
"recommendation_type": "similar_products",
"checkpoint": {
"status": "partial",
"reason": "insufficient_results",
"uses_customer_data": true,
"anchor_product_ids": [9311228002623, 9311228035391],
"personalized_count": 6,
"fallback_count": 4,
"filled_from": "trending"
}
},
"purchase_history": {
"recommendation_serve_id": "8d6c3a5e-1b7f-4fc2-9395-6a0b4c2f5fbb",
"recommendation_type": "cross_sell",
"checkpoint": {
"status": "fallback",
"reason": "no_customer_data",
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 10,
"filled_from": "trending"
}
},
"trending": {
"recommendation_serve_id": "9e7d4b6f-2c80-4ad3-8406-7b1c5d3a6acc",
"recommendation_type": "trending",
"checkpoint": {
"status": "trending",
"reason": null,
"uses_customer_data": false,
"anchor_product_ids": [],
"personalized_count": 0,
"fallback_count": 0,
"filled_from": null
}
}
}
}
{
"errors": [
{
"message": "one of customer_id, email or phone is required",
"path": [],
"type": "customer.identity",
"context": {
"label": "value",
"value": {
"max_recommendations": 4,
"view": "product_details",
"blocks": ["cart", "browsing_history", "purchase_history", "trending"]
}
}
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Shopify store URL
"shop.myshopify.com"
Query Parameters
true returns every block's checkpoint (and customer) without the products: each block has no recommendations. The checkpoints equal those of a full response for the same request; Glood still builds the blocks to count them.
Body
Request body
At least one of customer_id, email or phone is required. Unknown fields (including client_id and user_id) are rejected with 400.
Shopify customer ID, numeric or GID, as a string or a number. Reaches every device the customer used, so send it whenever you have it.
"9155793715519"
Customer email. Case and surrounding whitespace are ignored. Also matched against the Shopify customer record and against orders, so guest checkouts are found.
"shopper@example.com"
Customer phone. Formatting is ignored, so +1 (555) 010-9999 and +15550109999 are equivalent. Also matched against orders.
"+15550109999"
The customer's live cart: up to 10 product IDs, as a JSON array of integers or a comma-separated string. When present it replaces Glood's add-to-cart history, and [] means an empty cart. Omit it only when you don't know the cart.
10[9311227838783, 9311227904319]
Products per block.
1 <= x <= 50Format of each block's recommendations.
product_details, product_ids Optional. The blocks to return. The response contains only these, always in the order cart, browsing_history, purchase_history, trending. A block not asked for is not computed and claims no products in the cross-block dedupe; without trending, short blocks are topped up from the very top of the trending list.
1 - 4 elementscart, browsing_history, purchase_history, trending ["browsing_history", "trending"]
Optional. Free-form labels for where the recommendations will be shown. Does not change which products are returned.
201 - 200["email", "win_back"]
Optional. Numeric Shopify publication (sales channel) ids. When present, only products published on at least one of these channels are returned and the default "published to the Online Store" gate is replaced by this filter; market and B2B filters still apply. A single id may be sent without the array wrapper. Each id must be one the merchant enabled under Settings → Sales channels; unknown ids return 400. The id is the numeric tail of gid://shopify/Publication/.
50^[0-9]+$["30085840999"]
Response
The requested blocks (all four by default), each with a checkpoint
ok Unique identifier for this request
What Glood found about the customer. Email and phone are never echoed.
Show child attributes
Show child attributes
Only the blocks asked for in blocks (all four by default), in this order.
Show child attributes
Show child attributes
Was this page helpful?