How to
Get brands
Retrieve all available brands for displaying brand navigation, filters, or brand listing pages using Geins Merchant API
Prerequisites
- Merchant API key
Goal
- Display a linked list of all brands for navigation or filtering
- Create a brands page listing all available brands
Architecture at a glance
- Use
brandsquery → Get all brands with details → Display in navigation or listing
APIs used
- Merchant API:
https://merchantapi.geins.io/graphql
Step-by-step
Get all brands
Use the brands query to retrieve all available brands:
Try it out in the GraphQL Playground using the query, headers and variables below.
Request example
query brands(
$channelId: String
$languageId: String
$marketId: String
) {
brands(
channelId: $channelId
languageId: $languageId
marketId: $marketId
) {
name
description
alias
canonicalUrl
primaryImage
}
}
{
"Accept": "application/json",
"X-ApiKey": "{MERCHANT_API_KEY}"
}
{
"channelId": "{CHANNEL_ID}",
"languageId": "{LANGUAGE_ID}",
"marketId": "{MARKET_ID}"
}
curl -X POST https://merchantapi.geins.io/graphql \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-ApiKey: {MERCHANT_API_KEY}" \
-d '{"query":"query brands($channelId: String, $languageId: String, $marketId: String) { brands(channelId: $channelId, languageId: $languageId, marketId: $marketId) { name description alias canonicalUrl primaryImage { url alt } } }","variables":{"channelId":"{CHANNEL_ID}","languageId":"{LANGUAGE_ID}","marketId":"{MARKET_ID}"}}'
The
channelId, languageId, and marketId arguments are optional and can be left out to use default values.Response example
200 OKresponse.json
{
"data": {
"brands": [
{
"name": "Acme",
"description": "Premium quality products since 1950",
"alias": "acme",
"canonicalUrl": "/b/acme",
"primaryImage": "https://cdn.example.com/images/brands/acme-logo.jpg"
},
{
"name": "TechCorp",
"description": "Innovative technology solutions",
"alias": "techcorp",
"canonicalUrl": "/b/techcorp",
"primaryImage": "https://cdn.example.com/images/brands/techcorp-logo.jpg"
}
]
}
}
Multi-market support
The query supports optional parameters for multi-market configurations:
Common pitfalls
- Hardcoding brand URLs - use the
canonicalUrlfield for proper routing
Related
Build product listingFilter productsGet brandsGet productHandle canonical URLsGet product categoriesGet related productsHandle product reviewsSearch productsSort productsTrack product availabilityUse multi-market supportBrands