Themes

Manage themes, theme templates, and email templates

GET /admin/api/themes

List all themes with their active status and template override count.

POST /admin/api/themes

Create a new theme. Theme names must be unique.

GET /admin/api/themes/{id}

Get a single theme with its storefront and email template override lists.

PUT /admin/api/themes/{id}

Rename a theme. The Default theme (id=1) cannot be renamed. Theme names must be unique.

DELETE /admin/api/themes/{id}

Delete a theme and all its template overrides. The Default theme (id=1) and the currently active theme cannot be deleted.

POST /admin/api/themes/{id}/activate

Set a theme as the active theme. Invalidates all cached templates so the new theme takes effect immediately.

POST /admin/api/themes/{id}/duplicate

Duplicate a theme and all its template overrides into a new theme with the given name.

POST /admin/api/themes/{id}/preview

Start previewing a theme. Sets a signed cookie so the merchant sees this theme on the storefront without affecting other visitors.

DELETE /admin/api/themes/preview

Stop previewing a theme. Clears the preview cookie.

GET /admin/api/themes/{id}/templates

List all storefront templates in a theme with their override status.

GET /admin/api/themes/{id}/templates/{name}

Get the content of a storefront template within a theme. Returns the custom override if one exists, otherwise the built-in default.

PUT /admin/api/themes/{id}/templates/{name}

Save a storefront template override within a theme. Validates Tera syntax before saving.

DELETE /admin/api/themes/{id}/templates/{name}

Delete a storefront template override from a theme, reverting to the built-in default. Returns 404 if no custom override exists.

GET /admin/api/themes/{id}/email-templates

List all email templates in a theme with their override status.

GET /admin/api/themes/{id}/email-templates/{name}

Get the content of an email template within a theme. Returns the custom override if one exists, otherwise the built-in default.

PUT /admin/api/themes/{id}/email-templates/{name}

Save an email template override within a theme. Validates Tera syntax. Email templates are standalone HTML and do not extend the storefront base layout. `subject` is required and overrides the email subject line for this theme/template; it must be a single line of 200 chars or fewer. For per-locale subject overrides, write translations under the key returned as `subject_translation_key` on the GET response (typically `email_subject_<name>`) via the translations API.

DELETE /admin/api/themes/{id}/email-templates/{name}

Delete an email template override from a theme, reverting to the built-in default. Returns 404 if no custom override exists.

GET /admin/api/themes

List all themes with their active status and template override count.

Response 200

[
  {
    "id": 1,
    "name": "Default",
    "is_active": true,
    "template_count": 2,
    "created_at": "2025-11-01T00:00:00Z",
    "updated_at": "2025-12-01T10:00:00Z"
  },
  {
    "id": 2,
    "name": "Holiday 2025",
    "is_active": false,
    "template_count": 5,
    "created_at": "2025-12-10T08:00:00Z",
    "updated_at": "2025-12-15T14:30:00Z"
  }
]

Example

curl "https://yourshop.zeroshop.io/admin/api/themes" \
  -H "Authorization: Bearer zspat_..."
POST /admin/api/themes

Create a new theme. Theme names must be unique.

Request Body

{
  "name": "Holiday 2025"
}

Response 201

{
  "id": 2,
  "name": "Holiday 2025"
}

Example

curl -X POST "https://yourshop.zeroshop.io/admin/api/themes" \
  -H "Authorization: Bearer zspat_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "Holiday 2025"}'
GET /admin/api/themes/{id}

Get a single theme with its storefront and email template override lists.

Response 200

{
  "id": 1,
  "name": "Default",
  "is_active": true,
  "created_at": "2025-11-01T00:00:00Z",
  "updated_at": "2025-12-01T10:00:00Z",
  "templates": [
    {
      "name": "base",
      "has_custom": false,
      "updated_at": null
    },
    {
      "name": "home",
      "has_custom": true,
      "updated_at": "2025-12-01T10:00:00Z"
    },
    {
      "name": "product",
      "has_custom": false,
      "updated_at": null
    }
  ],
  "email_templates": [
    {
      "name": "order_confirmation",
      "has_custom": false,
      "updated_at": null
    },
    {
      "name": "shipping_notification",
      "has_custom": true,
      "updated_at": "2025-12-05T09:30:00Z"
    }
  ]
}

Example

curl "https://yourshop.zeroshop.io/admin/api/themes/1" \
  -H "Authorization: Bearer zspat_..."
PUT /admin/api/themes/{id}

Rename a theme. The Default theme (id=1) cannot be renamed. Theme names must be unique.

Request Body

{
  "name": "Winter Sale"
}

Response 204

Example

curl -X PUT "https://yourshop.zeroshop.io/admin/api/themes/2" \
  -H "Authorization: Bearer zspat_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "Winter Sale"}'
DELETE /admin/api/themes/{id}

Delete a theme and all its template overrides. The Default theme (id=1) and the currently active theme cannot be deleted.

Response 204

Example

curl -X DELETE "https://yourshop.zeroshop.io/admin/api/themes/3" \
  -H "Authorization: Bearer zspat_..."
POST /admin/api/themes/{id}/activate

Set a theme as the active theme. Invalidates all cached templates so the new theme takes effect immediately.

Response 204

Example

curl -X POST "https://yourshop.zeroshop.io/admin/api/themes/2/activate" \
  -H "Authorization: Bearer zspat_..."
