publicCategories
Public: no authentication required.
Returns a seller's category tree for the public storefront. Needs no sign-in. An unknown subdomain gives an empty list.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query PublicCategories($subdomain: String!) {
publicCategories(subdomain: $subdomain) {
id
code
name
description
imageUrl
level
children {
id
code
name
description
imageUrl
level
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query PublicCategories($subdomain: String!) {\n publicCategories(subdomain: $subdomain) {\n id\n code\n name\n description\n imageUrl\n level\n children {\n id\n code\n name\n description\n imageUrl\n level\n }\n }\n}",
"variables": {
"subdomain": "string"
}
}
EOF
Variables:
{
"subdomain": "string"
}
Response:
{
"data": {
"publicCategories": [
{
"id": "id",
"code": "string",
"name": "string",
"description": "string",
"imageUrl": "string",
"level": 0,
"children": [
{
"id": "id",
"code": "string",
"name": "string",
"description": "string",
"imageUrl": "string",
"level": 0
}
]
}
]
}
}
publicCategories(
subdomain: String!
): [CustomerCategory!]!
Arguments
publicCategories.subdomain ● String! non-null scalar
The seller's storefront subdomain.
Type
CustomerCategory object
A category a customer can shop.