Storefront
Paste a key and every snippet on this page switches from the placeholder to your key — and the Try it panel under each endpoint is ready to send. It is stored in this browser only and goes nowhere except, if you press Send, straight to the API host you pick there.
Get the store design
/ext/v1/storefront/designstorefront:readThe one call to make first: the store (name, currency), the active theme, the live design tokens, every page with its publish state and last change, the menus, the media count, the section catalogue by category and the product, category and brand counts. A store with no active theme answers theme: null and says so in notes. Company-scoped keys must pass store_id: a design belongs to one store.
Query parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Restrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS "https://api.shopdeskbd.com/ext/v1/storefront/design" \
-H "Authorization: Bearer $SHOPDESK_API_KEY"const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/design");
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
response = requests.get(
"https://api.shopdeskbd.com/ext/v1/storefront/design",
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/design');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key],
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/designStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Query parameters
Blank fields are left out of the request.
Paste a key above to enable Send.
Responses
200The design.401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.422Validation failed —error.fieldsmaps each offending field to its messages.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"store": {
"id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"name": "Dhaka Threads",
"currency": "BDT"
},
"theme": {
"slug": "fashion",
"name": "Fashion",
"version": "1.4.0"
},
"tokens": {
"live": {},
"has_draft": false
},
"pages": [
{
"id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"type": "system",
"system_key": "home",
"handle": "about-us",
"title": "Home",
"status": "active",
"has_unpublished_changes": false,
"published_at": "2026-08-11T10:00:00.000Z",
"draft_updated_at": "2026-08-11T10:00:00.000Z",
"last_change": {
"at": "2026-08-11T10:00:00.000Z",
"via": "api",
"actor_name": "Nusrat Jahan",
"api_key_label": "Design assistant"
}
}
],
"menus": [
{
"handle": "main-menu",
"name": "Main menu",
"item_count": 6
}
],
"media_count": 42,
"catalog_summary": {
"categories": [
{
"category": "hero",
"count": 7
}
]
},
"counts": {
"products": 120,
"categories": 14,
"brands": 6
},
"notes": []
}List the media library
/ext/v1/storefront/mediastorefront:readThe company's storefront images, sorted by key and paged with starting_after (the previous page's next_cursor). Each item's asset is the value an image field takes. search matches the file name. Company-scoped keys must pass store_id: a design belongs to one store.
Query parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Restrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store. |
limit | numberdefault 50max 100 | Page size. |
starting_after | string | Return the page AFTER this item's key (the previous page's next_cursor). |
search | string | Case-insensitive substring of the file name. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS "https://api.shopdeskbd.com/ext/v1/storefront/media?limit=25" \
-H "Authorization: Bearer $SHOPDESK_API_KEY"const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/media");
Object.entries({
limit: "25",
}).forEach(([key, value]) => url.searchParams.set(key, value));
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const { data, meta } = await response.json();import os
import requests
response = requests.get(
"https://api.shopdeskbd.com/ext/v1/storefront/media",
params={
"limit": "25",
},
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
page = response.json()
rows, meta = page["data"], page["meta"]<?php
$key = getenv('SHOPDESK_API_KEY');
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/media?limit=25');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key],
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}
$rows = $response['data'];
$meta = $response['meta'];https://api.shopdeskbd.com/ext/v1/storefront/media?starting_after=companies%2F5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001%2Fmedia%2Fbanner-1700000000.webp&search=bannerStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Query parameters
Blank fields are left out of the request.
Paste a key above to enable Send.
Responses
200A page of media items.401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.409The store has no active theme installation yet (NO_ACTIVE_THEME): install one in the dashboard first.422Validation failed —error.fieldsmaps each offending field to its messages.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.502STORAGE_UNAVAILABLE: the media storage refused or was unreachable — retry in a moment.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"data": [
{
"key": "companies/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/media/banner-1700000000.webp",
"name": "banner-1700000000.webp",
"url": "https://cdn.example.com/companies/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/media/banner-1700000000.webp",
"size": 182344,
"uploaded_at": "2026-08-11T10:00:00.000Z",
"asset": "asset:companies/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/media/banner-1700000000.webp"
}
],
"meta": {
"has_more": true,
"next_cursor": "companies/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/media/banner-1700000000.webp"
}
}Generate an image with AI
/ext/v1/storefront/media/generatemedia:generateGenerates ONE image with AI from prompt and stores it in the company's media library (it counts toward the 2,000-item cap). Each image costs 2 of the store's AI credits, handed back when nothing is produced; a store makes at most 30 a day. aspect picks 1024×1024 (square, the default), 1536×1024 (landscape) or 1024×1536 (portrait). The answer's data.asset is the value an image field takes; nothing shoppers see changes until a page using it is published. Idempotency-Key is required: a retry with the same key returns the same image without a second charge. Needs media:generate, which is granted only beside storefront:write. Company-scoped keys pass store_id in the body.
Headers
| Name | Type | Description |
|---|---|---|
Idempotency-Keyrequired | string | REQUIRED. A unique value per logical request (a UUID is ideal); reuse it verbatim when retrying. A retry replays the original response with Idempotent-Replayed: true instead of running twice. |
Body parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Target store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store. |
promptrequired | string | What the image shows, 1–1,000 characters after trimming. Sent to the AI provider. |
aspect | stringdefault square | square (1024×1024, the default), landscape (1536×1024) or portrait (1024×1536).squarelandscapeportrait |
name | string | The file name in the library (made safe, prefixed ai-, then timestamped); the prompt's start when left out. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS -X POST "https://api.shopdeskbd.com/ext/v1/storefront/media/generate" \
-H "Authorization: Bearer $SHOPDESK_API_KEY" \
-H "Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A warm Eid banner: lanterns and crescent moon over a soft gold background, no text",
"aspect": "landscape",
"name": "eid-banner"
}'const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/media/generate");
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "A warm Eid banner: lanterns and crescent moon over a soft gold background, no text",
"aspect": "landscape",
"name": "eid-banner"
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const { data } = await response.json();import os
import requests
payload = {
"prompt": "A warm Eid banner: lanterns and crescent moon over a soft gold background, no text",
"aspect": "landscape",
"name": "eid-banner",
}
response = requests.post(
"https://api.shopdeskbd.com/ext/v1/storefront/media/generate",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
page = response.json()
rows = page["data"]<?php
$key = getenv('SHOPDESK_API_KEY');
$payload = json_encode([
'prompt' => 'A warm Eid banner: lanterns and crescent moon over a soft gold background, no text',
'aspect' => 'landscape',
'name' => 'eid-banner',
]);
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/media/generate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}
$rows = $response['data'];https://api.shopdeskbd.com/ext/v1/storefront/media/generateStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
generating…A new value is generated whenever you edit this request, and kept while you do not — so sending twice without changing anything is a real retry and comes back Idempotent-Replayed: true instead of writing again.
Paste a key above to enable Send.
Responses
201The generated image, the model that made it, and its cost.400The requiredIdempotency-Keyheader is missing, empty, or longer than 255 characters (VALIDATION_ERROR;error.fieldsnames the header).401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key lacksmedia:generate(FORBIDDEN_SCOPE); the company's plan does not include the AI assistant (PLAN_FEATURE_REQUIRED); AI image generation is switched off (IMAGE_GENERATION_DISABLED,error.fields.reason = ['platform']or['store']); or the company has used all of its AI credits for this billing period, shared by its stores (AI_CREDITS_EXHAUSTED).409the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with thisIdempotency-Keyis still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.422The body is not valid (VALIDATION_ERROR,error.fieldsnames the field); the AI provider's safety filter refused the prompt (error.fields.prompt = ['rejected'], nothing charged); or the library would pass 2,000 items (error.fields.media_library = ['media_library_cap_2000']).429The store has made today's 30 images, or the key's write limit (RATE_LIMITED, withRetry-After).502STORAGE_UNAVAILABLE: the media storage refused or was unreachable — retry in a moment.503No image could be made (AI_UNAVAILABLE): no AI image model is set up on this platform yet (error.fields.reason = ['no_image_provider']; a configuration state, so retrying does not help until one is set up) or the provider failed (['provider_failed']; retry later). Nothing stays charged.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"data": {
"key": "companies/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/media/banner-1700000000.webp",
"name": "banner-1700000000.webp",
"url": "https://cdn.example.com/companies/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/media/banner-1700000000.webp",
"size": 182344,
"uploaded_at": "2026-08-11T10:00:00.000Z",
"asset": "asset:companies/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/media/banner-1700000000.webp"
},
"model": "gpt-image-2.5-flare",
"width": 1024,
"height": 1024,
"credits": 2
}Import images into the media library
/ext/v1/storefront/media/importstorefront:writeDownloads up to 10 images by https link and stores them in the company's media library — all of them, or none. Each answer item's asset is the value an image field takes. The API adds images only while the library stays at or under 2,000 items. Image links: https only, PNG/JPEG/WebP/GIF read from the bytes (never SVG), at most 10 MB and 8000 px on the longest side (and 40 megapixels in all; 16 for a GIF), fetched within 10 s each and 30 s for the call, at most 50 MB downloaded per call. One failing link fails the whole call and nothing is written. Each image a call carries — link or file — counts as one write against the key's per-minute write limit; calls that download or upload images run at most 2 at a time per key; and a company may have 2,000 links downloaded per UTC day. Past any of these the answer is 429 RATE_LIMITED with Retry-After. Company-scoped keys pass store_id in the body.
Headers
| Name | Type | Description |
|---|---|---|
Idempotency-Key | string | Optional, but honored: send it to make retries of this request safe. |
Body parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Target store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store. |
imagesrequired | StorefrontMediaImportEntryDto[] | Up to 10 images, stored all or none. |
images[] fields
| Name | Type | Description |
|---|---|---|
urlrequired | string | The https link to download. |
name | string | The file name in the library (made safe, then timestamped); the link's own file name when left out. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS -X POST "https://api.shopdeskbd.com/ext/v1/storefront/media/import" \
-H "Authorization: Bearer $SHOPDESK_API_KEY" \
-H "Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47" \
-H "Content-Type: application/json" \
-d '{
"images": [
{
"url": "https://cdn.example.com/banners/eid.jpg",
"name": "eid-banner"
}
]
}'const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/media/import");
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
"Content-Type": "application/json",
},
body: JSON.stringify({
"images": [
{
"url": "https://cdn.example.com/banners/eid.jpg",
"name": "eid-banner"
}
]
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const { data } = await response.json();import os
import requests
payload = {
"images": [
{
"url": "https://cdn.example.com/banners/eid.jpg",
"name": "eid-banner",
},
],
}
response = requests.post(
"https://api.shopdeskbd.com/ext/v1/storefront/media/import",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
page = response.json()
rows = page["data"]<?php
$key = getenv('SHOPDESK_API_KEY');
$payload = json_encode([
'images' => [
[
'url' => 'https://cdn.example.com/banners/eid.jpg',
'name' => 'eid-banner',
],
],
]);
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/media/import');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}
$rows = $response['data'];https://api.shopdeskbd.com/ext/v1/storefront/media/importStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
generating…A new value is generated whenever you edit this request, and kept while you do not — so sending twice without changing anything is a real retry and comes back Idempotent-Replayed: true instead of writing again.
Paste a key above to enable Send.
Responses
201The stored images, in request order.400AnIdempotency-Keyheader was sent but is empty or longer than 255 characters (VALIDATION_ERROR;error.fieldsnames the header).401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.409the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with thisIdempotency-Keyis still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.422A link was refused or is not an image (error.fieldsnames it,images[<index>].url), or the library would pass 2,000 items (error.fields.images = ['media_library_cap_2000']) (VALIDATION_ERROR).429Too many image calls by this key at once, its write limit, or the company's daily link budget (RATE_LIMITED, withRetry-After).502STORAGE_UNAVAILABLE: the media storage refused or was unreachable — retry in a moment.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"data": [
{
"key": "companies/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/media/banner-1700000000.webp",
"name": "banner-1700000000.webp",
"url": "https://cdn.example.com/companies/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/media/banner-1700000000.webp",
"size": 182344,
"uploaded_at": "2026-08-11T10:00:00.000Z",
"asset": "asset:companies/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/media/banner-1700000000.webp"
}
]
}Create a page
/ext/v1/storefront/pagesstorefront:writeA new custom page at /pages/<handle> (the handle is made from the title when left out), as an unpublished draft: empty, or tree, checked like a draft save. A handle that belonged to a deleted page brings that page back as this new one (revived: true). Company-scoped keys pass store_id in the body. Nothing changes for shoppers until the page is published.
Headers
| Name | Type | Description |
|---|---|---|
Idempotency-Key | string | Optional, but honored: send it to make retries of this request safe. |
Body parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Target store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store. |
titlerequired | string | — |
handle | string | The address, /pages/<handle>: lower-case letters, digits and dashes. Made from the title when left out. |
seo | StorefrontPageSeoDto | — |
tree | object | The starting draft, { schema: 1, sections: [...] }; an empty page when left out. Checked like a draft save. |
seo fields
| Name | Type | Description |
|---|---|---|
title | string | The browser tab and search result title. |
description | string | The search result and link preview description. |
image_key | string | The share image: a media library key (from GET /storefront/media). |
no_index | boolean | Ask search engines not to index the page. It stays publicly reachable. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS -X POST "https://api.shopdeskbd.com/ext/v1/storefront/pages" \
-H "Authorization: Bearer $SHOPDESK_API_KEY" \
-H "Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47" \
-H "Content-Type: application/json" \
-d '{
"title": "Eid collection",
"handle": "eid-collection",
"seo": {
"title": "Eid collection — new arrivals"
},
"tree": {
"schema": 1,
"sections": [
{
"id": "s_hero_cta",
"type": "cta_section",
"version": "1",
"settings": {
"heading": "Eid collection — new arrivals",
"cta_label": "Shop the collection",
"cta_link": {
"type": "url",
"url": "/products"
},
"image": "asset:placeholder-hero",
"overlay": "soft"
},
"blocks": []
}
]
}
}'const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/pages");
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
"Content-Type": "application/json",
},
body: JSON.stringify({
"title": "Eid collection",
"handle": "eid-collection",
"seo": {
"title": "Eid collection — new arrivals"
},
"tree": {
"schema": 1,
"sections": [
{
"id": "s_hero_cta",
"type": "cta_section",
"version": "1",
"settings": {
"heading": "Eid collection — new arrivals",
"cta_label": "Shop the collection",
"cta_link": {
"type": "url",
"url": "/products"
},
"image": "asset:placeholder-hero",
"overlay": "soft"
},
"blocks": []
}
]
}
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
payload = {
"title": "Eid collection",
"handle": "eid-collection",
"seo": {
"title": "Eid collection — new arrivals",
},
"tree": {
"schema": 1,
"sections": [
{
"id": "s_hero_cta",
"type": "cta_section",
"version": "1",
"settings": {
"heading": "Eid collection — new arrivals",
"cta_label": "Shop the collection",
"cta_link": {
"type": "url",
"url": "/products",
},
"image": "asset:placeholder-hero",
"overlay": "soft",
},
"blocks": [],
},
],
},
}
response = requests.post(
"https://api.shopdeskbd.com/ext/v1/storefront/pages",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$payload = json_encode([
'title' => 'Eid collection',
'handle' => 'eid-collection',
'seo' => [
'title' => 'Eid collection — new arrivals',
],
'tree' => [
'schema' => 1,
'sections' => [
[
'id' => 's_hero_cta',
'type' => 'cta_section',
'version' => '1',
'settings' => [
'heading' => 'Eid collection — new arrivals',
'cta_label' => 'Shop the collection',
'cta_link' => [
'type' => 'url',
'url' => '/products',
],
'image' => 'asset:placeholder-hero',
'overlay' => 'soft',
],
'blocks' => [],
],
],
],
]);
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/pages');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/pagesStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
generating…A new value is generated whenever you edit this request, and kept while you do not — so sending twice without changing anything is a real retry and comes back Idempotent-Replayed: true instead of writing again.
Paste a key above to enable Send.
Responses
201The new page.400AnIdempotency-Keyheader was sent but is empty or longer than 255 characters (VALIDATION_ERROR;error.fieldsnames the header).401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.409The handle is taken by another page (CONFLICT,error.fields.handle), or the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with thisIdempotency-Keyis still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.422The tree breaks a rule (VALIDATION_ERROR):error.fieldsis keyed by JSON pointer into the tree, each holding the finding's codes (LINK_SCHEME,TREE_TOO_LARGE,FEATURE_LOCKED,REQUIRED, …) — the same findingsPOST /storefront/pages/{id}/validatelists.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"type": "system",
"system_key": "home",
"handle": "about-us",
"title": "Home",
"status": "active",
"has_unpublished_changes": false,
"published_at": "2026-08-11T10:00:00.000Z",
"draft_updated_at": "2026-08-11T10:00:00.000Z",
"last_change": {
"at": "2026-08-11T10:00:00.000Z",
"via": "api",
"actor_name": "Nusrat Jahan",
"api_key_label": "Design assistant"
},
"revived": false,
"warnings": [
{
"path": "/sections/0/settings/heading",
"code": "REQUIRED",
"message": "Heading is required"
}
]
}List the pages
/ext/v1/storefront/pagesstorefront:readThe pages of the active theme — system pages (home, product, collection, cart, search, …), custom pages and the layout page — with whether each has unpublished changes and who changed it last. Find a page by system_key or handle here, then read it by id. Company-scoped keys must pass store_id: a design belongs to one store.
Query parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Restrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store. |
type | string | Only pages of this type.systemcustomlayout |
system_key | string | Only the system page with this key (home, product, collection, cart, search, …; the layout page is layout). |
handle | string | Only the custom page with this handle. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS "https://api.shopdeskbd.com/ext/v1/storefront/pages" \
-H "Authorization: Bearer $SHOPDESK_API_KEY"const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/pages");
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const { data } = await response.json();import os
import requests
response = requests.get(
"https://api.shopdeskbd.com/ext/v1/storefront/pages",
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
page = response.json()
rows = page["data"]<?php
$key = getenv('SHOPDESK_API_KEY');
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/pages');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key],
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}
$rows = $response['data'];https://api.shopdeskbd.com/ext/v1/storefront/pages?system_key=home&handle=about-usStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Query parameters
Blank fields are left out of the request.
Paste a key above to enable Send.
Responses
200The pages.401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.409The store has no active theme installation yet (NO_ACTIVE_THEME): install one in the dashboard first.422Validation failed —error.fieldsmaps each offending field to its messages.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"data": [
{
"id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"type": "system",
"system_key": "home",
"handle": "about-us",
"title": "Home",
"status": "active",
"has_unpublished_changes": false,
"published_at": "2026-08-11T10:00:00.000Z",
"draft_updated_at": "2026-08-11T10:00:00.000Z",
"last_change": {
"at": "2026-08-11T10:00:00.000Z",
"via": "api",
"actor_name": "Nusrat Jahan",
"api_key_label": "Design assistant"
}
}
]
}Get a page
/ext/v1/storefront/pages/{id}storefront:readOne page with its SEO and layout mode, and by include: the draft tree (default), the published tree, both, or a compact summary of its sections. Parts not asked for are null. Company-scoped keys must pass store_id: a design belongs to one store.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | uuid | The page id, from GET /storefront/pages (find a page by system_key or handle there). |
Query parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Restrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store. |
include | stringdefault draft | draft (default) returns the draft tree; published the live tree (null if never published); both both; summary only the section outline (ids, types, versions, visibility, block counts), for orienting on a big page. Parts not asked for are null.draftpublishedbothsummary |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS "https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID" \
-H "Authorization: Bearer $SHOPDESK_API_KEY"const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID");
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
response = requests.get(
"https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID",
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key],
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001Stored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Path parameters
Query parameters
Blank fields are left out of the request.
Paste a key above to enable Send.
Responses
200The page.401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.404No such page in the active theme of this store. Popups and landing pages are not served here.409The store has no active theme installation yet (NO_ACTIVE_THEME): install one in the dashboard first.422Validation failed —error.fieldsmaps each offending field to its messages.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"type": "system",
"system_key": "home",
"handle": "about-us",
"title": "Home",
"status": "active",
"has_unpublished_changes": false,
"published_at": "2026-08-11T10:00:00.000Z",
"draft_updated_at": "2026-08-11T10:00:00.000Z",
"last_change": {
"at": "2026-08-11T10:00:00.000Z",
"via": "api",
"actor_name": "Nusrat Jahan",
"api_key_label": "Design assistant"
},
"seo": null,
"layout_mode": "theme",
"published_revision_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"draft": null,
"published": null,
"summary": null
}Save a page draft
/ext/v1/storefront/pages/{id}/draftstorefront:writeReplaces the page's draft with tree, checked first by the same rules POST …/validate reports: an error refuses the whole save. Send base_draft_updated_at (from the read) so a change made since is not overwritten. The answer has the new draft_updated_at, the warnings and an outline of the saved draft. Company-scoped keys pass store_id in the body. Nothing changes for shoppers until the page is published.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | uuid | The page id, from GET /storefront/pages (find a page by system_key or handle there). |
Headers
| Name | Type | Description |
|---|---|---|
Idempotency-Key | string | Optional, but honored: send it to make retries of this request safe. |
Body parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Target store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store. |
treerequired | object | The whole draft tree, replacing the stored one — the shape GET /storefront/pages/{id} returns as draft ({ schema: 1, sections: [...] }, or { schema: 1, groups: {...} } on the layout page). |
base_draft_updated_at | date-time | Optimistic lock: the draft_updated_at you read. When it is stale the write is refused with 409 DRAFT_CONFLICT, and error.fields.base_draft_updated_at carries the current value. Leave it out to write regardless. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS -X PUT "https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/draft" \
-H "Authorization: Bearer $SHOPDESK_API_KEY" \
-H "Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47" \
-H "Content-Type: application/json" \
-d '{
"tree": {
"schema": 1,
"sections": [
{
"id": "s_hero_cta",
"type": "cta_section",
"version": "1",
"settings": {
"heading": "Eid collection — new arrivals",
"cta_label": "Shop the collection",
"cta_link": {
"type": "url",
"url": "/products"
},
"image": "asset:placeholder-hero",
"overlay": "soft"
},
"blocks": []
}
]
},
"base_draft_updated_at": "2026-11-09T10:00:00.000Z"
}'const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/draft");
const response = await fetch(url, {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
"Content-Type": "application/json",
},
body: JSON.stringify({
"tree": {
"schema": 1,
"sections": [
{
"id": "s_hero_cta",
"type": "cta_section",
"version": "1",
"settings": {
"heading": "Eid collection — new arrivals",
"cta_label": "Shop the collection",
"cta_link": {
"type": "url",
"url": "/products"
},
"image": "asset:placeholder-hero",
"overlay": "soft"
},
"blocks": []
}
]
},
"base_draft_updated_at": "2026-11-09T10:00:00.000Z"
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
payload = {
"tree": {
"schema": 1,
"sections": [
{
"id": "s_hero_cta",
"type": "cta_section",
"version": "1",
"settings": {
"heading": "Eid collection — new arrivals",
"cta_label": "Shop the collection",
"cta_link": {
"type": "url",
"url": "/products",
},
"image": "asset:placeholder-hero",
"overlay": "soft",
},
"blocks": [],
},
],
},
"base_draft_updated_at": "2026-11-09T10:00:00.000Z",
}
response = requests.put(
"https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/draft",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$payload = json_encode([
'tree' => [
'schema' => 1,
'sections' => [
[
'id' => 's_hero_cta',
'type' => 'cta_section',
'version' => '1',
'settings' => [
'heading' => 'Eid collection — new arrivals',
'cta_label' => 'Shop the collection',
'cta_link' => [
'type' => 'url',
'url' => '/products',
],
'image' => 'asset:placeholder-hero',
'overlay' => 'soft',
],
'blocks' => [],
],
],
],
'base_draft_updated_at' => '2026-11-09T10:00:00.000Z',
]);
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/draft');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/draftStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Path parameters
generating…A new value is generated whenever you edit this request, and kept while you do not — so sending twice without changing anything is a real retry and comes back Idempotent-Replayed: true instead of writing again.
Paste a key above to enable Send.
Responses
200The draft was saved.400AnIdempotency-Keyheader was sent but is empty or longer than 255 characters (VALIDATION_ERROR;error.fieldsnames the header).401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.404No such page in the active theme of this store. Popups and landing pages are not served here.409The draft changed sincebase_draft_updated_at(DRAFT_CONFLICT;error.fields.base_draft_updated_atcarries the current value — read the page again), or the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with thisIdempotency-Keyis still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.422The tree breaks a rule (VALIDATION_ERROR):error.fieldsis keyed by JSON pointer into the tree, each holding the finding's codes (LINK_SCHEME,TREE_TOO_LARGE,FEATURE_LOCKED,REQUIRED, …) — the same findingsPOST /storefront/pages/{id}/validatelists.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"draft_updated_at": "2026-08-11T10:00:00.000Z",
"warnings": [
{
"path": "/sections/0/settings/heading",
"code": "REQUIRED",
"message": "Heading is required"
}
],
"summary": {}
}Change page sections
/ext/v1/storefront/pages/{id}/draftstorefront:writeApplies up to 50 section operations to the current draft, in order (insert, replace, remove or move a section; merge its settings; replace its blocks; merge a block's settings), then checks and saves the result as a whole — all or nothing. A refused operation is named in error.fields['operations/<index>']. Sections on the layout page name their group; a shared header or footer section can be moved, hidden or removed, never edited here. Company-scoped keys pass store_id in the body. Nothing changes for shoppers until the page is published.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | uuid | The page id, from GET /storefront/pages (find a page by system_key or handle there). |
Headers
| Name | Type | Description |
|---|---|---|
Idempotency-Key | string | Optional, but honored: send it to make retries of this request safe. |
Body parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Target store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store. |
operationsrequired | SectionOperationDto[] | Applied in order to the current draft, then checked as a whole: all are saved, or none. |
base_draft_updated_at | date-time | Optimistic lock: the draft_updated_at you read. When it is stale the write is refused with 409 DRAFT_CONFLICT, and error.fields.base_draft_updated_at carries the current value. Leave it out to write regardless. |
operations[] fields
| Name | Type | Description |
|---|---|---|
oprequired | string | insert_section (section, and after_id | before_id | index), replace_section (section_id, section), remove_section (section_id), move_section (section_id, and a position), set_section_settings (section_id, settings merged, a null value removes the key; visible), set_blocks (section_id, blocks), set_block_settings (section_id, block_id, settings). On the layout page every operation names its group.insert_sectionreplace_sectionremove_sectionmove_sectionset_section_settingsset_blocksset_block_settings |
section_id | string | — |
block_id | string | — |
section | object | A section node { type, version, settings, blocks?, visible? }; its id is generated when absent. |
blocks | object[] | The section's new blocks, replacing the old ones. |
settings | object | Settings to merge; a null value removes the key. |
visible | boolean | — |
after_id | string | Place after this section id. |
before_id | string | Place before this section id. |
index | number | Place at this index (0 is first). |
group | string | Layout page only: the group (header, footer, …). |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS -X PATCH "https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/draft" \
-H "Authorization: Bearer $SHOPDESK_API_KEY" \
-H "Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47" \
-H "Content-Type: application/json" \
-d '{
"operations": [
{
"op": "set_section_settings",
"section_id": "s_hero_cta",
"settings": {
"heading": "Eid sale — 20% off"
}
}
],
"base_draft_updated_at": "2026-11-09T10:00:00.000Z"
}'const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/draft");
const response = await fetch(url, {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
"Content-Type": "application/json",
},
body: JSON.stringify({
"operations": [
{
"op": "set_section_settings",
"section_id": "s_hero_cta",
"settings": {
"heading": "Eid sale — 20% off"
}
}
],
"base_draft_updated_at": "2026-11-09T10:00:00.000Z"
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
payload = {
"operations": [
{
"op": "set_section_settings",
"section_id": "s_hero_cta",
"settings": {
"heading": "Eid sale — 20% off",
},
},
],
"base_draft_updated_at": "2026-11-09T10:00:00.000Z",
}
response = requests.patch(
"https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/draft",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$payload = json_encode([
'operations' => [
[
'op' => 'set_section_settings',
'section_id' => 's_hero_cta',
'settings' => [
'heading' => 'Eid sale — 20% off',
],
],
],
'base_draft_updated_at' => '2026-11-09T10:00:00.000Z',
]);
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/draft');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/draftStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Path parameters
generating…A new value is generated whenever you edit this request, and kept while you do not — so sending twice without changing anything is a real retry and comes back Idempotent-Replayed: true instead of writing again.
Paste a key above to enable Send.
Responses
200The operations were applied and the draft saved.400AnIdempotency-Keyheader was sent but is empty or longer than 255 characters (VALIDATION_ERROR;error.fieldsnames the header).401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.404No such page in the active theme of this store. Popups and landing pages are not served here.409The draft changed sincebase_draft_updated_at(DRAFT_CONFLICT;error.fields.base_draft_updated_atcarries the current value — read the page again), or the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with thisIdempotency-Keyis still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.422An operation was refused (error.fields['operations/<index>']holds its code:SECTION_NOT_FOUND,BLOCK_NOT_FOUND,GROUP_REQUIRED,GROUP_NOT_FOUND,AMBIGUOUS_POSITION,POSITION_OUT_OF_RANGE,DUPLICATE_ID,SHARED_SECTION,INVALID_OPERATION), or the result breaks a tree rule (error.fieldsby JSON pointer) (VALIDATION_ERROR).429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"draft_updated_at": "2026-08-11T10:00:00.000Z",
"warnings": [
{
"path": "/sections/0/settings/heading",
"code": "REQUIRED",
"message": "Heading is required"
}
],
"summary": {}
}Publish a page
/ext/v1/storefront/pages/{id}/publishstorefront:publishPuts the page's draft live, in two calls. First call WITHOUT confirmation_token: nothing changes; the answer is a preview with a summary of what would go live and a single-use confirmation_token (10 minutes), or no_changes (no token). Show the summary to a person; then call again with the token AND an Idempotency-Key header to publish. If what was previewed changed in between, the confirm is refused (409 PREVIEW_STALE): preview again. A confirm uses its token up once it reaches the token check; a confirm refused earlier — for a missing Idempotency-Key, a 404/409 from the fence, or (menus) item validation — leaves it usable. The preview lists the sections added, removed, changed and moved against the live page; first_publish says the page has never been live (there is then nothing to roll back to). A draft that breaks a rule is refused before any token is made. A message sent with the preview is kept for the confirm unless the confirm sends its own. Company-scoped keys pass store_id in the body.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | uuid | The page id, from GET /storefront/pages (find a page by system_key or handle there). |
Headers
| Name | Type | Description |
|---|---|---|
Idempotency-Key | string | Optional, but honored: send it to make retries of this request safe. |
Body parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Target store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store. |
confirmation_token | string | Leave it out to get a preview and a token. Send the token from that preview (with an Idempotency-Key header) to confirm: it is single-use and lives 10 minutes. |
message | string | The revision's note, shown in the page history. A preview's message is kept for its confirm unless the confirm sends its own. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS -X POST "https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/publish" \
-H "Authorization: Bearer $SHOPDESK_API_KEY" \
-H "Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47" \
-H "Content-Type: application/json" \
-d '{
"message": "Eid banner and new arrivals"
}'const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/publish");
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
"Content-Type": "application/json",
},
body: JSON.stringify({
"message": "Eid banner and new arrivals"
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
payload = {
"message": "Eid banner and new arrivals",
}
response = requests.post(
"https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/publish",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$payload = json_encode([
'message' => 'Eid banner and new arrivals',
]);
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/publish');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/publishStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Path parameters
generating…A new value is generated whenever you edit this request, and kept while you do not — so sending twice without changing anything is a real retry and comes back Idempotent-Replayed: true instead of writing again.
Paste a key above to enable Send.
Responses
200The preview, the publish, orno_changes.400AnIdempotency-Keyheader was sent but is empty or longer than 255 characters (VALIDATION_ERROR;error.fieldsnames the header).401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.404No such page in the active theme of this store. Popups and landing pages are not served here.409What was previewed changed before the confirm (PREVIEW_STALE: ask for a new preview), or the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with thisIdempotency-Keyis still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.422The draft breaks a rule (error.fieldsby JSON pointer, as for a draft save), the token is unknown, expired, not this key's or from another route's preview (error.fields.confirmation_token = ['unknown_or_expired']), or a token came without anIdempotency-Keyheader (error.fields.idempotency_key = ['required_with_confirmation_token']) (VALIDATION_ERROR).429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"status": "preview",
"subject": "page:5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"summary": null,
"warnings": [
{
"path": "/sections/0/settings/heading",
"code": "REQUIRED",
"message": "Heading is required"
}
],
"confirmation_token": "a3f1c9e07b5d42e8a3f1c9e07b5d42e8a3f1c9e07b5d42e8a3f1c9e07b5d42e8",
"expires_at": "2026-08-11T10:00:00.000Z",
"revision_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"revision_version": 4,
"published_at": "2026-08-11T10:00:00.000Z",
"first_publish": false
}List page revisions
/ext/v1/storefront/pages/{id}/revisionsstorefront:readA page's published revisions, newest first, marking the one shoppers see. Company-scoped keys must pass store_id: a design belongs to one store.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | uuid | The page id, from GET /storefront/pages (find a page by system_key or handle there). |
Query parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Restrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS "https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/revisions" \
-H "Authorization: Bearer $SHOPDESK_API_KEY"const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/revisions");
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const { data } = await response.json();import os
import requests
response = requests.get(
"https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/revisions",
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
page = response.json()
rows = page["data"]<?php
$key = getenv('SHOPDESK_API_KEY');
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/revisions');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key],
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}
$rows = $response['data'];https://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/revisionsStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Path parameters
Query parameters
Blank fields are left out of the request.
Paste a key above to enable Send.
Responses
200The revisions.401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.404No such page in the active theme of this store. Popups and landing pages are not served here.409The store has no active theme installation yet (NO_ACTIVE_THEME): install one in the dashboard first.422Validation failed —error.fieldsmaps each offending field to its messages.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"data": [
{
"id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"version": 3,
"message": "Spring banner",
"created_at": "2026-08-11T10:00:00.000Z",
"is_published": true
}
]
}Roll a page back
/ext/v1/storefront/pages/{id}/rollbackstorefront:publishWithout confirmation_token: copies an earlier revision (from GET /storefront/pages/{id}/revisions) into the draft at once (status: restored); with publish: true the answer is also the preview of publishing it, with a token. Shoppers still see the live page. Confirm with that token, exactly as POST …/publish: First call WITHOUT confirmation_token: nothing changes; the answer is a preview with a summary of what would go live and a single-use confirmation_token (10 minutes), or no_changes (no token). Show the summary to a person; then call again with the token AND an Idempotency-Key header to publish. If what was previewed changed in between, the confirm is refused (409 PREVIEW_STALE): preview again. A confirm uses its token up once it reaches the token check; a confirm refused earlier — for a missing Idempotency-Key, a 404/409 from the fence, or (menus) item validation — leaves it usable. Company-scoped keys pass store_id in the body.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | uuid | The page id, from GET /storefront/pages (find a page by system_key or handle there). |
Headers
| Name | Type | Description |
|---|---|---|
Idempotency-Key | string | Optional, but honored: send it to make retries of this request safe. |
Body parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Target store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store. |
confirmation_token | string | Leave it out to get a preview and a token. Send the token from that preview (with an Idempotency-Key header) to confirm: it is single-use and lives 10 minutes. |
revision_idrequired | uuid | The revision to go back to, from GET /storefront/pages/{id}/revisions. |
publish | booleandefault false | Without a token: also preview publishing the restored draft (the answer then carries a token to confirm). With a token it is ignored: the confirm publishes the draft the preview showed. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS -X POST "https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/rollback" \
-H "Authorization: Bearer $SHOPDESK_API_KEY" \
-H "Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47" \
-H "Content-Type: application/json" \
-d '{
"revision_id": "9c1e2f60-0d1c-4b3a-9a68-6f4d21f6a010",
"publish": true
}'const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/rollback");
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
"Content-Type": "application/json",
},
body: JSON.stringify({
"revision_id": "9c1e2f60-0d1c-4b3a-9a68-6f4d21f6a010",
"publish": true
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
payload = {
"revision_id": "9c1e2f60-0d1c-4b3a-9a68-6f4d21f6a010",
"publish": True,
}
response = requests.post(
"https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/rollback",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$payload = json_encode([
'revision_id' => '9c1e2f60-0d1c-4b3a-9a68-6f4d21f6a010',
'publish' => true,
]);
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/rollback');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/rollbackStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Path parameters
generating…A new value is generated whenever you edit this request, and kept while you do not — so sending twice without changing anything is a real retry and comes back Idempotent-Replayed: true instead of writing again.
Paste a key above to enable Send.
Responses
200The restore (with its preview), or the publish.400AnIdempotency-Keyheader was sent but is empty or longer than 255 characters (VALIDATION_ERROR;error.fieldsnames the header).401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.404No such page in the active theme of this store, or no such revision of it.409What was previewed changed before the confirm (PREVIEW_STALE: ask for a new preview), or the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with thisIdempotency-Keyis still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.422The restored draft breaks a rule (error.fieldsby JSON pointer; the restore stands), the token is unknown, expired, not this key's or from another route's preview (error.fields.confirmation_token = ['unknown_or_expired']), or a token came without anIdempotency-Keyheader (error.fields.idempotency_key = ['required_with_confirmation_token']) (VALIDATION_ERROR).429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"status": "preview",
"subject": "page:5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"summary": null,
"warnings": [
{
"path": "/sections/0/settings/heading",
"code": "REQUIRED",
"message": "Heading is required"
}
],
"confirmation_token": "a3f1c9e07b5d42e8a3f1c9e07b5d42e8a3f1c9e07b5d42e8a3f1c9e07b5d42e8",
"expires_at": "2026-08-11T10:00:00.000Z",
"revision_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"revision_version": 4,
"published_at": "2026-08-11T10:00:00.000Z",
"first_publish": false,
"draft_updated_at": "2026-08-11T10:00:00.000Z"
}Validate a page tree
/ext/v1/storefront/pages/{id}/validatestorefront:readA dry run of a draft save: the tree is checked by the same rules a save through the API applies, and the result says whether the save would be accepted. Nothing is written. A read: it needs storefront:read and counts against the read rate limit. Company-scoped keys pass store_id in the body.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | uuid | The page id, from GET /storefront/pages (find a page by system_key or handle there). |
Body parameters
| Name | Type | Description |
|---|---|---|
treerequired | object | The page tree to check — the same shape GET /storefront/pages/{id} returns as draft ({ sections: [...] }, or { groups: {...} } for the layout page). |
store_id | uuid | The store, for a company-scoped key; on a store-scoped key it must match the key's own store. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS -X POST "https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/validate" \
-H "Authorization: Bearer $SHOPDESK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tree": {
"schema": 1,
"sections": [
{
"id": "s_hero_cta",
"type": "cta_section",
"version": "1",
"settings": {
"heading": "Eid collection — new arrivals",
"cta_label": "Shop the collection",
"cta_link": {
"type": "url",
"url": "/products"
},
"image": "asset:placeholder-hero",
"overlay": "soft"
},
"blocks": []
}
]
}
}'const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/validate");
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"tree": {
"schema": 1,
"sections": [
{
"id": "s_hero_cta",
"type": "cta_section",
"version": "1",
"settings": {
"heading": "Eid collection — new arrivals",
"cta_label": "Shop the collection",
"cta_link": {
"type": "url",
"url": "/products"
},
"image": "asset:placeholder-hero",
"overlay": "soft"
},
"blocks": []
}
]
}
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
payload = {
"tree": {
"schema": 1,
"sections": [
{
"id": "s_hero_cta",
"type": "cta_section",
"version": "1",
"settings": {
"heading": "Eid collection — new arrivals",
"cta_label": "Shop the collection",
"cta_link": {
"type": "url",
"url": "/products",
},
"image": "asset:placeholder-hero",
"overlay": "soft",
},
"blocks": [],
},
],
},
}
response = requests.post(
"https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/validate",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$payload = json_encode([
'tree' => [
'schema' => 1,
'sections' => [
[
'id' => 's_hero_cta',
'type' => 'cta_section',
'version' => '1',
'settings' => [
'heading' => 'Eid collection — new arrivals',
'cta_label' => 'Shop the collection',
'cta_link' => [
'type' => 'url',
'url' => '/products',
],
'image' => 'asset:placeholder-hero',
'overlay' => 'soft',
],
'blocks' => [],
],
],
],
]);
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/pages/REPLACE_WITH_ID/validate');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/validateStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Path parameters
Paste a key above to enable Send.
Responses
200The findings;validis false when there are errors.401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.404No such page in the active theme of this store. Popups and landing pages are not served here.409The store has no active theme installation yet (NO_ACTIVE_THEME): install one in the dashboard first.422Validation failed —error.fieldsmaps each offending field to its messages.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"valid": false,
"errors": [
{
"path": "/sections/0/settings/heading",
"code": "REQUIRED",
"message": "Heading is required"
}
],
"warnings": [
{
"path": "/sections/0/settings/heading",
"code": "REQUIRED",
"message": "Heading is required"
}
]
}List the section catalogue
/ext/v1/storefront/sectionsstorefront:readEvery section a page may hold: slug, name, category, a short description, the page context it needs (contexts), where it may be placed (surfaces), its latest version and whether it is deprecated. Filter by category, page_type or search; read a section's full settings schema with GET /storefront/sections/{slug}. Company-scoped keys must pass store_id: a design belongs to one store.
Query parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Restrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store. |
category | string | Only sections of this registry category. |
page_type | string | Only sections that may be placed on this kind of page: a section passes when it needs no page context, or the context this page provides (product, collection, cart, search).homeproductcollectioncartsearchcustomlayout |
search | string | Case-insensitive substring of the slug, name or description. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS "https://api.shopdeskbd.com/ext/v1/storefront/sections" \
-H "Authorization: Bearer $SHOPDESK_API_KEY"const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/sections");
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const { data } = await response.json();import os
import requests
response = requests.get(
"https://api.shopdeskbd.com/ext/v1/storefront/sections",
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
page = response.json()
rows = page["data"]<?php
$key = getenv('SHOPDESK_API_KEY');
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/sections');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key],
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}
$rows = $response['data'];https://api.shopdeskbd.com/ext/v1/storefront/sections?category=hero&search=bannerStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Query parameters
Blank fields are left out of the request.
Paste a key above to enable Send.
Responses
200The sections.401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.409The store has no active theme installation yet (NO_ACTIVE_THEME): install one in the dashboard first.422Validation failed —error.fieldsmaps each offending field to its messages.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"data": [
{
"slug": "image_banner",
"name": "Image banner",
"category": "hero",
"description": "A full-width image with a heading and a button.",
"contexts": [],
"surfaces": [
"page",
"landing"
],
"latest_version": "2.1.0",
"status": "active"
}
]
}Get a section schema
/ext/v1/storefront/sections/{slug}storefront:readOne section's settings and blocks as JSON Schema (blocks with their min/max), its defaults, and the colour token names a token:<name> value may use. A deprecated section names its replacement when one is known. Company-scoped keys must pass store_id: a design belongs to one store.
Path parameters
| Name | Type | Description |
|---|---|---|
slugrequired | string | The section slug, from GET /storefront/sections. |
Query parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Restrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS "https://api.shopdeskbd.com/ext/v1/storefront/sections/REPLACE_WITH_ID" \
-H "Authorization: Bearer $SHOPDESK_API_KEY"const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/sections/REPLACE_WITH_ID");
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
response = requests.get(
"https://api.shopdeskbd.com/ext/v1/storefront/sections/REPLACE_WITH_ID",
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/sections/REPLACE_WITH_ID');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key],
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/sections/image_bannerStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Path parameters
Query parameters
Blank fields are left out of the request.
Paste a key above to enable Send.
Responses
200The section schema.401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.404No such section (or it is not available to pages).409The store has no active theme installation yet (NO_ACTIVE_THEME): install one in the dashboard first.422Validation failed —error.fieldsmaps each offending field to its messages.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"slug": "image_banner",
"name": "Image banner",
"category": "hero",
"status": "active",
"version": "2.1.0",
"deprecated_replacement": null,
"contexts": [],
"surfaces": [
"page",
"landing"
],
"schema": {},
"defaults": {},
"token_names": [
"primary",
"primary-500",
"surface"
]
}Get the theme settings
/ext/v1/storefront/theme-settingsstorefront:readThe live design tokens (colours, fonts, radius, spacing), the draft if there is one, and the schema a write must follow: the brand colour families, the font slots and ids, the radius and spacing keys. Company-scoped keys must pass store_id: a design belongs to one store.
Query parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Restrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS "https://api.shopdeskbd.com/ext/v1/storefront/theme-settings" \
-H "Authorization: Bearer $SHOPDESK_API_KEY"const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/theme-settings");
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
},
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
response = requests.get(
"https://api.shopdeskbd.com/ext/v1/storefront/theme-settings",
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/theme-settings');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key],
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/theme-settingsStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
Query parameters
Blank fields are left out of the request.
Paste a key above to enable Send.
Responses
200The theme settings.401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.409The store has no active theme installation yet (NO_ACTIVE_THEME): install one in the dashboard first.422Validation failed —error.fieldsmaps each offending field to its messages.429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"live": {},
"draft": null,
"has_draft": false,
"schema": {}
}Save the theme settings draft
/ext/v1/storefront/theme-settings/draftstorefront:writeWrites the design-token draft: merge (default) merges settings into the current draft, or into the live tokens when there is no draft; replace makes settings the whole draft. Values must follow the schema of GET /storefront/theme-settings. Shoppers see the live tokens until the draft is published. Company-scoped keys pass store_id in the body.
Headers
| Name | Type | Description |
|---|---|---|
Idempotency-Key | string | Optional, but honored: send it to make retries of this request safe. |
Body parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Target store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store. |
settingsrequired | object | Design tokens by group (colors, fonts, radius, spacing), in the forms GET /storefront/theme-settings lists under schema. |
mode | stringdefault merge | merge (default) merges settings into the current draft (or the live tokens when there is no draft); replace makes settings the whole draft, which must then hold every live colour family, font slot, radius and spacing key.mergereplace |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS -X PUT "https://api.shopdeskbd.com/ext/v1/storefront/theme-settings/draft" \
-H "Authorization: Bearer $SHOPDESK_API_KEY" \
-H "Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47" \
-H "Content-Type: application/json" \
-d '{
"settings": {
"colors": {
"primary": "#0f766e"
},
"radius": {
"md": "10px"
}
},
"mode": "merge"
}'const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/theme-settings/draft");
const response = await fetch(url, {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
"Content-Type": "application/json",
},
body: JSON.stringify({
"settings": {
"colors": {
"primary": "#0f766e"
},
"radius": {
"md": "10px"
}
},
"mode": "merge"
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
payload = {
"settings": {
"colors": {
"primary": "#0f766e",
},
"radius": {
"md": "10px",
},
},
"mode": "merge",
}
response = requests.put(
"https://api.shopdeskbd.com/ext/v1/storefront/theme-settings/draft",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$payload = json_encode([
'settings' => [
'colors' => [
'primary' => '#0f766e',
],
'radius' => [
'md' => '10px',
],
],
'mode' => 'merge',
]);
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/theme-settings/draft');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/theme-settings/draftStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
generating…A new value is generated whenever you edit this request, and kept while you do not — so sending twice without changing anything is a real retry and comes back Idempotent-Replayed: true instead of writing again.
Paste a key above to enable Send.
Responses
200The draft now stored.400AnIdempotency-Keyheader was sent but is empty or longer than 255 characters (VALIDATION_ERROR;error.fieldsnames the header).401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.409the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with thisIdempotency-Keyis still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.422A token is refused (VALIDATION_ERROR):error.fieldsis keyed by JSON pointer intosettings(/colors/primary), each holding a code —TOKEN_GROUP_UNKNOWN,TOKEN_FAMILY_UNKNOWN,TOKEN_VALUE_INVALID, orTOKEN_MISSING(areplacewithout a live key).429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"draft": {},
"has_draft": true,
"warnings": [
{
"path": "/sections/0/settings/heading",
"code": "REQUIRED",
"message": "Heading is required"
}
]
}Publish the theme settings
/ext/v1/storefront/theme-settings/publishstorefront:publishPuts the design-token draft live for every page at once, in two calls. First call WITHOUT confirmation_token: nothing changes; the answer is a preview with a summary of what would go live and a single-use confirmation_token (10 minutes), or no_changes (no token). Show the summary to a person; then call again with the token AND an Idempotency-Key header to publish. If what was previewed changed in between, the confirm is refused (409 PREVIEW_STALE): preview again. A confirm uses its token up once it reaches the token check; a confirm refused earlier — for a missing Idempotency-Key, a 404/409 from the fence, or (menus) item validation — leaves it usable. The preview lists the changed tokens as JSON pointers (/colors/primary). No draft answers no_changes. Company-scoped keys pass store_id in the body.
Headers
| Name | Type | Description |
|---|---|---|
Idempotency-Key | string | Optional, but honored: send it to make retries of this request safe. |
Body parameters
| Name | Type | Description |
|---|---|---|
store_id | uuid | Target store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store. |
confirmation_token | string | Leave it out to get a preview and a token. Send the token from that preview (with an Idempotency-Key header) to confirm: it is single-use and lives 10 minutes. |
Request
export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"
curl -sS -X POST "https://api.shopdeskbd.com/ext/v1/storefront/theme-settings/publish" \
-H "Authorization: Bearer $SHOPDESK_API_KEY" \
-H "Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47" \
-H "Content-Type: application/json" \
-d '{}'const url = new URL("https://api.shopdeskbd.com/ext/v1/storefront/theme-settings/publish");
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SHOPDESK_API_KEY}`,
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message} [${error.request_id}]`);
}
const object = await response.json();import os
import requests
payload = {}
response = requests.post(
"https://api.shopdeskbd.com/ext/v1/storefront/theme-settings/publish",
json=payload,
headers={
"Authorization": f"Bearer {os.environ['SHOPDESK_API_KEY']}",
"Idempotency-Key": "3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47",
},
timeout=30,
)
if not response.ok:
error = response.json()["error"]
raise RuntimeError(f"{error['code']}: {error['message']}")
obj = response.json()<?php
$key = getenv('SHOPDESK_API_KEY');
$payload = json_encode((object) []);
$ch = curl_init('https://api.shopdeskbd.com/ext/v1/storefront/theme-settings/publish');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key, 'Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$response = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException("{$response['error']['code']}: {$response['error']['message']}");
}https://api.shopdeskbd.com/ext/v1/storefront/theme-settings/publishStored in this browser only and never sent anywhere except to the API host you picked above — these pages are static files with no server behind them.
generating…A new value is generated whenever you edit this request, and kept while you do not — so sending twice without changing anything is a real retry and comes back Idempotent-Replayed: true instead of writing again.
Paste a key above to enable Send.
Responses
200The preview, the publish, orno_changes.400AnIdempotency-Keyheader was sent but is empty or longer than 255 characters (VALIDATION_ERROR;error.fieldsnames the header).401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.403The key's scopes do not cover this endpoint.409What was previewed changed before the confirm (PREVIEW_STALE: ask for a new preview), or the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with thisIdempotency-Keyis still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.422The confirm was refused: the token is unknown, expired, not this key's or from another route's preview (error.fields.confirmation_token = ['unknown_or_expired']), or a token came without anIdempotency-Keyheader (error.fields.idempotency_key = ['required_with_confirmation_token']) (VALIDATION_ERROR).429Rate limit exceeded for this key. HonorRetry-Afterand theX-RateLimit-*headers.
Every failure uses the one error envelope — Errors lists each code and what to do with it.
{
"status": "preview",
"subject": "page:5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"summary": null,
"warnings": [
{
"path": "/sections/0/settings/heading",
"code": "REQUIRED",
"message": "Heading is required"
}
],
"confirmation_token": "a3f1c9e07b5d42e8a3f1c9e07b5d42e8a3f1c9e07b5d42e8a3f1c9e07b5d42e8",
"expires_at": "2026-08-11T10:00:00.000Z",
"revision_id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
"revision_version": 4,
"published_at": "2026-08-11T10:00:00.000Z",
"first_publish": false
}