ShopdeskDevelopers
shopdeskbd.com

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

GET/ext/v1/storefront/designstorefront:read

The 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

NameTypeDescription
store_iduuidRestrict 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"
Try itruns from your browser
GEThttps://api.shopdeskbd.com/ext/v1/storefront/design

Stored 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.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

GET/ext/v1/storefront/mediastorefront:read

The 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

NameTypeDescription
store_iduuidRestrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store.
limitnumberdefault 50max 100Page size.
starting_afterstringReturn the page AFTER this item's key (the previous page's next_cursor).
searchstringCase-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"
Try itruns from your browser
GEThttps://api.shopdeskbd.com/ext/v1/storefront/media?starting_after=companies%2F5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001%2Fmedia%2Fbanner-1700000000.webp&search=banner

Stored 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.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-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.

Example 200 response
{
  "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

POST/ext/v1/storefront/media/generatemedia:generate

Generates 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

NameTypeDescription
Idempotency-KeyrequiredstringREQUIRED. 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

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
promptrequiredstringWhat the image shows, 1–1,000 characters after trimming. Sent to the AI provider.
aspectstringdefault squaresquare (1024×1024, the default), landscape (1536×1024) or portrait (1024×1536).squarelandscapeportrait
namestringThe 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"
}'
Try itruns from your browser
POSThttps://api.shopdeskbd.com/ext/v1/storefront/media/generate

Stored 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.

Valid JSON
Idempotency-Keyrequired
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 required Idempotency-Key header is missing, empty, or longer than 255 characters (VALIDATION_ERROR; error.fields names the header).
  • 401Missing/invalid API key, revoked or expired key, plan without API access, or a dead store.
  • 403The key lacks media: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 this Idempotency-Key is still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.
  • 422The body is not valid (VALIDATION_ERROR, error.fields names 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, with Retry-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.

Example 200 response
{
  "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

POST/ext/v1/storefront/media/importstorefront:write

Downloads 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

NameTypeDescription
Idempotency-KeystringOptional, but honored: send it to make retries of this request safe.

Body parameters

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
imagesrequiredStorefrontMediaImportEntryDto[]Up to 10 images, stored all or none.

images[] fields

NameTypeDescription
urlrequiredstringThe https link to download.
namestringThe 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"
    }
  ]
}'
Try itruns from your browser
POSThttps://api.shopdeskbd.com/ext/v1/storefront/media/import

Stored 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.

Valid JSON
Idempotency-Keyoptional
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.
  • 400An Idempotency-Key header was sent but is empty or longer than 255 characters (VALIDATION_ERROR; error.fields names 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 this Idempotency-Key is still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.
  • 422A link was refused or is not an image (error.fields names 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, with Retry-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.

Example 200 response
{
  "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"
    }
  ]
}

List the menus

GET/ext/v1/storefront/menusstorefront:read

The navigation menus with their items (include_items=false for handles, names and item counts only). Company-scoped keys must pass store_id: a design belongs to one store.

Query parameters

NameTypeDescription
store_iduuidRestrict 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_itemsbooleandefault truePass false for handles, names and counts only.

Request

export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"

curl -sS "https://api.shopdeskbd.com/ext/v1/storefront/menus" \
  -H "Authorization: Bearer $SHOPDESK_API_KEY"
Try itruns from your browser
GEThttps://api.shopdeskbd.com/ext/v1/storefront/menus

Stored 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 menus.
  • 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.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "data": [
    {
      "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
      "handle": "main-menu",
      "name": "Main menu",
      "item_count": 6,
      "updated_at": "2026-08-11T10:00:00.000Z"
    }
  ]
}

Save a menu

PUT/ext/v1/storefront/menus/{handle}storefront:publish

Creates the menu with this handle, or replaces its items (and name). Menus have no draft — a saved menu is live at once — so this is a publish, 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. Send the same body both times: the token is bound to it. The preview lists the items added, removed, relabelled, retargeted and moved. Company-scoped keys pass store_id in the body.

Path parameters

NameTypeDescription
handlerequiredstringThe menu handle (lowercase letters, digits and hyphens), from GET /storefront/menus; a new one creates the menu.

Headers

NameTypeDescription
Idempotency-KeystringOptional, but honored: send it to make retries of this request safe.

Body parameters

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
confirmation_tokenstringLeave 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.
namestringThe menu's name. Required when the handle is new (the menu is created); left out, an existing menu keeps its name.
itemsrequiredobject[]The whole item tree, replacing the current one: { id?, label, link: { type: 'none' | 'url' | 'product' | 'category' | 'page', id?, url? }, children? }, at most 4 levels and 250 items, labels up to 120 characters. Keep an item's id to keep it; an item without one is new. A url must be https, http, mailto, tel, a site path or a # fragment; a product, category or page id must exist in the store.

