Packaging, import and version history
Theme packages are used to back up a theme or move it to another store. Every change to a code file is also kept in the version history.
Theme package
A package is a single JSON document: a manifest, the theme settings and the page templates (section layouts). Code files (.zone) are not part of this package; they are managed from the code editor.
{
"manifest": {
"format": "stokzone-theme",
"format_version": 1,
"name": "...",
"exported_at": "...",
"page_types": ["index", "product"],
"section_types": ["..."]
},
"settings": { },
"templates": { }
}Export and import
The endpoints are called with a panel session (the same authorisation the panel uses) and require the e-commerce module. Paths are under https://api.stokzone.com/api/v1/ecommerce/theme.
| Endpoint | Description |
|---|---|
GET /package/export | Returns the published theme as a package. |
POST /package/inspect | Inspects a package without applying it; gives a summary before import. |
POST /package/import | Applies a package. Page layouts go to the draft; with apply_settings true the settings take effect immediately. |
{
"package": { "manifest": { }, "settings": { }, "templates": { } },
"apply_settings": false
}On import the package format and version are checked; every page layout is validated and failing pages are skipped. Because pages go to the draft, visitors see no change until you publish.
Version history
Up to 50 versions are kept for each file saved in the code editor; no version is created when the content is unchanged. Going back is non-destructive: a restore is written as a new version.
The package update rule
A theme installed from a ready-made theme package can be updated to the package's newer version. An update only refreshes code files and never touches files that carry merchant data: page templates (templates/), theme setting values and section group files are preserved. A code file you edited by hand is not overwritten either; it is skipped and listed in the report.