Skip to main content

Page

The Page API returns the store's custom pages and the HTML content of a single page. Both endpoints are open to anonymous visitors.

All Ajax API requests should use locale-aware URLs to give visitors a consistent experience.

List the custom pages of the store

GET /{locale}/api/front/pages

List the custom pages of the store, with the content and the SEO fields of each page.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/front/pages?page=1&per_page=10')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    pagenumber

    The page of results to return.

    per_pagenumber

    The number of pages per page of results. Defaults to 10.

Response

    data object

    The response payload.

    pagenumber

    Current page number.

    per_pagenumber

    Number of records returned per page.

    pages object[]

    List of custom pages.

  • Array [
  • idnumber

    ID of the custom page.

    store_idnumber

    ID of the store the object belongs to.

    originstring

    Where the page comes from.

    titlestring

    Title of the custom page.

    contentstring

    HTML content of the page.

    statusnumber

    Status of the custom page; 1 means active.

    created_atstring

    Creation time, in ISO-8601 format.

    updated_atstring

    Last update time, in ISO-8601 format.

    independent_seoboolean

    Whether SEO settings are managed independently.

    urlstring

    Relative URL of the custom page.

    meta_titlestring

    SEO title used in the page metadata.

    meta_keywordstring

    SEO keywords used in the page metadata.

    meta_descriptionstring

    SEO description used in the page metadata.

  • ]
  • countnumber

    Number of custom pages returned.

    has_morenumber

    Whether more records are available.

    msgstring

    Result message returned with the response.

    statenumber

    Request result flag; success or 0 means the request succeeded.

Get a custom page

GET /{locale}/api/front/pages/{page_id}

Get one custom page by id.

Example request

fetch(window.SHOPLAZZA.routes.root + '/api/front/pages/13594997')
.then((response) => response.json())
.then((data) => {
// do something...
});

Request parameters

    page_idnumber

    The id of the custom page.

Response

    data object

    The response payload.

    idnumber

    ID of the custom page.

    store_idnumber

    ID of the store the object belongs to.

    originstring

    Where the page comes from.

    titlestring

    Title of the custom page.

    contentstring

    HTML content of the page.

    statusnumber

    Status of the custom page; 1 means active.

    created_atstring

    Creation time, in ISO-8601 format.

    updated_atstring

    Last update time, in ISO-8601 format.

    independent_seoboolean

    Whether SEO settings are managed independently.

    urlstring

    Relative URL of the custom page.

    meta_titlestring

    SEO title used in the page metadata.

    meta_keywordstring

    SEO keywords used in the page metadata.

    meta_descriptionstring

    SEO description used in the page metadata.

    msgstring

    Result message returned with the response.

    statenumber

    Request result flag; success or 0 means the request succeeded.