Request

export SHOPDESK_API_KEY="shopdesk_sk_YOUR_API_KEY"

curl -sS -X PUT "https://api.shopdeskbd.com/ext/v1/storefront/menus/REPLACE_WITH_ID" \
  -H "Authorization: Bearer $SHOPDESK_API_KEY" \
  -H "Idempotency-Key: 3f2b8c1e-9d4a-4e7b-8a6f-2c5d1e0b9a47" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Main menu",
  "items": [
    {
      "label": "New arrivals",
      "link": {
        "type": "url",
        "url": "/collections/new"
      }
    },
    {
      "label": "About us",
      "link": {
        "type": "page",
        "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a002"
      }
    }
  ]
}'
Try itruns from your browser
PUThttps://api.shopdeskbd.com/ext/v1/storefront/menus/main-menu

Stored 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

Valid JSON
Idempotency-Keyoptional
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 saved menu, or no_changes.
  • 400An Idempotency-Key header was sent but is empty or longer than 255 characters (VALIDATION_ERROR; error.fields names 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 this Idempotency-Key is still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.
  • 422An item is refused (error.fields['items/<i>/…']: LINK_SCHEME for a link that is not https, http, mailto, tel, a site path or a # fragment; unknown_target on items/<i>/link for a product, category or page this store does not have; invalid or too_many_items otherwise), a new menu has no name (error.fields.name = ['required_for_new_menu']), the handle is not one, or 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 an Idempotency-Key header (error.fields.idempotency_key = ['required_with_confirmation_token']) (VALIDATION_ERROR).
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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,
  "menu": {
    "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
    "handle": "main-menu",
    "name": "Main menu",
    "item_count": 6,
    "items": [
      {
        "id": "mi-1",
        "label": "Shirts",
        "link": {
          "type": "category",
          "id": "5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001",
          "url": "https://example.com/sale"
        },
        "children": [
          {}
        ]
      }
    ],
    "updated_at": "2026-08-11T10:00:00.000Z"
  }
}

Create a page

POST/ext/v1/storefront/pagesstorefront:write

A 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

NameTypeDescription
Idempotency-KeystringOptional, but honored: send it to make retries of this request safe.

Body parameters

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
titlerequiredstring—
handlestringThe address, /pages/<handle>: lower-case letters, digits and dashes. Made from the title when left out.
seoStorefrontPageSeoDto—
treeobjectThe starting draft, { schema: 1, sections: [...] }; an empty page when left out. Checked like a draft save.

seo fields

NameTypeDescription
titlestringThe browser tab and search result title.
descriptionstringThe search result and link preview description.
image_keystringThe share image: a media library key (from GET /storefront/media).
no_indexbooleanAsk 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": []
      }
    ]
  }
}'
Try itruns from your browser
POSThttps://api.shopdeskbd.com/ext/v1/storefront/pages

Stored 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.

