post https://{shopdomain}.myshoplaza.com/openapi/2022-01/themes//doc
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:
- Uploading a new theme to customize store appearance.
- Updating or replacing an existing theme for a shop programmatically.
Request Parameters
Public Request Parameters
Body Parameters
Name | Type | Required | Example | Description |
---|---|---|---|---|
name | string | Optional | My Custom Theme | Theme name. |
version | string | Optional | 1.0.0 | Theme version. |
file | file | Yes | theme.zip | Theme ZIP file to upload. |
Response Explanation
Public Response Parameters
Successful Response
Name | Type | Example | Description |
---|---|---|---|
task.id | string | a772624d-db91-45d9-9e57-fdca9b4c50ed | Unique ID of the upload task. |
task.store_id | integer | 633130 | Store ID where the theme is uploaded. |
task.type | string | themes | Task type, e.g., themes . |
task.status | integer | 0 | Status of the upload (0 for pending). |
task.created_at | string | 2024-04-30 06:14:38 | Upload creation time. |
task.updated_at | string | 2024-04-30 06:14:38 | Last updated time of the upload task. |
task.info | string | {"remote_url":"http://shoplaza-themes.oss-cn-shenzhen.aliyuncs.com/625936069942069724.zip"} | JSON string containing upload details. |
task.message | string | "" | Message associated with the task (if any). |
task.manifest | string | "" | Additional manifest information (if available). |
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.
Field | Type | Example | Description |
---|---|---|---|
errors | Array | [ "file number error"] | A list of errors encountered during the request processing. |
Field | Type | Example | Description |
---|---|---|---|
error | String | "store is not active" | Indicates an error encountered during the process |
Error Detail
Status Code | Message | Possible Reason | Example Response |
---|---|---|---|
400 | Bad Request | Invalid input format or request structure (e.g., missing required fields or incorrect data types). | Bad Request |
Unauthorized | The request is missing valid authentication credentials or the credentials provided are invalid. | Unauthorized | |
422 | Internal Server Error | The file has existed. | 文件已存在 |