MenuQL

MenuQL is MENU's proprietary menu query language. It was developed to offer a performant and efficient way to pull the menu. Using MenuQL you can specify which types of resources and specific attributes that you want to query. MenuQL also allows you to apply custom attribute filters and sorting, as well as to paginate results for a best-in-class menu experience.

To enable MenuQL (Query Builder), you need to send the X-QB-ENABLED HTTP header as true for all of your menu API calls.

Available query parameters

Parameter Value Repeatable Description
page integer FALSE

Sets the page number of the queried results.
If the requested page does not exist, it will use the default value.

Default value: 1.

Allowed values: any integer larger than 0.

Example:
page=2 will return the second page of the queried results.

per_page integer FALSE

Sets the number of items to be returned per page of the queried results.

Default value: 20.

Allowed values: any integer larger than 0.

Example:
per_page=10 will return 10 items per page of the queried results.

paginated_results boolean FALSE

If this parameter is included in the query and has value set to false, it will remove the pagination from the queried results and returns the collection of all items.

Default value: true.

Allowed values: true, false.

Example:
paginated_results=false if used in the API calls that fetch list of results (calls not ending with the ID), will fetch list of all items without the pagination.
NOTE: in contrast the API call ending with the ID, which will fetch the specific item, is never paginated and this parameter in that case is obsolete.

include string
array
FALSE

Includes the attribute(s) (attribute_name) in the response for the given entity object(s).
Value can be a simple string (e.g. description; core_subcategories.core_items|name) or an array presented as comma separated string - list (e.g. introduction,translations,name; core_items|state;price_by_order_type).
If the value is an array, it means that multiple attributes will be added to the queried results.
Including the entity's relation (nesting) is also possible by providing the relation_name in the include query parameter.
Including the relation's attribute is done by further concatenating the attribute_name (after the relation_name) with the | (pipe) character.
Including multiple relation's attibutes is done by separating (concatenating) them with the ; (semi-colon) character.

Default value: id (or other entity's identifier).

Allowed values: defined for each entity specificly.

Example:
include=translations,subcategories.image,image will return the queried results with included attribute translations for the 1st level entity, and its relations subcategories for the 1st level entity and image for both the 1st and 2nd level (subcategories in this case) entities.

sort[attribute_name] string TRUE

Sorts the queried results by the attribute_name in the given arrangement.
If requested entity has some relation and it is included via the include query parameter, it is possible to sort results in that relation object by providing the relation_name before the attribute_name in the sort query parameter concatenated with the . (dot) character.

Allowed attributes: defined for each entity specificly.

Allowed values: asc, desc.

Example:
sort[id]=asc will order the queried results by the ID of the first level entities (usually the ones that the end of API call URL is ending with, e.g. ../categories meaning Category is the first level entity) in the ascending arrangement.
And if you want to sort any included relation:
sort[core_items.name]=asc.

filter[attribute_name] boolean
integer
string
array
TRUE

Filters out the queried results by the attribute_name and its given value.
Value can be a boolean, an integer, a simple string (e.g. burger; cheese+burger) or an array presented as comma separated string - list (e.g. ec1,ec2,ec3).
If the value is an array, it means that the queried results would be filtered by the attribute_name where its value can be equal to or contain any of the provided ones.
Filtering by the entity's relation is possible by providing the relation_name before the attribute_name in the filter query parameter concatenated with the . (dot) character.

Allowed attributes: defined for each entity specificly.

Allowed values: any.

Example:
filter[is_visible]=true will return only the queried results where is_visible attribute's value is set to true.