Storefront API
- Authentication
- Account
- Account / Address
- Account / Credit Cards
- Account / Orders
- Order Status
- Cart
- Cart / Line Items
- Cart / Other
- Cart / Coupons
- Checkout
- Checkout / State
- Checkout / Shipments
- Checkout / Payments
- Checkout / Store Credit
- Stripe
- Products
- Vendors
- Stores
- Taxons
- Countries
- CMS Pages
- Menus
- Wishlists
- Wishlists / Wished Items
- Digital Downloads
Platform API
- Authentication
- Addresses
- Adjustments
- Classifications
- CMS Pages
- CMS Sections
- Countries
- Data Feeds
- Digital Links
- Digital Assets
- Line Items
- Menu Items
- Menus
- Option Types
- Option Values
- Orders
- Payment Methods
- Payments
- Products
- Promotion Actions
- Promotion Categories
- Promotion Rules
- Promotions
- Roles
- Shipments
- Shipping Categories
- Shipping Methods
- States
- Stock Items
- Stock Locations
- Store Credit Categories
- Store Credit Types
- Store Credits
- Tax Categories
- Tax Rates
- Taxonomies
- Taxons
- Users
- Variants
- Vendors
- Webhook Events
- Webhook Subscribers
- Wished Items
- Wishlists
- Zones
Create a Menu Item
Creates a Menu Item
curl --request POST \
--url http://{defaultHost}/api/v2/platform/menu_items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"menu_item": {
"name": "T-Shirts",
"code": "MEN-TS",
"subtitle": "Shop men'\''s T-Shirts",
"destination": "https://getvendo.com",
"menu_id": 1,
"new_window": true,
"item_type": "Link",
"linked_resource_type": "URL",
"linked_resource_id": 1
}
}'
{
"data": {
"id": "21",
"type": "menu_item",
"attributes": {
"name": "Link no. 18 To Somewhere",
"subtitle": null,
"destination": null,
"new_window": false,
"item_type": "Link",
"linked_resource_type": "Spree::Linkable::Uri",
"code": null,
"lft": 8,
"rgt": 9,
"depth": 1,
"created_at": "2022-11-08T19:34:24.333Z",
"updated_at": "2022-11-08T19:34:24.336Z",
"link": null,
"is_container": false,
"is_root": false,
"is_child": true,
"is_leaf": true
},
"relationships": {
"icon": {
"data": null
},
"menu": {
"data": {
"id": "3",
"type": "menu"
}
},
"parent": {
"data": {
"id": "17",
"type": "menu_item"
}
},
"linked_resource": {
"data": null
},
"children": {
"data": []
}
}
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
Select which associated resources you would like to fetch, see: <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>
Body
The name of this Menu Item
"T-Shirts"
Specify the ID of the Menu this item belongs to.
1
Give this Menu Item a code to identify this Menu Item from others. This is especially useful when using Container type Menu Items to group items.
"MEN-TS"
Set an optional subtitle for the Menu Item, this is useful if your menu has promotional links that require more than just a link name.
"Shop men's T-Shirts"
Used when the linked_resource_type is set to: URL
"https://getvendo.com"
When set to true
the link will be opened in a new tab or window.
Links are standard links, where as Containers are used to group links.
Link
, Container
Set the type of resource you want to link to, or set to: URL to use the destination field for an external link.
URL
, Spree::Taxon
, Spree::Product
, Spree::CmsPage
The ID of the resource you are linking to.
1
Was this page helpful?
curl --request POST \
--url http://{defaultHost}/api/v2/platform/menu_items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"menu_item": {
"name": "T-Shirts",
"code": "MEN-TS",
"subtitle": "Shop men'\''s T-Shirts",
"destination": "https://getvendo.com",
"menu_id": 1,
"new_window": true,
"item_type": "Link",
"linked_resource_type": "URL",
"linked_resource_id": 1
}
}'
{
"data": {
"id": "21",
"type": "menu_item",
"attributes": {
"name": "Link no. 18 To Somewhere",
"subtitle": null,
"destination": null,
"new_window": false,
"item_type": "Link",
"linked_resource_type": "Spree::Linkable::Uri",
"code": null,
"lft": 8,
"rgt": 9,
"depth": 1,
"created_at": "2022-11-08T19:34:24.333Z",
"updated_at": "2022-11-08T19:34:24.336Z",
"link": null,
"is_container": false,
"is_root": false,
"is_child": true,
"is_leaf": true
},
"relationships": {
"icon": {
"data": null
},
"menu": {
"data": {
"id": "3",
"type": "menu"
}
},
"parent": {
"data": {
"id": "17",
"type": "menu_item"
}
},
"linked_resource": {
"data": null
},
"children": {
"data": []
}
}
}
}