Upload Theme Static Assets

🔒

Requires write_themes access scope. More access scope

The Upload Theme API allows users to upload a theme to the store using a ZIP file. This enables merchants to customize their store's appearance by applying new themes or updating existing ones.

This API is especially useful for:

  1. Uploading a new theme to customize store appearance.
  2. Updating or replacing an existing theme for a shop programmatically.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Path Parameters

NameTypeRequiredDescriptionExample
theme_idStringYesThe unique ID of the theme.1500021b-88ed-4750-bbc5-97ec98351dc0

Body Parameters

NameTypeRequiredDescriptionExample
fileFileYesThe static asset file to be uploaded. Must be provided as a multipart form-data file.styles.css

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

FieldTypeDescriptionExample
ObjectA successful response returns an empty object {} indicating the file upload was successful.{}

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsArray[ "file number error"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
422Unprocessable EntityThe file is existed."文件已存在"

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!