Update Menu
curl --request PUT \
--url https://api.launchmystore.io/api/v1/menus/:id.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"handle": "<string>",
"slug": "<string>",
"url": "<string>",
"menuType": "<string>",
"menuItemType": "<string>",
"child": [
{}
],
"selected": true,
"depth": 123,
"order": 123,
"parentId": "<string>",
"productId": "<string>",
"categoryId": "<string>",
"pageId": "<string>"
}
'import requests
url = "https://api.launchmystore.io/api/v1/menus/:id.json"
payload = {
"name": "<string>",
"handle": "<string>",
"slug": "<string>",
"url": "<string>",
"menuType": "<string>",
"menuItemType": "<string>",
"child": [{}],
"selected": True,
"depth": 123,
"order": 123,
"parentId": "<string>",
"productId": "<string>",
"categoryId": "<string>",
"pageId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
handle: '<string>',
slug: '<string>',
url: '<string>',
menuType: '<string>',
menuItemType: '<string>',
child: [{}],
selected: true,
depth: 123,
order: 123,
parentId: '<string>',
productId: '<string>',
categoryId: '<string>',
pageId: '<string>'
})
};
fetch('https://api.launchmystore.io/api/v1/menus/:id.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/:id.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'handle' => '<string>',
'slug' => '<string>',
'url' => '<string>',
'menuType' => '<string>',
'menuItemType' => '<string>',
'child' => [
[
]
],
'selected' => true,
'depth' => 123,
'order' => 123,
'parentId' => '<string>',
'productId' => '<string>',
'categoryId' => '<string>',
'pageId' => '<string>'
]),
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/:id.json"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"slug\": \"<string>\",\n \"url\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"child\": [\n {}\n ],\n \"selected\": true,\n \"depth\": 123,\n \"order\": 123,\n \"parentId\": \"<string>\",\n \"productId\": \"<string>\",\n \"categoryId\": \"<string>\",\n \"pageId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.launchmystore.io/api/v1/menus/:id.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"slug\": \"<string>\",\n \"url\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"child\": [\n {}\n ],\n \"selected\": true,\n \"depth\": 123,\n \"order\": 123,\n \"parentId\": \"<string>\",\n \"productId\": \"<string>\",\n \"categoryId\": \"<string>\",\n \"pageId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/menus/:id.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"slug\": \"<string>\",\n \"url\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"child\": [\n {}\n ],\n \"selected\": true,\n \"depth\": 123,\n \"order\": 123,\n \"parentId\": \"<string>\",\n \"productId\": \"<string>\",\n \"categoryId\": \"<string>\",\n \"pageId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyMenus
Update Menu
Update an existing navigation menu
PUT
/
api
/
v1
/
menus
/
:id.json
Update Menu
curl --request PUT \
--url https://api.launchmystore.io/api/v1/menus/:id.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"handle": "<string>",
"slug": "<string>",
"url": "<string>",
"menuType": "<string>",
"menuItemType": "<string>",
"child": [
{}
],
"selected": true,
"depth": 123,
"order": 123,
"parentId": "<string>",
"productId": "<string>",
"categoryId": "<string>",
"pageId": "<string>"
}
'import requests
url = "https://api.launchmystore.io/api/v1/menus/:id.json"
payload = {
"name": "<string>",
"handle": "<string>",
"slug": "<string>",
"url": "<string>",
"menuType": "<string>",
"menuItemType": "<string>",
"child": [{}],
"selected": True,
"depth": 123,
"order": 123,
"parentId": "<string>",
"productId": "<string>",
"categoryId": "<string>",
"pageId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
handle: '<string>',
slug: '<string>',
url: '<string>',
menuType: '<string>',
menuItemType: '<string>',
child: [{}],
selected: true,
depth: 123,
order: 123,
parentId: '<string>',
productId: '<string>',
categoryId: '<string>',
pageId: '<string>'
})
};
fetch('https://api.launchmystore.io/api/v1/menus/:id.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/:id.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'handle' => '<string>',
'slug' => '<string>',
'url' => '<string>',
'menuType' => '<string>',
'menuItemType' => '<string>',
'child' => [
[
]
],
'selected' => true,
'depth' => 123,
'order' => 123,
'parentId' => '<string>',
'productId' => '<string>',
'categoryId' => '<string>',
'pageId' => '<string>'
]),
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/:id.json"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"slug\": \"<string>\",\n \"url\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"child\": [\n {}\n ],\n \"selected\": true,\n \"depth\": 123,\n \"order\": 123,\n \"parentId\": \"<string>\",\n \"productId\": \"<string>\",\n \"categoryId\": \"<string>\",\n \"pageId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.launchmystore.io/api/v1/menus/:id.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"slug\": \"<string>\",\n \"url\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"child\": [\n {}\n ],\n \"selected\": true,\n \"depth\": 123,\n \"order\": 123,\n \"parentId\": \"<string>\",\n \"productId\": \"<string>\",\n \"categoryId\": \"<string>\",\n \"pageId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/menus/:id.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"handle\": \"<string>\",\n \"slug\": \"<string>\",\n \"url\": \"<string>\",\n \"menuType\": \"<string>\",\n \"menuItemType\": \"<string>\",\n \"child\": [\n {}\n ],\n \"selected\": true,\n \"depth\": 123,\n \"order\": 123,\n \"parentId\": \"<string>\",\n \"productId\": \"<string>\",\n \"categoryId\": \"<string>\",\n \"pageId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUpdate Menu
Updates an existing navigation menu. Only the fields you supply are changed; everything else is left intact. The request body may be sent flat or wrapped in amenu object.
Request
curl -X PUT "https://api.launchmystore.io/api/v1/menus/a1b2c3d4-0001-4e5f-8a9b-0c1d2e3f4a5b.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Shop",
"handle": "shop",
"url": "/collections/all",
"menuType": "header",
"menuItemType": "category",
"order": 1
}'
const response = await fetch('https://api.launchmystore.io/api/v1/menus/a1b2c3d4-0001-4e5f-8a9b-0c1d2e3f4a5b.json', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Shop',
handle: 'shop',
url: '/collections/all',
menuType: 'header',
menuItemType: 'category',
order: 1
})
});
Path Parameters
The unique menu ID (UUID) to update
Body Parameters
All parameters are optional. Only provided fields are updated. Fields may be sent flat (as below) or nested under a top-levelmenu object.
Menu name
URL-safe handle
URL-safe slug
Destination URL for this menu item
Where the menu is used (e.g.
header, footer)Item resource type (e.g.
page, product, category, customized)Array of nested child menu-item objects (stored as JSON)
Whether the menu item is enabled
Nesting depth (0 for top level)
Sort order within its level
Parent menu ID, or
null for a top-level itemLinked product ID, when
menuItemType is productLinked category ID, when
menuItemType is categoryLinked page ID, when
menuItemType is pageResponse
Returns the standard envelope (status, state, message, data, count, pagination) with the updated menu nested under data.menu.
Example Response
{
"status": 200,
"state": "success",
"message": null,
"data": {
"menu": {
"menuId": "a1b2c3d4-0001-4e5f-8a9b-0c1d2e3f4a5b",
"name": "Shop",
"handle": "shop",
"slug": "shop",
"url": "/collections/all",
"menuType": "header",
"menuItemType": "category",
"child": [],
"selected": true,
"depth": 0,
"order": 1,
"parentId": null,
"productId": null,
"categoryId": "c0ffee00-1111-4222-8333-444455556666",
"pageId": null,
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-03-20T15:30:00.000Z"
}
},
"count": null,
"pagination": null
}
Error Response
When the menu does not exist, the endpoint returns the standard envelope with anerror state:
{
"status": 404,
"state": "error",
"message": "Menu not found",
"data": null
}
Notes
- Changing the handle may affect theme templates that reference menus by handle.
Error Codes
| HTTP Status | Description |
|---|---|
401 | Invalid or missing access token |
403 | App doesn’t have write_content scope |
404 | Menu with the specified ID does not exist |
⌘I