Skip to main content

Menu

The Menu API returns the store's navigation menus and the nested items inside one menu. Both endpoints are open to anonymous visitors.

All Ajax API requests should use locale-aware URLs to give visitors a consistent experience.

List the navigation menus of the store

GET /{locale}/api/front/menus

List the navigation menus of the store, each with its nested items. Takes no parameters.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/front/menus')
.then((response) => response.json())
.then((data) => {
// do something...
});

Response

    data object[]

    The response payload.

  • Array [
  • idstring

    ID of the navigation menu.

    titlestring

    Name of the navigation menu.

    categorynumber
    children object[]

    Sub-items of this navigation item.

  • Array [
  • idnumber

    ID of the navigation item.

    titlestring

    Label shown for the navigation item.

    origin_typenumber
    typestring

    Type of resource the navigation item links to, for example home, page or collection.

    source_idstring

    ID of the resource the navigation item links to.

    urlstring

    Relative URL the navigation item links to.

    pidnumber

    ID of the parent navigation item; 0 for a top-level item.

    statusnumber
    disablednumber
    targetstring

    Link target of the navigation item, for example _blank to open a new tab.

    url_obj object

    Structured link information of the navigation item.

    typestring

    Type of resource the navigation item links to, for example home, page or collection.

    source_idstring

    ID of the resource the navigation item links to.

    urlstring

    Relative URL the navigation item links to.

    titlestring

    Label shown for the navigation item.

    expandedboolean
  • ]
  • ]
  • msgstring

    Result message returned with the response.

    statenumber

    Request result flag; success or 0 means the request succeeded.

Get a navigation menu

GET /{locale}/api/front/menus/{menu_id}

Get one navigation menu with its nested items. menu_id is the handle of the menu, such as header or footer.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/front/menus/header')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    menu_idstring

    The handle of the menu, such as header.

Response

    data object

    The response payload.

    idstring

    ID of the navigation menu.

    titlestring

    Name of the navigation menu.

    categorynumber
    children object[]

    Sub-items of this navigation item.

  • Array [
  • idnumber

    ID of the navigation item.

    titlestring

    Label shown for the navigation item.

    origin_typenumber
    typestring

    Type of resource the navigation item links to, for example home, page or collection.

    source_idstring

    ID of the resource the navigation item links to.

    urlstring

    Relative URL the navigation item links to.

    pidnumber

    ID of the parent navigation item; 0 for a top-level item.

    statusnumber
    disablednumber
    targetstring

    Link target of the navigation item, for example _blank to open a new tab.

    url_obj object

    Structured link information of the navigation item.

    typestring

    Type of resource the navigation item links to, for example home, page or collection.

    source_idstring

    ID of the resource the navigation item links to.

    urlstring

    Relative URL the navigation item links to.

    titlestring

    Label shown for the navigation item.

    expandedboolean
  • ]
  • msgstring

    Result message returned with the response.

    statenumber

    Request result flag; success or 0 means the request succeeded.