Skip to content

Upgrade a theme to a newer major version

POST
/stores/{storeRef}/themes/{id}/upgrade
curl --request POST \
--url https://apibase.ecomweb.app/api/v1/stores/example/themes/example/upgrade \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "major": 2 }'

Makes a copy of the theme on the newest release of a newer major version of its catalog theme, with the setting values migrated. The original theme is unchanged and stays as the way back; the store changes only when you publish the copy. The report lists what the migration renamed, removed and dropped. The route answers 409 when there is no newer major or it is not available. Counts toward the number of themes the plan allows. Needs the write:settings scope.

Required scopes: write:settings

id
required
string

The theme ID of the source.

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
major
required

The major to upgrade to

number
>= 2

Example

2
Media typeapplication/json
object
theme
required

The new theme, on the newer major version. The original theme is unchanged.

object
settings_values
required

The saved setting values, by setting ID.

object
key
additional properties
any
settings_schema
required

The settings the version in use declares, as a list of groups. Each group has a name and settings, a list of setting definitions (id, type, label, default and so on).

Array<object>
object
key
additional properties
any
mode
required

theme: a catalog release. custom: your code, built by EcomWeb. headless: a link to your own site.

string
Allowed values: theme custom headless
current_version
required

The version the theme uses.

object
kind
required

release: a catalog release. build: a deployment of your code. link: your own site.

string
Allowed values: release build link
created_at
required

When the version was added, as an ISO 8601 timestamp.

string format: date-time
deployment_id

The deployment ID. Only for a build.

string
url

The site address. Only for a link.

string
release_version

The catalog release version. Only for a release.

string
id
required

Version ID.

string
label
required

A short name for the version, such as the release number.

string
latest_release
required

The newest catalog release on a newer major version than the theme’s, or null when there is none.

object
version
required

The release’s version.

string
preview
required

The preview of the build in use, or null when the theme does not use a build or is live.

object
state
required

off: not asked for in the last 24 hours. starting: asked for, not up yet. running: up.

string
Allowed values: off starting running
until
required

When the preview stops, as an ISO 8601 timestamp, or null when it is not running.

string format: date-time
nullable
url
required

The preview’s address.

string
thumbnail_url
required

The address of the theme’s screenshot, or null until one is taken.

string
nullable
created_at
required

When the theme was created, as an ISO 8601 timestamp.

string format: date-time
updated_at
required

When the theme was last updated, as an ISO 8601 timestamp.

string format: date-time
kind
required

Deprecated: use mode and current_version. hosted is a release, custom a build and external a link.

string
Allowed values: hosted custom external
deployed
required

Deprecated: use mode. Whether a build is in use.

boolean
current_deployment
required

Deprecated: use current_version. The build in use, or null.

object
created_at
required

When the deployment was created, as an ISO 8601 timestamp.

string format: date-time
build_finished_at
required

When the build ended, as an ISO 8601 timestamp, or null.

string format: date-time
nullable
store_theme_id
required

The theme the build was deployed to, which differs from this theme for a copy.

string
nullable
id
required

Deployment ID.

string
source_version
required

Deprecated: use current_version. The catalog release version the theme comes from.

string
preview_url
required

Deprecated: use preview. The preview’s address, or null.

string
nullable
id
required

Theme ID.

string
name
required

Theme name.

string
is_published
required

Whether this is the live theme, the one shoppers see.

boolean
source_theme_id
required

ID of the catalog theme this theme comes from, such as default.

string
has_settings
required

Whether the version in use has settings to edit.

boolean
versions_count
required

How many versions the theme has.

number
report
required

What the upgrade did to the setting values.

object
renamed
required

Settings that were renamed.

Array<object>
object
from
string
to
string
removed
required

Settings that were removed.

Array<string>
mapped
required

Values that were converted to another value.

Array<object>
object
key
string
from
string
to
One of:
string
copied
required

Values that were copied from one setting to another.

Array<object>
object
from
string
to
string
defaulted
required

Settings that were reset to their default.

Array<string>
dropped
required

Values the new version did not accept. They are not kept.

Array<object>
object
key
required

The setting ID.

string
message
required

Why the value was dropped.

string
from_version
required

The version the theme moved from.

string
to_version
required

The version the theme moved to.

string

Example

{
"theme": {
"mode": "theme",
"current_version": {
"kind": "release"
},
"preview": {
"state": "off"
},
"kind": "hosted"
}
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The request conflicts with the resource’s current state.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}