POST /admin/api/themes/{id}/duplicate

Duplicate a theme and all its template overrides into a new theme with the given name.

Request Body

{
  "name": "Holiday 2025 (copy)"
}

Response 201

{
  "id": 3,
  "name": "Holiday 2025 (copy)"
}

Example

curl -X POST "https://yourshop.zeroshop.io/admin/api/themes/2/duplicate" \
  -H "Authorization: Bearer zspat_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "Holiday 2025 (copy)"}'
POST /admin/api/themes/{id}/preview

Start previewing a theme. Sets a signed cookie so the merchant sees this theme on the storefront without affecting other visitors.

Response 200

{
  "previewing_theme_id": 2
}

Example

curl -X POST "https://yourshop.zeroshop.io/admin/api/themes/2/preview" \
  -H "Authorization: Bearer zspat_..."
DELETE /admin/api/themes/preview

Stop previewing a theme. Clears the preview cookie.

Response 204

Example

curl -X DELETE "https://yourshop.zeroshop.io/admin/api/themes/preview" \
  -H "Authorization: Bearer zspat_..."
GET /admin/api/themes/{id}/templates

List all storefront templates in a theme with their override status.

Response 200

[
  {
    "name": "base",
    "has_custom": false,
    "updated_at": null
  },
  {
    "name": "home",
    "has_custom": true,
    "updated_at": "2025-12-01T10:00:00Z"
  },
  {
    "name": "product",
    "has_custom": false,
    "updated_at": null
  }
]

Example

curl "https://yourshop.zeroshop.io/admin/api/themes/1/templates" \
  -H "Authorization: Bearer zspat_..."
GET /admin/api/themes/{id}/templates/{name}

Get the content of a storefront template within a theme. Returns the custom override if one exists, otherwise the built-in default.

Response 200

{
  "name": "home",
  "content": "<h1>{{ t.home_hero_title | default(value='Welcome') }}</h1>",
  "is_custom": true
}

Example

curl "https://yourshop.zeroshop.io/admin/api/themes/1/templates/home" \
  -H "Authorization: Bearer zspat_..."
PUT /admin/api/themes/{id}/templates/{name}

Save a storefront template override within a theme. Validates Tera syntax before saving.

Request Body

{
  "content": "<h1>{{ t.home_hero_title | default(value='Welcome') }}</h1>"
}

Response 204

Example

curl -X PUT "https://yourshop.zeroshop.io/admin/api/themes/1/templates/home" \
  -H "Authorization: Bearer zspat_..." \
  -H "Content-Type: application/json" \
  -d '{"content": "<h1>Custom home page</h1>"}'
DELETE /admin/api/themes/{id}/templates/{name}

Delete a storefront template override from a theme, reverting to the built-in default. Returns 404 if no custom override exists.

Response 204

Example

curl -X DELETE "https://yourshop.zeroshop.io/admin/api/themes/1/templates/home" \
  -H "Authorization: Bearer zspat_..."
GET /admin/api/themes/{id}/email-templates

List all email templates in a theme with their override status.

Response 200

[
  {
    "name": "order_confirmation",
    "has_custom": false,
    "updated_at": null
  },
  {
    "name": "shipping_notification",
    "has_custom": true,
    "updated_at": "2025-12-05T09:30:00Z"
  }
]

Example

curl "https://yourshop.zeroshop.io/admin/api/themes/1/email-templates" \
  -H "Authorization: Bearer zspat_..."
GET /admin/api/themes/{id}/email-templates/{name}

Get the content of an email template within a theme. Returns the custom override if one exists, otherwise the built-in default.

Response 200

{
  "name": "order_confirmation",
  "content": "<html><body><h1>Thank you for your order!</h1></body></html>",
  "is_custom": true
}

Example

curl "https://yourshop.zeroshop.io/admin/api/themes/1/email-templates/order_confirmation" \
  -H "Authorization: Bearer zspat_..."
PUT /admin/api/themes/{id}/email-templates/{name}

Save an email template override within a theme. Validates Tera syntax. Email templates are standalone HTML and do not extend the storefront base layout. `subject` is required and overrides the email subject line for this theme/template; it must be a single line of 200 chars or fewer. For per-locale subject overrides, write translations under the key returned as `subject_translation_key` on the GET response (typically `email_subject_<name>`) via the translations API.

Request Body

{
  "content": "<html><body><h1>Custom order email</h1></body></html>",
  "subject": "Your order is confirmed"
}

Response 204

Example

curl -X PUT "https://yourshop.zeroshop.io/admin/api/themes/1/email-templates/order_confirmation" \
  -H "Authorization: Bearer zspat_..." \
  -H "Content-Type: application/json" \
  -d '{"content": "<html><body><h1>Custom order email</h1></body></html>", "subject": "Your order is confirmed"}'
DELETE /admin/api/themes/{id}/email-templates/{name}

Delete an email template override from a theme, reverting to the built-in default. Returns 404 if no custom override exists.

Response 204

Example

curl -X DELETE "https://yourshop.zeroshop.io/admin/api/themes/1/email-templates/order_confirmation" \
  -H "Authorization: Bearer zspat_..."

We value your privacy

We use cookies for essential site functionality and, with your consent, analytics to understand how our platform is used. No personal data is shared with third parties. See our Privacy Policy for details.