Asset

Version 2019-10

Theme assets are the individual files that make up a shop's theme.

A theme's assets include its templates, images, stylesheets, and extra snippets of code. They are arranged among the theme's directories, such as layout, templates, and assets. You can use the Asset resource to add, change, or remove asset files from a shop's theme. For a complete list of theme directories, see Theme structure.

To learn how to create your own theme, see Building themes.

What you can do with Asset

The Shopify API lets you do the following with the Asset resource. More detailed versions of these general actions may be available:

Asset properties

attachment
"attachment": "R0lGODlhAQABAPABAP///wAAACH5Ow==\n"

A base64-encoded image.

content_type
read-only
"content_type": "image/gif"

The MIME representation of the content, consisting of the type and subtype of the asset.

created_at
read-only
"created_at": "2010-07-12T15:31:50-04:00"

The date and time (ISO 8601 format) when the asset was created.

key
"key": "assets/bg-body-green.gif"

The path to the asset within a theme. It consists of the file's directory and filename. For example, the asset assets/bg-body-green.gif is in the assets directory, so its key is assets/bg-body-green.gif.

public_url
read-only
"public_url": "http://static.shopify.com/assets/bg.gif?1"

The public-facing URL of the asset.

size
read-only
"size": 1542

The asset size in bytes.

theme_id
read-only
"theme_id"