Valid JSON
Idempotency-Keyoptional
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.
  • 400An Idempotency-Key header was sent but is empty or longer than 255 characters (VALIDATION_ERROR; error.fields names 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 this Idempotency-Key is still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.
  • 422The tree breaks a rule (VALIDATION_ERROR): error.fields is keyed by JSON pointer into the tree, each holding the finding's codes (LINK_SCHEME, TREE_TOO_LARGE, FEATURE_LOCKED, REQUIRED, …) — the same findings POST /storefront/pages/{id}/validate lists.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

GET/ext/v1/storefront/pagesstorefront:read

The 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

NameTypeDescription
store_iduuidRestrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store.
typestringOnly pages of this type.systemcustomlayout
system_keystringOnly the system page with this key (home, product, collection, cart, search, …; the layout page is layout).
handlestringOnly 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"
Try itruns from your browser
GEThttps://api.shopdeskbd.com/ext/v1/storefront/pages?system_key=home&handle=about-us

Stored 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.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

GET/ext/v1/storefront/pages/{id}storefront:read

One 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

NameTypeDescription
idrequireduuidThe page id, from GET /storefront/pages (find a page by system_key or handle there).

Query parameters

NameTypeDescription
store_iduuidRestrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store.
includestringdefault draftdraft (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"
Try itruns from your browser
GEThttps://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001

Stored 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.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

PUT/ext/v1/storefront/pages/{id}/draftstorefront:write

Replaces 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

NameTypeDescription
idrequireduuidThe page id, from GET /storefront/pages (find a page by system_key or handle there).

Headers

NameTypeDescription
Idempotency-KeystringOptional, but honored: send it to make retries of this request safe.

Body parameters

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
treerequiredobjectThe 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_atdate-timeOptimistic 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"
}'
Try itruns from your browser
PUThttps://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/draft

Stored 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

Valid JSON
Idempotency-Keyoptional
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.
  • 400An Idempotency-Key header was sent but is empty or longer than 255 characters (VALIDATION_ERROR; error.fields names 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 since base_draft_updated_at (DRAFT_CONFLICT; error.fields.base_draft_updated_at carries the current value — read the page again), or the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with this Idempotency-Key is still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.
  • 422The tree breaks a rule (VALIDATION_ERROR): error.fields is keyed by JSON pointer into the tree, each holding the finding's codes (LINK_SCHEME, TREE_TOO_LARGE, FEATURE_LOCKED, REQUIRED, …) — the same findings POST /storefront/pages/{id}/validate lists.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

PATCH/ext/v1/storefront/pages/{id}/draftstorefront:write

Applies 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

NameTypeDescription
idrequireduuidThe page id, from GET /storefront/pages (find a page by system_key or handle there).

Headers

NameTypeDescription
Idempotency-KeystringOptional, but honored: send it to make retries of this request safe.

Body parameters

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
operationsrequiredSectionOperationDto[]Applied in order to the current draft, then checked as a whole: all are saved, or none.
base_draft_updated_atdate-timeOptimistic 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

NameTypeDescription
oprequiredstringinsert_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_idstring—
block_idstring—
sectionobjectA section node { type, version, settings, blocks?, visible? }; its id is generated when absent.
blocksobject[]The section's new blocks, replacing the old ones.
settingsobjectSettings to merge; a null value removes the key.
visibleboolean—
after_idstringPlace after this section id.
before_idstringPlace before this section id.
indexnumberPlace at this index (0 is first).
groupstringLayout 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"
}'
Try itruns from your browser
PATCHhttps://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/draft

Stored 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

Valid JSON
Idempotency-Keyoptional
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.
  • 400An Idempotency-Key header was sent but is empty or longer than 255 characters (VALIDATION_ERROR; error.fields names 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 since base_draft_updated_at (DRAFT_CONFLICT; error.fields.base_draft_updated_at carries the current value — read the page again), or the store has no active theme installation yet (NO_ACTIVE_THEME); or a request with this Idempotency-Key is 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.fields by JSON pointer) (VALIDATION_ERROR).
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

POST/ext/v1/storefront/pages/{id}/publishstorefront:publish

Puts 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

NameTypeDescription
idrequireduuidThe page id, from GET /storefront/pages (find a page by system_key or handle there).

Headers

NameTypeDescription
Idempotency-KeystringOptional, but honored: send it to make retries of this request safe.

Body parameters

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
confirmation_tokenstringLeave 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.
messagestringThe 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"
}'
Try itruns from your browser
POSThttps://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/publish

Stored 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

Valid JSON
Idempotency-Keyoptional
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, or no_changes.
  • 400An Idempotency-Key header was sent but is empty or longer than 255 characters (VALIDATION_ERROR; error.fields names 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 this Idempotency-Key is still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.
  • 422The draft breaks a rule (error.fields by 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 an Idempotency-Key header (error.fields.idempotency_key = ['required_with_confirmation_token']) (VALIDATION_ERROR).
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

GET/ext/v1/storefront/pages/{id}/revisionsstorefront:read

A 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

NameTypeDescription
idrequireduuidThe page id, from GET /storefront/pages (find a page by system_key or handle there).

Query parameters

NameTypeDescription
store_iduuidRestrict 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"
Try itruns from your browser
GEThttps://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/revisions

Stored 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.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

POST/ext/v1/storefront/pages/{id}/rollbackstorefront:publish

Without 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

NameTypeDescription
idrequireduuidThe page id, from GET /storefront/pages (find a page by system_key or handle there).

Headers

NameTypeDescription
Idempotency-KeystringOptional, but honored: send it to make retries of this request safe.

Body parameters

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
confirmation_tokenstringLeave 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_idrequireduuidThe revision to go back to, from GET /storefront/pages/{id}/revisions.
publishbooleandefault falseWithout 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
}'
Try itruns from your browser
POSThttps://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/rollback

Stored 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

Valid JSON
Idempotency-Keyoptional
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.
  • 400An Idempotency-Key header was sent but is empty or longer than 255 characters (VALIDATION_ERROR; error.fields names 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 this Idempotency-Key is still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.
  • 422The restored draft breaks a rule (error.fields by 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 an Idempotency-Key header (error.fields.idempotency_key = ['required_with_confirmation_token']) (VALIDATION_ERROR).
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

POST/ext/v1/storefront/pages/{id}/validatestorefront:read

A 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

NameTypeDescription
idrequireduuidThe page id, from GET /storefront/pages (find a page by system_key or handle there).

Body parameters

NameTypeDescription
treerequiredobjectThe page tree to check — the same shape GET /storefront/pages/{id} returns as draft ({ sections: [...] }, or { groups: {...} } for the layout page).
store_iduuidThe 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": []
      }
    ]
  }
}'
Try itruns from your browser
POSThttps://api.shopdeskbd.com/ext/v1/storefront/pages/5f7d2f60-0d1c-4b3a-9a68-6f4d21f6a001/validate

