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
Adds a link to one of the store’s navigation menus. The request body may be sent flat or wrapped in amenu object.
One record = one link. A store’s menus are built from menu records: every
record is one top-level link, and all records with the same
menuType form
one storefront menu, whose handle is the menuType in lowercase — records
with menuType: "Footer" are the links of linklists.footer in themes.
A record’s child array holds that link’s sub-links. To add a link to an
existing menu, create a record with that menu’s menuType; to remove one,
delete its record.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": "Help",
"handle": "help",
"menuType": "Footer",
"menuItemType": "customized link",
"url": "/pages/help",
"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: 'Help',
handle: 'help',
menuType: 'Footer',
menuItemType: 'customized link',
url: '/pages/help',
child: [
{ name: 'About Us', url: '/pages/about-us' },
{ name: 'Contact', url: '/pages/contact' },
{ name: 'Privacy Policy', url: '/policies/privacy-policy' }
]
})
});
Body Parameters
The menu the link belongs to, e.g.
Header or Footer (the menu’s handle
is this value in lowercase)What the link points to:
page, product, category (a collection),
blog, or customized link (any url)The link’s sub-links (dropdown items), each an object with
name, url
and menuItemType, and its own child for a further level.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": "Help",
"handle": "help",
"menuType": "Footer",
"menuItemType": "customized link",
"url": "/pages/help",
"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
}