Create Menu
curl --request POST \
--url https://api.launchmystore.io/api/v1/menus.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"menuType": "<string>",
"menuItemType": "<string>",
"handle": "<string>",
"url": "<string>",
"child": [
{}
],
"parentId": "<string>",
"order": 123
}
'import requests
url = "https://api.launchmystore.io/api/v1/menus.json"
payload = {
"name": "<string>",
"menuType": "<string>",
"menuItemType": "<string>",
"handle": "<string>",
"url": "<string>",
"child": [{}],
"parentId": "<string>",
"order": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
menuType: '<string>',
menuItemType: '<string>',
handle: '<string>',
url: '<string>',
child: [{}],
parentId: '<string>',
order: 123
})
};
fetch('https://api.launchmystore.io/api/v1/menus.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/menus.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'menuType' => '<string>',
'menuItemType' => '<string>',
'handle' => '<string>',
'url' => '<string>',
'child' => [
[
]
],
'parentId' => '<string>',
'order' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/menus.json"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"handle\": \"<string>\",\n \"url\": \"<string>\",\n \"child\": [\n {}\n ],\n \"parentId\": \"<string>\",\n \"order\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.launchmystore.io/api/v1/menus.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"handle\": \"<string>\",\n \"url\": \"<string>\",\n \"child\": [\n {}\n ],\n \"parentId\": \"<string>\",\n \"order\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/menus.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"handle\": \"<string>\",\n \"url\": \"<string>\",\n \"child\": [\n {}\n ],\n \"parentId\": \"<string>\",\n \"order\": 123\n}"
response = http.request(request)
puts response.read_bodyMenus
Create Menu
Create a new navigation menu
POST
/
api
/
v1
/
menus.json
Create Menu
curl --request POST \
--url https://api.launchmystore.io/api/v1/menus.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"menuType": "<string>",
"menuItemType": "<string>",
"handle": "<string>",
"url": "<string>",
"child": [
{}
],
"parentId": "<string>",
"order": 123
}
'import requests
url = "https://api.launchmystore.io/api/v1/menus.json"
payload = {
"name": "<string>",
"menuType": "<string>",
"menuItemType": "<string>",
"handle": "<string>",
"url": "<string>",
"child": [{}],
"parentId": "<string>",
"order": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
menuType: '<string>',
menuItemType: '<string>',
handle: '<string>',
url: '<string>',
child: [{}],
parentId: '<string>',
order: 123
})
};
fetch('https://api.launchmystore.io/api/v1/menus.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/menus.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'menuType' => '<string>',
'menuItemType' => '<string>',
'handle' => '<string>',
'url' => '<string>',
'child' => [
[
]
],
'parentId' => '<string>',
'order' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/menus.json"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"handle\": \"<string>\",\n \"url\": \"<string>\",\n \"child\": [\n {}\n ],\n \"parentId\": \"<string>\",\n \"order\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.launchmystore.io/api/v1/menus.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"handle\": \"<string>\",\n \"url\": \"<string>\",\n \"child\": [\n {}\n ],\n \"parentId\": \"<string>\",\n \"order\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/menus.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"handle\": \"<string>\",\n \"url\": \"<string>\",\n \"child\": [\n {}\n ],\n \"parentId\": \"<string>\",\n \"order\": 123\n}"
response = http.request(request)
puts response.read_bodyCreate Menu
Creates a new navigation menu in the store. The request body may be sent flat or wrapped in amenu object.
Request
curl -X POST "https://api.launchmystore.io/api/v1/menus.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Footer Navigation",
"handle": "footer",
"menuType": "Footer",
"menuItemType": "page",
"child": [
{ "name": "About Us", "url": "/pages/about-us" },
{ "name": "Contact", "url": "/pages/contact" },
{ "name": "Privacy Policy", "url": "/policies/privacy-policy" }
]
}'
const response = await fetch('https://api.launchmystore.io/api/v1/menus.json', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Footer Navigation',
handle: 'footer',
menuType: 'Footer',
menuItemType: 'page',
child: [
{ name: 'About Us', url: '/pages/about-us' },
{ name: 'Contact', url: '/pages/contact' },
{ name: 'Privacy Policy', url: '/policies/privacy-policy' }
]
})
});
Body Parameters
string
required
The menu name
string
required
The menu placement, e.g.
Header or Footerstring
required
The kind of menu item, e.g.
page, product, category, or a customized
linkstring
URL-safe handle
string
URL for the menu item
array
Array of child menu items (stored as-is). Each item is a free-form object,
typically with
name and url.string
ID of the parent menu, when creating a nested item
integer
default:"0"
Display order
Response
Returns the standard response envelope withstatus 201. The data object
contains a menu property holding the created menu record.
Example Response
{
"status": 201,
"state": "success",
"message": null,
"data": {
"menu": {
"menuId": "3f2a1b0c-9d8e-4f6a-8b7c-1d2e3f4a5b6c",
"name": "Footer Navigation",
"handle": "footer",
"menuType": "Footer",
"menuItemType": "page",
"child": [
{ "name": "About Us", "url": "/pages/about-us" },
{ "name": "Contact", "url": "/pages/contact" },
{ "name": "Privacy Policy", "url": "/policies/privacy-policy" }
],
"selected": true,
"depth": 0,
"order": 0,
"storeId": "9f8e7d6c-5b4a-3210-fedc-ba9876543210",
"createdAt": "2024-03-20T10:00:00.000Z",
"updatedAt": "2024-03-20T10:00:00.000Z"
}
},
"count": null,
"pagination": null
}
Error Response
When a required field is missing:{
"status": 400,
"state": "error",
"message": "Missing required fields: name, menuType, menuItemType",
"data": null
}