Stored 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

Valid JSON

Paste a key above to enable Send.

Responses

  • 200The findings; valid is 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.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

GET/ext/v1/storefront/sectionsstorefront:read

Every 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

NameTypeDescription
store_iduuidRestrict the lookup to one store. Breadth control for company-scoped keys; on a store-scoped key it must match the key's own store.
categorystringOnly sections of this registry category.
page_typestringOnly 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
searchstringCase-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"
Try itruns from your browser
GEThttps://api.shopdeskbd.com/ext/v1/storefront/sections?category=hero&search=banner

Stored 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.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

GET/ext/v1/storefront/sections/{slug}storefront:read

One 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

NameTypeDescription
slugrequiredstringThe section slug, from GET /storefront/sections.

Query parameters

NameTypeDescription
store_iduuidRestrict 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"
Try itruns from your browser
GEThttps://api.shopdeskbd.com/ext/v1/storefront/sections/image_banner

Stored 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.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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

GET/ext/v1/storefront/theme-settingsstorefront:read

The 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

NameTypeDescription
store_iduuidRestrict 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"
Try itruns from your browser
GEThttps://api.shopdeskbd.com/ext/v1/storefront/theme-settings

Stored 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.fields maps each offending field to its messages.
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "live": {},
  "draft": null,
  "has_draft": false,
  "schema": {}
}

Save the theme settings draft

PUT/ext/v1/storefront/theme-settings/draftstorefront:write

Writes 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

NameTypeDescription
Idempotency-KeystringOptional, but honored: send it to make retries of this request safe.

Body parameters

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
settingsrequiredobjectDesign tokens by group (colors, fonts, radius, spacing), in the forms GET /storefront/theme-settings lists under schema.
modestringdefault mergemerge (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"
}'
Try itruns from your browser
PUThttps://api.shopdeskbd.com/ext/v1/storefront/theme-settings/draft

Stored 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.

Valid JSON
Idempotency-Keyoptional
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.
  • 400An Idempotency-Key header was sent but is empty or longer than 255 characters (VALIDATION_ERROR; error.fields names 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 this Idempotency-Key is still in flight (IDEMPOTENCY_IN_FLIGHT) — retry once it has finished.
  • 422A token is refused (VALIDATION_ERROR): error.fields is keyed by JSON pointer into settings (/colors/primary), each holding a code — TOKEN_GROUP_UNKNOWN, TOKEN_FAMILY_UNKNOWN, TOKEN_VALUE_INVALID, or TOKEN_MISSING (a replace without a live key).
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "draft": {},
  "has_draft": true,
  "warnings": [
    {
      "path": "/sections/0/settings/heading",
      "code": "REQUIRED",
      "message": "Heading is required"
    }
  ]
}

Publish the theme settings

POST/ext/v1/storefront/theme-settings/publishstorefront:publish

Puts 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

NameTypeDescription
Idempotency-KeystringOptional, but honored: send it to make retries of this request safe.

Body parameters

NameTypeDescription
store_iduuidTarget store. REQUIRED with a company-scoped key; with a store-scoped key it may only repeat the key's own store.
confirmation_tokenstringLeave 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 '{}'
Try itruns from your browser
POSThttps://api.shopdeskbd.com/ext/v1/storefront/theme-settings/publish

Stored 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.

Valid JSON
Idempotency-Keyoptional
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, or no_changes.
  • 400An Idempotency-Key header was sent but is empty or longer than 255 characters (VALIDATION_ERROR; error.fields names 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 this Idempotency-Key is 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 an Idempotency-Key header (error.fields.idempotency_key = ['required_with_confirmation_token']) (VALIDATION_ERROR).
  • 429Rate limit exceeded for this key. Honor Retry-After and the X-RateLimit-* headers.

Every failure uses the one error envelope — Errors lists each code and what to do with it.

Example 200 response
{
  "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
}