Reference
Page blocks and SEO
Every store page block, template and search setting, with fields, limits, default values and complete examples for the API and AI tools.
Build it in one request
One POST /v2/store/build request can save your store's look, search settings and pages, with its products. It saves everything or nothing. AI tools can do the same with build_store.
| Part | If it is already there |
|---|---|
pages | Kept, and never changed, even if its address is different now. New pages are always private drafts. If you deleted a page, it is added again |
branding | Kept if the store already has a look, logo or colour |
seo | Kept if the store already has search settings |
| Everything else | Updated to match what you send |
In the answer, design says what was saved, created or kept. It also has each page's id, version and private preview_url. To change something that was kept, use its own request in the store API.
Put theme_color and logo in branding. If you send branding, they cannot also be in settings. You can add up to 20 pages at a time, and each needs a slug. The request can be up to 1 MB.
Ask before you change an open store
| Language | What you need |
|---|---|
| JavaScript | Node.js 22 or later |
| TypeScript | Node.js 22.18 or later, which can run TypeScript without other tools |
| Python | Python 3.9 or later |
| cURL | Bash and curl 7.76 or later. connect.sh also needs jq |
Choose a language once, and every sample in the docs will use it, if it can. There is nothing else to install. The commands are for macOS and Linux. On Windows, use WSL. cURL can't run a web server or check a webhook's signature, so those samples start with JavaScript if you chose cURL.
// Adds a look, search settings and page drafts to your Switro store.
// Customers cannot see the pages until you publish them. Running it again adds
// no copies, and never changes a look, search settings or pages you already have.
// If the store is open, its settings, categories, new look and new search
// settings show straight away.
// It needs an API v2 key with the store:read and store:write permissions.
// Check each preview. To publish a page, use its ID and version:
// node build-pages.mjs --publish PAGE_ID VERSION
const API = process.env.SWITRO_API_URL ?? "https://www.switro.com/api";
const store = {
settings: {
name: "Sample Goods",
slug: "sample-goods",
contact_email: "hello@example.com",
},
categories: [
{
slug: "kitchen",
name: "Kitchen",
seo_title: "Kitchen goods | Sample Goods",
seo_description: "Mugs and bottles for your kitchen, from Sample Goods.",
},
],
branding: {
theme: "boutique",
announcement: "Pay with USDC or SOL",
announcement_link: "/shop",
},
seo: {
title: "Sample Goods | Mugs and bottles",
description: "Shop mugs and bottles from Sample Goods. Pay with USDC or SOL on Solana.",
keywords: ["mugs", "bottles"],
},
pages: [
{
slug: "home",
title: "Home",
is_home: true,
seo: {
title: "Sample Goods | Mugs and bottles",
description: "Shop mugs and bottles, and pay with USDC or SOL on Solana.",
},
blocks: [
{
type: "Hero",
props: {
title: "Mugs and bottles for every day",
text: "Choose one for home, work or a trip.",
button_text: "Shop now",
button_link: "/shop",
layout: "center",
background: "soft",
space: "large",
},
},
{
type: "Products",
props: { title: "Kitchen", category: "kitchen", count: 4, sort: "newest" },
},
{
type: "Steps",
props: {
title: "How to order",
items: [
{ title: "Choose", text: "Add what you like to your cart." },
{ title: "Pay", text: "Use USDC or SOL from your Solana wallet." },
],
},
},
{
type: "Banner",
props: {
title: "Find your next mug",
button_text: "See all products",
button_link: "/shop",
background: "accent",
align: "center",
},
},
],
},
{
slug: "about",
title: "About us",
menu: "footer",
seo: {
title: "About Sample Goods",
description: "What Sample Goods sells, and how to contact us.",
},
blocks: [
{
type: "Text",
props: {
text: "## What we sell\n\nMugs and bottles for **every day**. See [all our products](/shop).",
width: "narrow",
},
},
{
type: "Columns",
props: {
split: "even",
first: [
{
type: "Faq",
props: {
title: "Payment",
items: [
{
question: "How can I pay?",
answer: "Use USDC or SOL on Solana, from a Solana wallet.",
},
],
},
},
],
second: [
{
type: "Contact",
props: { title: "Contact us", text: "Email us with any questions." },
},
],
},
},
],
},
],
};
async function post(path, body) {
const response = await fetch(`${API}/v2/store/${path}`, {
method: "POST",
redirect: "error",
headers: {
Authorization: `Bearer ${process.env.SWITRO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
const data = await response.json();
if (!response.ok) throw new Error(`Switro answered ${response.status}: ${data.message}`);
return data;
}
const [action, pageId, version] = process.argv.slice(2);
if (action === "--publish") {
if (!pageId || !version) throw new Error("Add the page's ID and version");
const page = await post(`pages/${encodeURIComponent(pageId)}/publish`, {
version: Number(version),
});
console.log(`The page is live, if your store is open: ${page.url}`);
} else {
const { design, network } = await post("build", store);
console.log(`Your ${network} store. Look: ${design.branding}. Search settings: ${design.seo}.`);
for (const page of design.pages) {
console.log(`${page.slug}: ${page.result}, ID ${page.id}, version ${page.version}`);
// Private. Anyone with this link can see the draft for an hour.
console.log(` Preview: ${page.preview_url}`);
}
}// Adds a look, search settings and page drafts to your Switro store.
// Customers cannot see the pages until you publish them. Running it again adds
// no copies, and never changes a look, search settings or pages you already have.
// If the store is open, its settings, categories, new look and new search
// settings show straight away.
// It needs an API v2 key with the store:read and store:write permissions.
// Check each preview. To publish a page, use its ID and version:
// node build-pages.mts --publish PAGE_ID VERSION
interface BuildAnswer {
design: {
branding: string;
pages: { id: string; preview_url: string; result: string; slug: string; version: number }[];
seo: string;
};
network: string;
}
const API = process.env.SWITRO_API_URL ?? "https://www.switro.com/api";
const store = {
settings: {
name: "Sample Goods",
slug: "sample-goods",
contact_email: "hello@example.com",
},
categories: [
{
slug: "kitchen",
name: "Kitchen",
seo_title: "Kitchen goods | Sample Goods",
seo_description: "Mugs and bottles for your kitchen, from Sample Goods.",
},
],
branding: {
theme: "boutique",
announcement: "Pay with USDC or SOL",
announcement_link: "/shop",
},
seo: {
title: "Sample Goods | Mugs and bottles",
description: "Shop mugs and bottles from Sample Goods. Pay with USDC or SOL on Solana.",
keywords: ["mugs", "bottles"],
},
pages: [
{
slug: "home",
title: "Home",
is_home: true,
seo: {
title: "Sample Goods | Mugs and bottles",
description: "Shop mugs and bottles, and pay with USDC or SOL on Solana.",
},
blocks: [
{
type: "Hero",
props: {
title: "Mugs and bottles for every day",
text: "Choose one for home, work or a trip.",
button_text: "Shop now",
button_link: "/shop",
layout: "center",
background: "soft",
space: "large",
},
},
{
type: "Products",
props: { title: "Kitchen", category: "kitchen", count: 4, sort: "newest" },
},
{
type: "Steps",
props: {
title: "How to order",
items: [
{ title: "Choose", text: "Add what you like to your cart." },
{ title: "Pay", text: "Use USDC or SOL from your Solana wallet." },
],
},
},
{
type: "Banner",
props: {
title: "Find your next mug",
button_text: "See all products",
button_link: "/shop",
background: "accent",
align: "center",
},
},
],
},
{
slug: "about",
title: "About us",
menu: "footer",
seo: {
title: "About Sample Goods",
description: "What Sample Goods sells, and how to contact us.",
},
blocks: [
{
type: "Text",
props: {
text: "## What we sell\n\nMugs and bottles for **every day**. See [all our products](/shop).",
width: "narrow",
},
},
{
type: "Columns",
props: {
split: "even",
first: [
{
type: "Faq",
props: {
title: "Payment",
items: [
{
question: "How can I pay?",
answer: "Use USDC or SOL on Solana, from a Solana wallet.",
},
],
},
},
],
second: [
{
type: "Contact",
props: { title: "Contact us", text: "Email us with any questions." },
},
],
},
},
],
},
],
};
async function post<T>(path: string, body: object): Promise<T> {
const response = await fetch(`${API}/v2/store/${path}`, {
method: "POST",
redirect: "error",
headers: {
Authorization: `Bearer ${process.env.SWITRO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
const data = (await response.json()) as T & { message?: string | string[] };
if (!response.ok) throw new Error(`Switro answered ${response.status}: ${data.message}`);
return data;
}
const [action, pageId, version] = process.argv.slice(2);
if (action === "--publish") {
if (!pageId || !version) throw new Error("Add the page's ID and version");
const page = await post<{ url: string }>(`pages/${encodeURIComponent(pageId)}/publish`, {
version: Number(version),
});
console.log(`The page is live, if your store is open: ${page.url}`);
} else {
const { design, network } = await post<BuildAnswer>("build", store);
console.log(`Your ${network} store. Look: ${design.branding}. Search settings: ${design.seo}.`);
for (const page of design.pages) {
console.log(`${page.slug}: ${page.result}, ID ${page.id}, version ${page.version}`);
// Private. Anyone with this link can see the draft for an hour.
console.log(` Preview: ${page.preview_url}`);
}
}# Adds a look, search settings and page drafts to your Switro store.
# Customers cannot see the pages until you publish them. Running it again adds
# no copies, and never changes a look, search settings or pages you already have.
# If the store is open, its settings, categories, new look and new search
# settings show straight away.
# It needs an API v2 key with the store:read and store:write permissions.
# Check each preview. To publish a page, use its ID and version:
# python3 build_pages.py --publish PAGE_ID VERSION
import json
import os
import sys
import urllib.error
import urllib.parse
import urllib.request
API = os.environ.get("SWITRO_API_URL", "https://www.switro.com/api")
STORE = {
"settings": {
"name": "Sample Goods",
"slug": "sample-goods",
"contact_email": "hello@example.com",
},
"categories": [
{
"slug": "kitchen",
"name": "Kitchen",
"seo_title": "Kitchen goods | Sample Goods",
"seo_description": "Mugs and bottles for your kitchen, from Sample Goods.",
},
],
"branding": {
"theme": "boutique",
"announcement": "Pay with USDC or SOL",
"announcement_link": "/shop",
},
"seo": {
"title": "Sample Goods | Mugs and bottles",
"description": "Shop mugs and bottles from Sample Goods. Pay with USDC or SOL on Solana.",
"keywords": ["mugs", "bottles"],
},
"pages": [
{
"slug": "home",
"title": "Home",
"is_home": True,
"seo": {
"title": "Sample Goods | Mugs and bottles",
"description": "Shop mugs and bottles, and pay with USDC or SOL on Solana.",
},
"blocks": [
{
"type": "Hero",
"props": {
"title": "Mugs and bottles for every day",
"text": "Choose one for home, work or a trip.",
"button_text": "Shop now",
"button_link": "/shop",
"layout": "center",
"background": "soft",
"space": "large",
},
},
{
"type": "Products",
"props": {
"title": "Kitchen",
"category": "kitchen",
"count": 4,
"sort": "newest",
},
},
{
"type": "Steps",
"props": {
"title": "How to order",
"items": [
{
"title": "Choose",
"text": "Add what you like to your cart.",
},
{
"title": "Pay",
"text": "Use USDC or SOL from your Solana wallet.",
},
],
},
},
{
"type": "Banner",
"props": {
"title": "Find your next mug",
"button_text": "See all products",
"button_link": "/shop",
"background": "accent",
"align": "center",
},
},
],
},
{
"slug": "about",
"title": "About us",
"menu": "footer",
"seo": {
"title": "About Sample Goods",
"description": "What Sample Goods sells, and how to contact us.",
},
"blocks": [
{
"type": "Text",
"props": {
"text": "## What we sell\n\nMugs and bottles for **every day**. See [all our products](/shop).",
"width": "narrow",
},
},
{
"type": "Columns",
"props": {
"split": "even",
"first": [
{
"type": "Faq",
"props": {
"title": "Payment",
"items": [
{
"question": "How can I pay?",
"answer": "Use USDC or SOL on Solana, from a Solana wallet.",
},
],
},
},
],
"second": [
{
"type": "Contact",
"props": {
"title": "Contact us",
"text": "Email us with any questions.",
},
},
],
},
},
],
},
],
}
class NoRedirects(urllib.request.HTTPRedirectHandler):
"""Never sends the API key to another address."""
def redirect_request(self, *args):
return None
open_url = urllib.request.build_opener(NoRedirects).open
def post(path, body):
request = urllib.request.Request(
f"{API}/v2/store/{path}",
method="POST",
data=json.dumps(body).encode(),
headers={
"Authorization": f"Bearer {os.environ['SWITRO_API_KEY']}",
"Content-Type": "application/json",
},
)
try:
with open_url(request, timeout=60) as response:
return json.load(response)
except urllib.error.HTTPError as error:
sys.exit(f"Switro answered {error.code}: {error.read().decode()}")
if "--publish" in sys.argv:
if len(sys.argv) != 4:
sys.exit("Add the page's ID and version")
page_id = urllib.parse.quote(sys.argv[2], safe="")
page = post(f"pages/{page_id}/publish", {"version": int(sys.argv[3])})
print(f"The page is live, if your store is open: {page['url']}")
else:
answer = post("build", STORE)
design = answer["design"]
print(f"Your {answer['network']} store. Look: {design['branding']}. Search settings: {design['seo']}.")
for page in design["pages"]:
print(f"{page['slug']}: {page['result']}, ID {page['id']}, version {page['version']}")
# Private. Anyone with this link can see the draft for an hour.
print(f" Preview: {page['preview_url']}")#!/usr/bin/env bash
# Adds a look, search settings and page drafts to your Switro store.
# Customers cannot see the pages until you publish them. Running it again adds
# no copies, and never changes a look, search settings or pages you already have.
# If the store is open, its settings, categories, new look and new search
# settings show straight away.
# It needs an API v2 key with the store:read and store:write permissions.
# Check each preview. To publish a page, use its ID and version:
# bash build-pages.sh --publish PAGE_ID VERSION
set -euo pipefail
API="${SWITRO_API_URL:-https://www.switro.com/api}"
: "${SWITRO_API_KEY:?Load your API key first}"
post() {
curl --silent --show-error --fail-with-body --max-time 60 "$API/v2/store/$1" \
-H "Authorization: Bearer $SWITRO_API_KEY" \
-H "Content-Type: application/json" \
--data @-
echo
}
if [[ "${1:-}" == "--publish" ]]; then
if [[ ! "${2:-}" =~ ^[0-9a-f-]{36}$ || ! "${3:-}" =~ ^[0-9]+$ ]]; then
echo "Add the page's ID and version" >&2
exit 1
fi
echo "{ \"version\": $3 }" | post "pages/$2/publish"
exit
fi
# In the answer, "design" has each page's ID, version and private preview_url.
post build <<'JSON'
{
"settings": {
"name": "Sample Goods",
"slug": "sample-goods",
"contact_email": "hello@example.com"
},
"categories": [
{
"slug": "kitchen",
"name": "Kitchen",
"seo_title": "Kitchen goods | Sample Goods",
"seo_description": "Mugs and bottles for your kitchen, from Sample Goods."
}
],
"branding": {
"theme": "boutique",
"announcement": "Pay with USDC or SOL",
"announcement_link": "/shop"
},
"seo": {
"title": "Sample Goods | Mugs and bottles",
"description": "Shop mugs and bottles from Sample Goods. Pay with USDC or SOL on Solana.",
"keywords": ["mugs", "bottles"]
},
"pages": [
{
"slug": "home",
"title": "Home",
"is_home": true,
"seo": {
"title": "Sample Goods | Mugs and bottles",
"description": "Shop mugs and bottles, and pay with USDC or SOL on Solana."
},
"blocks": [
{
"type": "Hero",
"props": {
"title": "Mugs and bottles for every day",
"text": "Choose one for home, work or a trip.",
"button_text": "Shop now",
"button_link": "/shop",
"layout": "center",
"background": "soft",
"space": "large"
}
},
{
"type": "Products",
"props": {
"title": "Kitchen",
"category": "kitchen",
"count": 4,
"sort": "newest"
}
},
{
"type": "Steps",
"props": {
"title": "How to order",
"items": [
{ "title": "Choose", "text": "Add what you like to your cart." },
{
"title": "Pay",
"text": "Use USDC or SOL from your Solana wallet."
}
]
}
},
{
"type": "Banner",
"props": {
"title": "Find your next mug",
"button_text": "See all products",
"button_link": "/shop",
"background": "accent",
"align": "center"
}
}
]
},
{
"slug": "about",
"title": "About us",
"menu": "footer",
"seo": {
"title": "About Sample Goods",
"description": "What Sample Goods sells, and how to contact us."
},
"blocks": [
{
"type": "Text",
"props": {
"text": "## What we sell\n\nMugs and bottles for **every day**. See [all our products](/shop).",
"width": "narrow"
}
},
{
"type": "Columns",
"props": {
"split": "even",
"first": [
{
"type": "Faq",
"props": {
"title": "Payment",
"items": [
{
"question": "How can I pay?",
"answer": "Use USDC or SOL on Solana, from a Solana wallet."
}
]
}
}
],
"second": [
{
"type": "Contact",
"props": {
"title": "Contact us",
"text": "Email us with any questions."
}
}
]
}
}
]
}
]
}
JSONGet an API v2 key with store:read and store:write, and save it in store.env. Then run:
node --env-file=store.env build-pages.mjsnode --env-file=store.env build-pages.mts(set -a; . ./store.env; python3 build_pages.py)(set -a; . ./store.env; bash build-pages.sh)When the owner has approved a page's preview, publish that version:
node --env-file=store.env build-pages.mjs --publish PAGE_ID VERSIONnode --env-file=store.env build-pages.mts --publish PAGE_ID VERSION(set -a; . ./store.env; python3 build_pages.py --publish PAGE_ID VERSION)(set -a; . ./store.env; bash build-pages.sh --publish PAGE_ID VERSION)Rules for pages
list_page_options.Permission: store:read
- A page can have up to 100 blocks, with those inside columns.
- Each block is { "type": "...", "props": { ... } }. Names and values must match exactly. A field that is not listed is refused, and nothing is saved.
- A field that is left out uses its default. Sending blocks replaces every block on the page, so send each one you want to keep, with its id.
- New blocks do not need an id. Switro adds one.
- Replace all example text with facts from the seller, and every REPLACE with a real value. Leave out a block if you do not have what it needs. Never make up reviews, numbers, policies, prices or claims.
| Type | What it accepts |
|---|---|
text | One line of text. HTML is shown as text. |
textarea | Text with more than one line. HTML is shown as text. Formatting only works if the field says so. |
choice | Exactly one of the listed values, as text. |
number | A whole number. |
image | The path of an image uploaded to Switro, such as /static/images/a.png, or empty. Never another website. |
link | Starts with /, #, https://, mailto: or tel:, with up to 500 characters and no spaces. Or empty. |
video | The https address of a YouTube or Vimeo video, or empty. |
category | The slug of a category in this store, or empty for every product. |
list | A list of items. Each one only has the fields under "item". |
blocks | A list of blocks, the same as a page. It cannot have Columns. |
Every block except Spacer also has these fields:
| Field | Required | What it is |
|---|---|---|
background | No | Background. choice: none, soft, accent, dark. Default: "none" |
space | No | Space above and below. choice: medium, none, small, large. Default: "medium" |
width | No | Width. choice: normal, narrow, full. Default: "normal" |
Blocks: Top of page
Hero: Hero
A large heading with a button and an optional picture. Best as the first block.
| Field | Required | What it is |
|---|---|---|
eyebrow | No | Small text above. text, up to 60 characters. Default: empty |
title | No | Heading. text, up to 120 characters. Default: empty |
text | No | Text. textarea, up to 400 characters. Default: empty |
button_text | No | Button text. text, up to 40 characters. Default: empty |
button_link | No | Button link. link. Default: empty. A page in your store, such as /shop or /pages/about, or a full https address. |
second_text | No | Second button text. text, up to 40 characters. Default: empty |
second_link | No | Second button link. link. Default: empty. A page in your store, such as /shop or /pages/about, or a full https address. |
image | No | Picture. image. Default: empty |
alt | No | Describe the picture. text, up to 200 characters. Default: empty. For people who cannot see it, and for search. Leave it empty if it is only decoration. |
layout | No | Layout. choice: split, center, cover. Default: "split" |
{
"type": "Hero",
"props": {
"title": "Made to last",
"text": "Say what you sell, and why people like it.",
"button_text": "Shop now",
"button_link": "/shop"
}
}Banner: Call to action
A short message with one clear button.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
text | No | Text. textarea, up to 300 characters. Default: empty |
button_text | No | Button text. text, up to 40 characters. Default: empty |
button_link | No | Button link. link. Default: empty. A page in your store, such as /shop or /pages/about, or a full https address. |
align | No | Line up. choice: start, center. Default: "start" |
{
"type": "Banner",
"props": {
"title": "Ready to order?",
"text": "Find the right one for you.",
"button_text": "See all products",
"button_link": "/shop",
"background": "accent",
"align": "center"
}
}Blocks: Text
Heading: Heading
A heading on its own.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
text | No | Text below. textarea, up to 300 characters. Default: empty |
level | No | Size. choice: h2, h3. Default: "h2" |
align | No | Line up. choice: start, center. Default: "start" |
{
"type": "Heading",
"props": {
"title": "A new section"
}
}Text: Text
Paragraphs, lists, links and headings.
| Field | Required | What it is |
|---|---|---|
text | No | Text. textarea, up to 20,000 characters. Default: empty. Leave an empty line between paragraphs. **bold**, [link](/shop), - for a list and ## for a heading also work. |
align | No | Line up. choice: start, center. Default: "start" |
{
"type": "Text",
"props": {
"text": "Write your text here.",
"width": "narrow"
}
}Quote: Quotes
Real words from real customers. Never make these up.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
items | No | Quotes. list, up to 12 items |
items[].text | No | Quote. textarea, up to 500 characters. Default: empty |
items[].name | No | Name. text, up to 80 characters. Default: empty |
items[].detail | No | About them. text, up to 80 characters. Default: empty |
{
"type": "Quote",
"props": {
"title": "What customers say",
"items": [
{
"text": "REPLACE with a real customer's exact words",
"name": "REPLACE with their name",
"detail": ""
}
]
}
}Faq: Questions and answers
Questions that open to show their answers.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
items | No | Questions. list, up to 30 items |
items[].question | No | Question. text, up to 200 characters. Default: empty |
items[].answer | No | Answer. textarea, up to 2,000 characters. Default: empty. Leave an empty line between paragraphs. **bold**, [link](/shop), - for a list and ## for a heading also work. |
{
"type": "Faq",
"props": {
"title": "Questions and answers",
"items": [
{
"question": "How long does delivery take?",
"answer": "Add your answer."
}
],
"width": "narrow"
}
}Features: Key points
Short points with icons, side by side.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
columns | No | Columns. choice: 2, 3, 4. Default: "3" |
items | No | Points. list, up to 12 items |
items[].icon | No | Icon. choice: check, truck, shield, star, heart, leaf, clock, gift, chat, tools, none. Default: "check" |
items[].title | No | Title. text, up to 80 characters. Default: empty |
items[].text | No | Text. textarea, up to 300 characters. Default: empty |
{
"type": "Features",
"props": {
"title": "Why shop here",
"items": [
{
"icon": "heart",
"title": "Made with care",
"text": "Add a short detail."
},
{
"icon": "chat",
"title": "Easy to reach",
"text": "Add a short detail."
},
{
"icon": "star",
"title": "Good quality",
"text": "Add a short detail."
}
]
}
}Steps: Steps
Numbered steps, such as how to order.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
items | No | Steps. list, up to 10 items |
items[].title | No | Title. text, up to 80 characters. Default: empty |
items[].text | No | Text. textarea, up to 400 characters. Default: empty |
{
"type": "Steps",
"props": {
"title": "How it works",
"items": [
{
"title": "Choose",
"text": "Pick what you like."
},
{
"title": "Pay",
"text": "Pay with USDC or SOL on Solana."
}
]
}
}Stats: Numbers
True numbers about the business. Never make these up.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
items | No | Numbers. list, up to 6 items |
items[].value | No | Number. text, up to 20 characters. Default: empty |
items[].label | No | What it counts. text, up to 80 characters. Default: empty |
{
"type": "Stats",
"props": {
"title": "In numbers",
"items": [
{
"value": "REPLACE",
"label": "REPLACE with what this true number counts"
}
]
}
}Blocks: Pictures
Image: Picture
One picture, with an optional caption and link.
| Field | Required | What it is |
|---|---|---|
image | No | Picture. image. Default: empty |
alt | No | Describe the picture. text, up to 200 characters. Default: empty. For people who cannot see it, and for search. Leave it empty if it is only decoration. |
caption | No | Caption. text, up to 200 characters. Default: empty |
link | No | Link. link. Default: empty. A page in your store, such as /shop or /pages/about, or a full https address. |
shape | No | Shape. choice: original, wide, square. Default: "original" |
{
"type": "Image",
"props": {
"image": "/static/images/REPLACE.png",
"alt": "Describe the picture",
"caption": "",
"shape": "wide"
}
}ImageText: Picture and text
A picture beside some text.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
text | No | Text. textarea, up to 5,000 characters. Default: empty. Leave an empty line between paragraphs. **bold**, [link](/shop), - for a list and ## for a heading also work. |
button_text | No | Button text. text, up to 40 characters. Default: empty |
button_link | No | Button link. link. Default: empty. A page in your store, such as /shop or /pages/about, or a full https address. |
image | No | Picture. image. Default: empty |
alt | No | Describe the picture. text, up to 200 characters. Default: empty. For people who cannot see it, and for search. Leave it empty if it is only decoration. |
side | No | Picture is on the. choice: start, end. Default: "start" |
{
"type": "ImageText",
"props": {
"title": "Our story",
"text": "Say how it started, and what matters to you."
}
}Gallery: Gallery
Several pictures in a grid.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
columns | No | Columns. choice: 2, 3, 4. Default: "3" |
items | No | Pictures. list, up to 24 items |
items[].image | No | Picture. image. Default: empty |
items[].alt | No | Describe the picture. text, up to 200 characters. Default: empty. For people who cannot see it, and for search. Leave it empty if it is only decoration. |
items[].caption | No | Caption. text, up to 120 characters. Default: empty |
{
"type": "Gallery",
"props": {
"title": "Gallery",
"columns": "3",
"items": [
{
"image": "/static/images/REPLACE.png",
"alt": "Describe the picture",
"caption": ""
}
]
}
}Video: Video
A YouTube or Vimeo video.
| Field | Required | What it is |
|---|---|---|
video | No | YouTube or Vimeo address. video. Default: empty |
title | No | Title of the video. text, up to 120 characters. Default: empty |
{
"type": "Video",
"props": {
"video": "https://vimeo.com/123456789",
"title": "Say what the video shows"
}
}Blocks: Shop
Products: Products
Products from the store. Prices and stock are always up to date.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
category | No | Category. category. Default: empty |
count | No | How many. number from 1 to 24. Default: 8 |
sort | No | Order. choice: featured, newest, price_low, price_high. Default: "featured" |
button_text | No | Button text. text, up to 40 characters. Default: empty |
button_link | No | Button link. link. Default: empty. A page in your store, such as /shop or /pages/about, or a full https address. |
{
"type": "Products",
"props": {
"title": "Our products",
"count": 8,
"button_text": "See all",
"button_link": "/shop"
}
}Categories: Categories
Links to the categories in the store menu.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
count | No | How many. number from 1 to 24. Default: 8 |
{
"type": "Categories",
"props": {
"title": "Shop by category",
"count": 8
}
}Contact: Contact details
The email, phone, address and social links from the store settings.
| Field | Required | What it is |
|---|---|---|
title | No | Heading. text, up to 120 characters. Default: empty |
text | No | Text. textarea, up to 500 characters. Default: empty |
{
"type": "Contact",
"props": {
"title": "Contact us",
"text": "We are happy to help."
}
}Blocks: Layout
Columns: Columns
Put any blocks side by side. Columns cannot go inside other columns.
| Field | Required | What it is |
|---|---|---|
split | No | Sizes. choice: even, start, end. Default: "even" |
first | No | Left column. blocks. Default: [] |
second | No | Right column. blocks. Default: [] |
{
"type": "Columns",
"props": {
"split": "even",
"first": [
{
"type": "Heading",
"props": {
"title": "Visit us"
}
}
],
"second": [
{
"type": "Text",
"props": {
"text": "Say when you are open."
}
}
]
}
}Divider: Line
A thin line.
It only has the fields that every block has.
{
"type": "Divider",
"props": {
"space": "small"
}
}Spacer: Space
Empty space.
| Field | Required | What it is |
|---|---|---|
size | No | Size. choice: medium, small, large. Default: "medium" |
{
"type": "Spacer",
"props": {}
}Templates
Send a template to start with its blocks. Anything else you send replaces part of it, and blocks replaces them all. Replace every example before you publish.
blank: Blank page
Start with nothing.
{
"title": "New page",
"slug": "new-page",
"menu": "none",
"is_home": false,
"blocks": []
}home: Home page
A hero, categories, products and key points. Replaces the standard home page when published.
{
"title": "Home",
"slug": "home",
"menu": "none",
"is_home": true,
"blocks": [
{
"type": "Hero",
"props": {
"title": "Say what makes your store special",
"text": "Add one or two short sentences about what you sell.",
"button_text": "Shop now",
"button_link": "/shop",
"layout": "split",
"background": "soft",
"space": "large"
}
},
{
"type": "Categories",
"props": {
"title": "Shop by category",
"count": 6
}
},
{
"type": "Products",
"props": {
"title": "New in",
"count": 8,
"sort": "newest",
"button_text": "See all products",
"button_link": "/shop"
}
},
{
"type": "Features",
"props": {
"title": "Why shop with us",
"background": "soft",
"items": [
{
"icon": "heart",
"title": "Your first point",
"text": "Add something true about your products."
},
{
"icon": "truck",
"title": "Delivery",
"text": "Say how and where you deliver."
},
{
"icon": "chat",
"title": "Help",
"text": "Say how customers can reach you."
}
]
}
},
{
"type": "Banner",
"props": {
"title": "Find something you love",
"button_text": "Start shopping",
"button_link": "/shop",
"background": "accent",
"align": "center"
}
}
]
}about: About us
Your story, what matters to you, and a link to the shop.
{
"title": "About us",
"slug": "about",
"menu": "both",
"is_home": false,
"blocks": [
{
"type": "Hero",
"props": {
"title": "About us",
"text": "Say who you are and what you make, in one or two sentences.",
"layout": "center",
"background": "soft"
}
},
{
"type": "ImageText",
"props": {
"title": "How we started",
"text": "Share how your store began."
}
},
{
"type": "Features",
"props": {
"title": "What matters to us",
"columns": "3",
"items": [
{
"icon": "star",
"title": "Your first value",
"text": "Explain what it means for customers."
},
{
"icon": "leaf",
"title": "Your second value",
"text": "Explain what it means for customers."
},
{
"icon": "heart",
"title": "Your third value",
"text": "Explain what it means for customers."
}
]
}
},
{
"type": "Banner",
"props": {
"title": "See what we make",
"button_text": "Visit the shop",
"button_link": "/shop",
"background": "accent",
"align": "center"
}
}
]
}contact: Contact
Your contact details and answers to common questions.
{
"title": "Contact us",
"slug": "contact",
"menu": "both",
"is_home": false,
"blocks": [
{
"type": "Contact",
"props": {
"title": "Contact us",
"text": "Say when you usually reply."
}
},
{
"type": "Faq",
"props": {
"title": "Before you write",
"width": "narrow",
"background": "soft",
"items": [
{
"question": "Add a question customers often ask",
"answer": "Add your answer."
}
]
}
}
]
}faq: Questions and answers
Answers about orders, payment and delivery.
{
"title": "Questions and answers",
"slug": "faq",
"menu": "footer",
"is_home": false,
"blocks": [
{
"type": "Faq",
"props": {
"title": "Orders",
"width": "narrow",
"items": [
{
"question": "How do I pay?",
"answer": "You can pay with USDC or SOL on Solana, from a Solana wallet."
},
{
"question": "Can I change my order?",
"answer": "Add your answer."
}
]
}
},
{
"type": "Faq",
"props": {
"title": "Delivery",
"width": "narrow",
"items": [
{
"question": "Where do you deliver?",
"answer": "Add your answer."
},
{
"question": "How long does it take?",
"answer": "Add your answer."
}
]
}
},
{
"type": "Contact",
"props": {
"title": "Still need help?",
"background": "soft"
}
}
]
}launch: Product launch
One page for a new product, collection or offer.
{
"title": "New collection",
"slug": "new-collection",
"menu": "header",
"is_home": false,
"blocks": [
{
"type": "Hero",
"props": {
"eyebrow": "New",
"title": "Name your collection",
"text": "Say what is new, and who it is for.",
"button_text": "See the collection",
"button_link": "/shop",
"layout": "cover",
"space": "large",
"background": "dark"
}
},
{
"type": "Features",
"props": {
"title": "What is different",
"items": [
{
"icon": "check",
"title": "First difference",
"text": "Add a true detail."
},
{
"icon": "check",
"title": "Second difference",
"text": "Add a true detail."
},
{
"icon": "check",
"title": "Third difference",
"text": "Add a true detail."
}
]
}
},
{
"type": "Products",
"props": {
"title": "The collection",
"count": 8,
"sort": "newest"
}
},
{
"type": "Gallery",
"props": {
"title": "A closer look",
"background": "soft"
}
},
{
"type": "Banner",
"props": {
"title": "Make it yours",
"button_text": "Shop now",
"button_link": "/shop",
"background": "accent",
"align": "center"
}
}
]
}services: Services
What you offer, how it works, and how to book.
{
"title": "Services",
"slug": "services",
"menu": "header",
"is_home": false,
"blocks": [
{
"type": "Hero",
"props": {
"title": "Say what you can do for customers",
"text": "Explain who it is for.",
"button_text": "See services",
"button_link": "/shop",
"layout": "center"
}
},
{
"type": "Products",
"props": {
"title": "Services",
"count": 6
}
},
{
"type": "Steps",
"props": {
"title": "How it works",
"background": "soft",
"items": [
{
"title": "Choose a service",
"text": "Add a detail."
},
{
"title": "Pay",
"text": "Pay with USDC or SOL on Solana."
},
{
"title": "We get started",
"text": "Say what happens next."
}
]
}
},
{
"type": "Contact",
"props": {
"title": "Ask us anything"
}
}
]
}delivery: Delivery and returns
Headings for your own policy. You write the details.
{
"title": "Delivery and returns",
"slug": "delivery-and-returns",
"menu": "footer",
"is_home": false,
"blocks": [
{
"type": "Text",
"props": {
"width": "narrow",
"text": "## Delivery\n\nAdd where you deliver, what it costs and how long it takes.\n\n## Returns\n\nAdd when customers can return something, and how.\n\n## Problems with an order\n\nAdd how to contact you, and what you will do."
}
},
{
"type": "Contact",
"props": {
"title": "Need help with an order?",
"background": "soft"
}
}
]
}Search settings
Only include what is true. Give each page, product and category its own title and description. Switro also makes the sitemap, main addresses and structured data.
The whole store
Use PATCH /v2/store/seo.
| Field | Required | What it is |
|---|---|---|
title | No | text, up to 70 characters. Shown in search results. About 50 to 60 characters is best. |
description | No | text, up to 200 characters. A true summary for search results. About 120 to 160 characters is best. |
keywords | No | list, up to 10 items. Words customers use, with up to 50 characters each. Most search engines ignore these, so use the words in the page too. |
image | No | image. The path of an uploaded image, shown when a link is shared. 1200 x 630 pixels is best. Empty removes it. |
noindex | No | true or false. True asks search engines not to show the whole store. |
google_verification | No | code, up to 100 characters. Only the code from Google Search Console, given by the seller. |
bing_verification | No | code, up to 100 characters. Only the code from Bing Webmaster Tools, given by the seller. |
One page
Use PATCH /v2/store/pages/PAGE_ID, with these inside seo.
| Field | Required | What it is |
|---|---|---|
title | No | text, up to 70 characters. Shown in search results. About 50 to 60 characters is best. |
description | No | text, up to 200 characters. A true summary for search results. About 120 to 160 characters is best. |
keywords | No | list, up to 10 items. Words customers use, with up to 50 characters each. Most search engines ignore these, so use the words in the page too. |
image | No | image. The path of an uploaded image, shown when a link is shared. 1200 x 630 pixels is best. Empty removes it. |
noindex | No | true or false. True asks search engines not to show this page. |
A product
Use PUT /v2/store/products, with the other required fields.
| Field | Required | What it is |
|---|---|---|
seo_title | No | text, up to 200 characters. Shown in search results. About 50 to 60 characters is best. |
seo_description | No | text, up to 500 characters. A true summary for search results. About 120 to 160 characters is best. |
A category
Use PUT /v2/store/categories, with the other required fields.
| Field | Required | What it is |
|---|---|---|
seo_title | No | text, up to 200 characters. Shown in search results. About 50 to 60 characters is best. |
seo_description | No | text, up to 500 characters. A true summary for search results. About 120 to 160 characters is best. |