Template Sections
curl --request GET \
--url https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.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}/templates/{template}/sections.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.json")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data.sections": [
{
"id": "<string>",
"type": "<string>",
"name": "<string>",
"location": "<string>",
"templatePath": "<string>",
"settings": {},
"blocks": {},
"block_order": [
{}
],
"isMainSection": true
}
]
}Themes
Template Sections
List the sections of a page template
GET
/
api
/
v1
/
themes
/
{theme_id}
/
templates
/
{template}
/
sections.json
Template Sections
curl --request GET \
--url https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.json \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.json"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.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}/templates/{template}/sections.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.json"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.json")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/themes/{theme_id}/templates/{template}/sections.json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data.sections": [
{
"id": "<string>",
"type": "<string>",
"name": "<string>",
"location": "<string>",
"templatePath": "<string>",
"settings": {},
"blocks": {},
"block_order": [
{}
],
"isMainSection": true
}
]
}Template Sections
Lists the sections (modular content blocks) of a page template with their settings. Requires theread_themes scope. Uses the standard response
envelope (status, state, message, data).
Request
curl -X GET "https://api.launchmystore.io/api/v1/themes/1f2e3d4c-5b6a-7980-a1b2-c3d4e5f60718/templates/index/sections.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Path Parameters
Template name:
index, product, collection, page, cart, an
alternate template such as product.alternate, a section group such as
header-group / footer-group, or a URL-encoded path such as
customers%2Faccount. The .json suffix is optional.Response
data.sections is an array of section objects, in render order. Each object
includes the section’s settings, blocks and block order, plus its location.
Besides the template’s own sections, the list includes the sections of the
theme’s section groups: the active header and footer groups, and any other
group (for example an aside or overlay group), whose location is the
group’s type.
Array of section objects
Show Section Object
Show Section Object
Where the section lives:
template, header, footer, or another
section group’s type (e.g. aside, overlay){
"status": 200,
"state": "success",
"message": null,
"data": {
"success": true,
"template": "templates/index.json",
"sections": [
{
"id": "template--homepage__image-banner",
"key": "image-banner",
"type": "image-banner",
"name": "Image banner",
"location": "template",
"templatePath": "templates/index.json",
"settings": {
"heading": "Welcome to our store",
"button_label": "Shop Now",
"button_link": "/collections/all"
},
"blocks": {},
"block_order": [],
"isMainSection": false
},
{
"id": "template--homepage__featured-collection",
"key": "featured-collection",
"type": "featured-collection",
"name": "Featured collection",
"location": "template",
"templatePath": "templates/index.json",
"settings": {
"title": "Featured Products",
"products_to_show": 8
},
"blocks": {},
"block_order": [],
"isMainSection": false
}
]
},
"pagination": null
}
Changing sections
- Update Section Settings —
PUT /themes/{theme_id}/sections/{section_id}/settings.json - Add Section —
POST /themes/{theme_id}/templates/{template}/sections.json - Delete Section —
DELETE /themes/{theme_id}/sections/{section_id}.json
Common Section Types
| Section Type | Description |
|---|---|
image-banner | Hero banner with image and text |
featured-collection | Product grid from collection |
rich-text | Text content block |
image-with-text | Side-by-side image and text |
slideshow | Image carousel |
video | Embedded video |
newsletter | Email signup form |
contact-form | Contact form |
multicolumn | Multiple columns of content |
collage | Image collage layout |
collection-list | Grid of collection cards |
Error Response
Errors return the envelope withstate: "error", a numeric HTTP status, and a
message.
{
"status": 404,
"state": "error",
"message": "Template not found"
}
| Status | Description |
|---|---|
401 | Invalid or missing access token |
403 | App doesn’t have the read_themes scope |
404 | Theme or template not found |
422 | Invalid template name |