Developers & AI

AI theme design without publishing

Draft themes, apply batches, and open signed previews. Live publish stays merchant-controlled.

  1. Ettajer’s rule for AI: agents control presentation; Ettajer controls commerce. Agents may draft themes, sections, pages, navigation, and media — they should not mutate cart, checkout, or orders.

  2. Start with get_context / GET /api/v1/context. Follow workflow.next (action + reason). If a draft already exists, reuse it instead of creating another theme.

  3. Load the schema with get_theme_schema / GET /api/v1/themes/schema so batches validate against allowed section types and settings.

  4. Create a private draft with create_theme when needed. Apply many edits safely with apply_theme_batch (fail-closed validation). You can also create_section, update_section, or delete_section for targeted changes.

  5. Open a preview: call preview_theme or POST /api/v1/themes/:id/preview-token to get a signed preview URL. Previews are short-lived. Merchants signed into the dashboard can also preview without a token.

  6. Iterate on the draft (hero, colors, sections) and re-preview. Keep themes:publish out of the AI client’s scopes so nothing goes live by accident.

  7. When the merchant is happy, they publish from Dashboard → Themes (AI Designs). Publishing with the API/MCP requires themes:publish and runs validate → transactional live apply → audit.

  8. Tenant safety: tokens cannot read or edit another merchant’s themes. Cross-store IDs return NOT_FOUND. Missing scopes return INSUFFICIENT_SCOPE.

  9. System prompt for agents: /developers/ai-system-prompt . Integration checklist: /developers/ai-integration . Theme docs: /developers/themes .

  10. Tip: after a successful preview, ask the merchant to open the preview link on mobile — most Moroccan shoppers browse on phones.

Was this article helpful?

Contact support