MenuItem¶
A MenuItem is a dish or drink of a Menu, in a MenuSection
(partOfMenuSection): the diets it suits (suitableForDiet), its nutrition, and the allergens it contains, of the 14
the EU requires a menu to show. Its price and whether it is available are its Offers (itemOffered), so it
can be ordered with a Cart like any Offer. allergens, spiciness and the links to its menu and section are
ObjectsGrid's, beyond Schema.org, and left out of its JSON-LD document.
Modeled on schema.org/MenuItem · JSON Schema · ABAC object type MenuItem
Example¶
Create one with POST /menuitems:
{
"name": [
{
"at_language": "en",
"at_value": "Onion soup"
}
],
"suitableForDiet": [
"https://schema.org/VegetarianDiet"
],
"allergens": [
"Gluten",
"Milk"
],
"nutrition": {
"calories": "420 kcal",
"servingSize": "300 g"
},
"partOfMenuSection": {
"at_id": "https://apis.objectsgrid.com/menusections/7f8a9b0c-1d2e-4f3a-8b4c-5d6e7f8a9b0c"
}
}
Fields¶
Required: name.
| Field | Type | Required | Description |
|---|---|---|---|
at_context |
https://schema.org |
JSON-LD @context, always https://schema.org. |
|
at_type |
MenuItem |
JSON-LD @type, the object's type name. |
|
at_id |
URL | The object's ObjectsGrid URL, https://apis.objectsgrid.com/<path>/<id>, its JSON-LD @id: what References to it hold. Assigned by ObjectsGrid. |
|
id |
string | The object's id. Assigned by ObjectsGrid when the object is created. | |
identifier |
string | The object's id, as Schema.org identifier. Assigned by ObjectsGrid. |
|
url |
URL | The object's own URL, https://apis.objectsgrid.com/<path>/<id>. Assigned by ObjectsGrid. |
|
name |
list of LanguageTaggedString | Yes | The MenuItem name. See schema.org/name. |
description |
list of LanguageTaggedString | The MenuItem description. See schema.org/description. | |
image |
URL | An image URL | |
position |
integer | Its place in its section, 1 first | |
suitableForDiet |
list of RestrictedDiet | Diets it suits | |
nutrition |
NutritionInformation | Its nutrition per serving | |
allergens |
list of AllergenEnumeration | The allergens it contains, of the EU's 14. ObjectsGrid's, beyond Schema.org: Schema.org has no allergens; left out of JSON-LD documents. | |
spiciness |
integer | How spicy, 0 (not) to 5. ObjectsGrid's, beyond Schema.org: Schema.org has no spiciness; left out of JSON-LD documents. | |
menuAddOn |
list of References to MenuItem or MenuSection | Extras that can be added: other MenuItems, or a MenuSection of them | |
partOfMenu |
Reference to Menu | The Menu it is on, for a dish outside any section. ObjectsGrid's, beyond Schema.org: Schema.org links a menu to its dishes, not back; left out of JSON-LD documents. | |
partOfMenuSection |
Reference to MenuSection | The section it is in. ObjectsGrid's, beyond Schema.org: Schema.org links a section to its dishes, not back; left out of JSON-LD documents. | |
offers |
computed: list of Offer | Its price and availability. Computed, read-only: the objects whose Offer.itemOffered points to this object, listed from that type; never stored or written. | |
tags |
list of Tag | Tags your ABAC policy decides on. Created empty when not sent, kept by a PUT that leaves them out, cleared by null or []. |
|
meta |
ObjectMeta | Read-only metadata: version, type, creation and last update. |
REST API¶
Base URL https://apis.objectsgrid.com. Every request sends the X-ObjectsGrid-AccessPoint and Authorization: Bearer <access token> headers; see the REST API guide.
| Operation | Request |
|---|---|
| Create | POST /menuitems |
| List and search | GET /menuitems |
| Create up to 100 at once | POST /menuitems/batch |
| Retrieve | GET /menuitems/{id} |
| Retrieve as a JSON-LD document for your pages | GET /menuitems/{id} with Accept: application/ld+json; see JSON-LD for your pages |
| Replace | PUT /menuitems/{id} |
| Update some fields | PATCH /menuitems/{id} |
| Delete | DELETE /menuitems/{id} |
The OpenAPI contract, with every parameter and response: MenuItems (JSON).
GraphQL¶
Endpoint POST https://apis.objectsgrid.com/graphql; see the GraphQL guide.
| Operation | Field |
|---|---|
| Query | menuItem(id: ID!, version: String): MenuItem |
| Query | menuItems(where: MenuItemWhereInput, orderBy: [MenuItemOrderByInput!], first: Int, after: String): MenuItemConnection! |
| Query | menuItemsGroupBy(by: [MenuItemGroupByField!]!, where: MenuItemWhereInput, having: MenuItemHavingInput, orderBy: [MenuItemGroupByOrderByInput!], first: Int, after: String): MenuItemGroupByConnection! |
| Mutation | createMenuItem(input: CreateMenuItemInput!): MenuItem! |
| Mutation | updateMenuItem(input: UpdateMenuItemInput!, expectedVersion: String): MenuItem! |
| Mutation | deleteMenuItem(id: ID!, expectedVersion: String): Boolean! |
Webhook events¶
Subscribe to these events in your webhook configuration to be called when a MenuItem changes:
MenuItemCreated, MenuItemUpdated, MenuItemPatched, MenuItemDeleted.