Update Section Settings
curl --request PUT \
--url https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}/settings.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template": "<string>",
"settings": {}
}
'import requests
url = "https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}/settings.json"
payload = {
"template": "<string>",
"settings": {}
}
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({template: '<string>', settings: {}})
};
fetch('https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}/settings.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/themes/{theme_id}/sections/{section_id}/settings.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([
'template' => '<string>',
'settings' => [
]
]),
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/themes/{theme_id}/sections/{section_id}/settings.json"
payload := strings.NewReader("{\n \"template\": \"<string>\",\n \"settings\": {}\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/themes/{theme_id}/sections/{section_id}/settings.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template\": \"<string>\",\n \"settings\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}/settings.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 \"template\": \"<string>\",\n \"settings\": {}\n}"
response = http.request(request)
puts response.read_bodyThemes
Update Section Settings
Change the settings of one section in a template
PUT
/
api
/
v1
/
themes
/
{theme_id}
/
sections
/
{section_id}
/
settings.json
Update Section Settings
curl --request PUT \
--url https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}/settings.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template": "<string>",
"settings": {}
}
'import requests
url = "https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}/settings.json"
payload = {
"template": "<string>",
"settings": {}
}
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({template: '<string>', settings: {}})
};
fetch('https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}/settings.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/themes/{theme_id}/sections/{section_id}/settings.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([
'template' => '<string>',
'settings' => [
]
]),
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/themes/{theme_id}/sections/{section_id}/settings.json"
payload := strings.NewReader("{\n \"template\": \"<string>\",\n \"settings\": {}\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/themes/{theme_id}/sections/{section_id}/settings.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template\": \"<string>\",\n \"settings\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/themes/{theme_id}/sections/{section_id}/settings.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 \"template\": \"<string>\",\n \"settings\": {}\n}"
response = http.request(request)
puts response.read_bodyChanges the settings of one section on a template. Requires the
write_themes scope. The values you send are merged into the section’s
current settings; settings you leave out keep their values.
Request
curl -X PUT "https://api.launchmystore.io/api/v1/themes/1f2e3d4c-5b6a-7980-a1b2-c3d4e5f60718/sections/image-banner/settings.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"template": "index",
"settings": { "heading": "Summer Sale", "button_label": "Shop Collection" }
}'
const response = await fetch('https://api.launchmystore.io/api/v1/themes/1f2e3d4c-5b6a-7980-a1b2-c3d4e5f60718/sections/image-banner/settings.json', {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
template: 'index',
settings: { heading: 'Summer Sale', button_label: 'Shop Collection' }
})
});
Path Parameters
string
required
The theme id.
string
required
The section’s id in the template (the
id from
Template Sections).Body Parameters
string
required
The template the section is on. Templates are named as in the theme’s
templates/ folder: index,
product, product.alternate, customers/account (URL-encode the / in a
path segment), and section groups such as header-group. A path such as
templates/index.json is accepted too. Also accepted as
templatePath, templateName or a ?template= query parameter.object
required
Setting ids mapped to their new values.
Response
The section’s settings after the change are returned underdata.settings.
{
"status": 200,
"state": "success",
"message": null,
"data": {
"success": true,
"message": "Settings saved successfully",
"settings": {
"heading": "Summer Sale",
"button_label": "Shop Collection",
"button_link": "/collections/all"
}
},
"pagination": null
}
Error Codes
| Status | Description |
|---|---|
404 | Theme, template or section not found |
422 | template or settings missing, or an invalid template name |
401 | Invalid or missing access token |
403 | App doesn’t have the write_themes scope |