Pages

Create and manage custom storefront pages

GET /admin/api/pages

List all custom storefront pages. Optionally filter by search term.

Parameters

Name Type Required Description
search string optional Case-insensitive search on title or slug

Response 200

[
  {
    "id": 1,
    "slug": "about-us",
    "title": "About Us",
    "published": true,
    "created_at": "2025-11-10T08:00:00Z",
    "updated_at": "2025-11-15T12:30:00Z"
  },
  {
    "id": 2,
    "slug": "terms",
    "title": "Terms & Conditions",
    "published": true,
    "created_at": "2025-11-10T08:05:00Z",
    "updated_at": "2025-11-10T08:05:00Z"
  },
  {
    "id": 3,
    "slug": "faq",
    "title": "FAQ",
    "published": false,
    "created_at": "2025-11-12T14:00:00Z",
    "updated_at": "2025-11-12T14:00:00Z"
  }
]

Example

curl "https://yourshop.zeroshop.io/admin/api/pages?search=about" \
  -H "Authorization: Bearer zspat_..."
POST /admin/api/pages

Create a new custom storefront page. A default Tera template is generated automatically in the active theme.

Request Body

{
  "slug": "about-us",
  "title": "About Us",
  "meta_title": "About Acme",
  "meta_description": "Hand-curated goods, made by humans.",
  "og_image_media_id": 14
}

Response 201

{
  "id": 1,
  "slug": "about-us",
  "title": "About Us",
  "published": false,
  "created_at": "2025-11-10T08:00:00Z",
  "updated_at": "2025-11-10T08:00:00Z"
}

Example

curl -X POST "https://yourshop.zeroshop.io/admin/api/pages" \
  -H "Authorization: Bearer zspat_..." \
  -H "Content-Type: application/json" \
  -d '{"slug": "about-us", "title": "About Us"}'
GET /admin/api/pages/{id}

Get a single page with its Tera template content from the active theme.

Parameters

Name Type Required Description
id integer required Page ID

Response 200

{
  "id": 1,
  "slug": "about-us",
  "title": "About Us",
  "published": true,
  "meta_title": "About Acme",
  "meta_description": "Hand-curated goods, made by humans.",
  "og_image_media_id": 14,
  "og_image_url": "https://cdn.zeroshop.io/acme/og-about.webp",
  "content": "{% extends \"base.html\" %}\n\n{% block content %}\n<main class=\"page-content\">\n  <h1>{{ t.page_about_us_title | default(value='About Us') }}</h1>\n</main>\n{% endblock %}",
  "created_at": "2025-11-10T08:00:00Z",
  "updated_at": "2025-11-15T12:30:00Z"
}

Example

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

Update a page's metadata and optionally its template content. All fields are optional; omitted fields are unchanged.

Parameters

Name Type Required Description
id integer required Page ID

Request Body

{
  "title": "About Our Company",
  "slug": "about-us",
  "published": true,
  "content": "{% extends \"base.html\" %}\n\n{% block content %}\n<main>\n  <h1>About Our Company</h1>\n  <p>We make great things.</p>\n</main>\n{% endblock %}"
}

Response 200

{
  "id": 1,
  "slug": "about-us",
  "title": "About Our Company",
  "published": true,
  "created_at": "2025-11-10T08:00:00Z",
  "updated_at": "2025-11-20T14:00:00Z"
}

Example

curl -X PUT "https://yourshop.zeroshop.io/admin/api/pages/1" \
  -H "Authorization: Bearer zspat_..." \
  -H "Content-Type: application/json" \
  -d '{"title": "About Our Company", "published": true}'
DELETE /admin/api/pages/{id}

Delete a custom page and its templates across all themes.

Parameters

Name Type Required Description
id integer required Page ID

Response 204

Example

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

List every per-locale meta translation for a page, returned as a flat array of {field, locale, value} entries. Only meta_title and meta_description are stored here; the default-locale values live on the page row itself (see GET /admin/api/pages/{id}).

Parameters

Name Type Required Description
id integer required Page ID

Response 200

[
  {
    "field": "meta_title",
    "locale": "fr",
    "value": "À propos d'Acme"
  },
  {
    "field": "meta_description",
    "locale": "fr",
    "value": "Des produits soignés, faits par des humains."
  },
  {
    "field": "meta_title",
    "locale": "de",
    "value": "Über Acme"
  }
]

Example

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

Replace all per-locale meta translations for a page with the supplied entries. The entire set is overwritten in one shot. Only meta_title and meta_description fields are accepted; any other field name returns 422. Default-locale values must be set on the page row via PUT /admin/api/pages/{id}, not here. Returns 204 No Content.

Parameters

Name Type Required Description
id integer required Page ID

Request Body

{
  "entries": [
    {
      "field": "meta_title",
      "locale": "fr",
      "value": "À propos d'Acme"
    },
    {
      "field": "meta_description",
      "locale": "fr",
      "value": "Des produits soignés, faits par des humains."
    }
  ]
}

Response 204

Example

curl -X PUT "https://yourshop.zeroshop.io/admin/api/pages/1/translations" \
  -H "Authorization: Bearer zspat_..." \
  -H "Content-Type: application/json" \
  -d '{
    "entries": [
      {"field": "meta_title", "locale": "fr", "value": "À propos d'\''Acme"},
      {"field": "meta_description", "locale": "fr", "value": "Des produits soignés, faits par des humains."}
    ]
  }'

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.