Skip to content

Get a menu by reference

GET
/stores/{storeRef}/menus/ref/{ref}
curl --request GET \
--url 'https://apibase.ecomweb.app/api/v1/stores/example/menus/ref/example?include_items=true' \
--header 'x-api-key: <x-api-key>'

Returns the menu with the given ref, with its nested items. Link items that point at a product, collection, blog post, blog category or content page carry that record’s slug and description. When no menu has that reference the response is 200 with an empty body.

Required scopes: read:menus

ref
required
string

The menu’s reference, such as header-menu.

storeRef
required
string

The store’s ref, as returned by GET /stores.

include_items
boolean
default: true

Accepted for compatibility. The menu’s items are returned whatever value is sent.

The menu, or an empty body when no menu has that reference.

Media typeapplication/json
object
deleted_at

When the menu was deleted. Always null on menus you can read.

string
nullable
menu_items

The menu’s top-level items, each with its nested children. Present only when items are included in the response.

Array<object>
object
parent_id

ID of the parent item, or null for a top-level item.

number
nullable
entity_type

What the link points at: product, category, collection, blog_post, blog_category, content_page, search, home, orders, profile or custom. Null for a plain URL.

string
nullable
entity_id

ID of the referenced record, as a string. Null when the link has no target record.

string
nullable
entity_slug

Slug of the referenced record. Filled in for product, collection, blog_post, blog_category and content_page links; absent otherwise.

string
nullable
custom_url

URL for external or custom links. Null when the link points at a record.

string
nullable
target

How the link opens: _self, _blank, _parent or _top.

string
nullable
children
Array<object> recursive
description

Description of the referenced record, filled in together with entity_slug.

string
nullable
id
required

Item ID.

number
menu_id
required

ID of the menu the item belongs to.

number
label
required

Text shown for the link.

string
created_at
required

When the item was created, as an ISO 8601 timestamp.

string
updated_at
required

When the item was last updated, as an ISO 8601 timestamp.

string
id
required

Menu ID.

number
name
required

Menu name.

string
ref
required

Reference used to look the menu up, unique within the store, such as header-menu.

string
created_at
required

When the menu was created, as an ISO 8601 timestamp.

string
updated_at
required

When the menu was last updated, as an ISO 8601 timestamp.

string

Example generated

{
"deleted_at": "example",
"menu_items": [
{
"parent_id": 1,
"entity_type": "example",
"entity_id": "example",
"entity_slug": "example",
"custom_url": "example",
"target": "example",
"children": [],
"description": "example",
"id": 1,
"menu_id": 1,
"label": "example",
"created_at": "example",
"updated_at": "example"
}
],
"id": 1,
"name": "example",
"ref": "example",
"created_at": "example",
"updated_at": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}