Developers & AI
Tutorial: Theme batch edit and preview
Apply a validated batch to a draft theme and open a signed preview URL.
Prerequisites: a connected OAuth or API key with themes:read, themes:write, themes:preview (and themes:create if you need a new draft).
Step 1: get_context — note draftThemeId / workflow.next. Reuse a draft when one exists.
Step 2: get_theme_schema — note allowed section types (for example hero) and setting keys.
Step 3: If needed, create_theme with a name and provider (claude or cursor).
Step 4: apply_theme_batch with operations that match the schema. Invalid ops fail closed — fix and retry rather than half-applying.
Step 5: Alternatively update_section for a single section when you only need a small change.
Step 6: preview_theme (MCP) or POST /api/v1/themes/:id/preview-token (REST). Copy previewUrl.
Step 7: Open the preview in a private window. Confirm hero/copy/layout. Iterate with another batch if needed.
Step 8: Leave publishing to the merchant UI unless themes:publish is explicitly granted.
REST sketch: POST /api/v1/themes → POST /api/v1/themes/:id/sections or batch → POST …/preview-token. Examples: /developers/examples .
Was this article helpful?
Contact support