Developers & AI

Tutorial: Theme batch edit and preview

Apply a validated batch to a draft theme and open a signed preview URL.

  1. Prerequisites: a connected OAuth or API key with themes:read, themes:write, themes:preview (and themes:create if you need a new draft).

  2. Step 1: get_context — note draftThemeId / workflow.next. Reuse a draft when one exists.

  3. Step 2: get_theme_schema — note allowed section types (for example hero) and setting keys.

  4. Step 3: If needed, create_theme with a name and provider (claude or cursor).

  5. Step 4: apply_theme_batch with operations that match the schema. Invalid ops fail closed — fix and retry rather than half-applying.

  6. Step 5: Alternatively update_section for a single section when you only need a small change.

  7. Step 6: preview_theme (MCP) or POST /api/v1/themes/:id/preview-token (REST). Copy previewUrl.

  8. Step 7: Open the preview in a private window. Confirm hero/copy/layout. Iterate with another batch if needed.

  9. Step 8: Leave publishing to the merchant UI unless themes:publish is explicitly granted.

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