Distinguish purchases from visits
This fixture demonstrates the response shape and assistant presentation. It is synthetic, contains no real shopper data, and does not demonstrate live network coverage. Live history returns available interactions for a shopper you are authorized to look up; hashing an email identifies that shopper but does not grant authorization.
Response examples are illustrative unless labelled as a synthetic fixture. They preserve the API envelope but do not represent current availability, measured performance or checkout verification. Example codes cannot be redeemed; example links omit live attribution. Use the URLs returned by your real request.
What to inspect
- type: purchased
- A purchase interaction. Do not infer a product, date, amount or order count: this endpoint returns merchant-level interaction types.
- type: visited
- A browsing interaction; never describe it as a purchase.
- email_sha256
- SHA-256 of the lowercase, trimmed email. This fixture uses a reserved example identity and is not seeded into live lookup.
- items: []
- No returned history. Treat the absence as unavailable context, rather than evidence that the shopper has never bought anything.
Step 1 / GET https://openstock.sh/examples/shopper-history.json
Fetch the synthetic response fixture
This public fixture requires no API key. It contains two purchase interactions and one visit, and is the same fixture used by the demo.
cURL request
curl -fsS 'https://openstock.sh/examples/shopper-history.json'Synthetic fixture response
{
"results": [
{
"query_id": "example-shopper",
"items": [
{
"merchant_id": "01g4s5d0h956te86ff90h6xts4",
"merchant_name": "Brooklinen",
"type": "purchased"
},
{
"merchant_id": "01g4s5dc138qsnh4egsjys8g9c",
"merchant_name": "Everlane",
"type": "purchased"
},
{
"merchant_id": "01g4s4gvb1kdc8kz69cm5q2b4f",
"merchant_name": "NIKE",
"type": "visited"
}
]
}
]
}Step 2 / POST /v1/shoppers/history
Understand the live request contract
The example hash is not a seeded live shopper. An unknown shopper returns an empty items array, as illustrated here. For an authorized real lookup, substitute the correctly normalized email hash; do not send the raw address.
Set OPENSTOCK_API_KEY in your environment before running this request.
cURL request
curl -sS -X POST 'https://api.openstock.sh/v1/shoppers/history' \
-H "Authorization: Bearer $OPENSTOCK_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"queries":[{"query_id":"example-shopper","email_sha256":"3a32f737ca25fb3d367dd3c8aaa91e9bf73f31445b0377a8de073eb33276dcb8"}]}'Request JSON
{
"queries": [
{
"query_id": "example-shopper",
"email_sha256": "3a32f737ca25fb3d367dd3c8aaa91e9bf73f31445b0377a8de073eb33276dcb8"
}
]
}Illustrative full response
{
"results": [
{
"query_id": "example-shopper",
"items": []
}
]
}