Create Menu
curl --request POST \
--url https://api.launchmystore.io/api/v1/menus.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"handle": "<string>",
"links": [
{
"title": "<string>",
"url": "<string>",
"type": "<string>",
"resource_id": "<string>",
"links": [
{}
]
}
]
}
'import requests
url = "https://api.launchmystore.io/api/v1/menus.json"
payload = {
"title": "<string>",
"handle": "<string>",
"links": [
{
"title": "<string>",
"url": "<string>",
"type": "<string>",
"resource_id": "<string>",
"links": [{}]
}
]
}
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({
title: '<string>',
handle: '<string>',
links: [
{
title: '<string>',
url: '<string>',
type: '<string>',
resource_id: '<string>',
links: [{}]
}
]
})
};
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([
'title' => '<string>',
'handle' => '<string>',
'links' => [
[
'title' => '<string>',
'url' => '<string>',
'type' => '<string>',
'resource_id' => '<string>',
'links' => [
[
]
]
]
]
]),
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 \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"links\": [\n {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"links\": [\n {}\n ]\n }\n ]\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 \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"links\": [\n {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"links\": [\n {}\n ]\n }\n ]\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 \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"links\": [\n {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"links\": [\n {}\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {}
}Menus
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 '
{
"title": "<string>",
"handle": "<string>",
"links": [
{
"title": "<string>",
"url": "<string>",
"type": "<string>",
"resource_id": "<string>",
"links": [
{}
]
}
]
}
'import requests
url = "https://api.launchmystore.io/api/v1/menus.json"
payload = {
"title": "<string>",
"handle": "<string>",
"links": [
{
"title": "<string>",
"url": "<string>",
"type": "<string>",
"resource_id": "<string>",
"links": [{}]
}
]
}
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({
title: '<string>',
handle: '<string>',
links: [
{
title: '<string>',
url: '<string>',
type: '<string>',
resource_id: '<string>',
links: [{}]
}
]
})
};
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([
'title' => '<string>',
'handle' => '<string>',
'links' => [
[
'title' => '<string>',
'url' => '<string>',
'type' => '<string>',
'resource_id' => '<string>',
'links' => [
[
]
]
]
]
]),
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 \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"links\": [\n {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"links\": [\n {}\n ]\n }\n ]\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 \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"links\": [\n {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"links\": [\n {}\n ]\n }\n ]\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 \"title\": \"<string>\",\n \"handle\": \"<string>\",\n \"links\": [\n {\n \"title\": \"<string>\",\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"links\": [\n {}\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {}
}Create Menu
Creates a new navigation menu in the store.Request
curl -X POST "https://api.launchmystore.io/api/v1/menus.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Footer Navigation",
"handle": "footer",
"links": [
{
"title": "About Us",
"url": "/pages/about-us",
"type": "page"
},
{
"title": "Contact",
"url": "/pages/contact",
"type": "page"
},
{
"title": "Privacy Policy",
"url": "/policies/privacy-policy",
"type": "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({
title: 'Footer Navigation',
handle: 'footer',
links: [
{
title: 'About Us',
url: '/pages/about-us',
type: 'page'
},
{
title: 'Contact',
url: '/pages/contact',
type: 'page'
},
{
title: 'Privacy Policy',
url: '/policies/privacy-policy',
type: 'policy'
}
]
})
});
Body Parameters
The menu title
URL-safe handle. Auto-generated from title if not provided. Common handles include
main-menu, footer, header.Array of menu links
Show Link Object
Show Link Object
Link title/label
Link URL (can be relative or absolute)
Link type:
http, collection, product, page, blog, search, catalog, policyID of linked resource (for collection, product, page, blog types)
Nested child links (same structure). Max 3 levels deep.
Response
Whether the request succeeded
The created menu object with all links
Example Response
{
"success": true,
"data": {
"id": "menu_new789",
"title": "Footer Navigation",
"handle": "footer",
"links": [
{
"id": "link_new001",
"title": "About Us",
"url": "/pages/about-us",
"type": "page",
"resource_id": null,
"position": 1,
"links": []
},
{
"id": "link_new002",
"title": "Contact",
"url": "/pages/contact",
"type": "page",
"resource_id": null,
"position": 2,
"links": []
},
{
"id": "link_new003",
"title": "Privacy Policy",
"url": "/policies/privacy-policy",
"type": "policy",
"resource_id": null,
"position": 3,
"links": []
}
],
"created_at": "2024-03-20T10:00:00Z",
"updated_at": "2024-03-20T10:00:00Z"
}
}
Nested Links Example
Create a menu with dropdown items:{
"title": "Main Menu",
"handle": "main-menu",
"links": [
{
"title": "Shop",
"url": "/collections/all",
"type": "collection",
"links": [
{
"title": "Men",
"url": "/collections/men",
"type": "collection"
},
{
"title": "Women",
"url": "/collections/women",
"type": "collection"
},
{
"title": "Sale",
"url": "/collections/sale",
"type": "collection"
}
]
}
]
}
Error Codes
| Code | Description |
|---|---|
UNAUTHORIZED | Invalid or missing access token |
FORBIDDEN | App doesn’t have write_content scope |
VALIDATION_ERROR | Invalid request body (see error details) |
DUPLICATE_HANDLE | A menu with this handle already exists |
⌘I