---
title: "Create theme"
description: "create theme api"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/online-store/theme/create-theme'
  md: 'https://developer.shopline.com/docs/admin-rest-api/online-store/theme/create-theme.md'
---
# Create theme

create theme api

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_themes`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
POST /themes.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Required Permissions

* `write_themes`

## Request

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

### Request Body

* `role`

  integer

  published : The theme is published.
  unpublished :The theme is unpublished.
  development : The theme is used for development.

* `src`

  string

  Theme resource link

* `name`

  string

  Theme name

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `theme`

  object

  Theme information

  * `created_at`

    long

    The date and time of when the theme was created

  * `id`

    string

    id

  * `name`

    string

    The name of the theme.

  * `role`

    integer

    The status of the theme

  * `theme_store_id`

    string

    store ID

  * `updated_at`

    long

    The date and time of when the theme was last updated

* `check_errors`

  array<object>

  Check errors info

  * `message`

    array<string>

    Message of error info

  * `type`

    string

    Type of error info

  * `filename`

    string

    Filename of error info


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "description": "create theme api",
  "externalDocs": {
    "description": "Permission point used by the interface is `write_themes` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": ""
  },
  "operationId": "EQoOTAOG",
  "parameters": [
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API. Please refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then put the obtained access token into the API request header in Bearer Token.",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "role": {
              "name": "role",
              "description": "published : The theme is published.\nunpublished :The theme is unpublished.\ndevelopment : The theme is used for development.",
              "type": "integer",
              "example": 0
            },
            "src": {
              "name": "src",
              "description": "Theme resource link",
              "type": "string",
              "example": ""
            },
            "name": {
              "name": "name",
              "description": "Theme name",
              "type": "string",
              "example": ""
            }
          },
          "required": [
            "name"
          ],
          "example": {
            "name": "",
            "role": 0,
            "src": ""
          }
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "theme": {
                "name": "theme",
                "description": "Theme information",
                "type": "object",
                "properties": {
                  "created_at": {
                    "name": "created_at",
                    "description": "The date and time of when the theme was created",
                    "type": "long",
                    "example": 0
                  },
                  "id": {
                    "name": "id",
                    "description": "id",
                    "type": "string",
                    "example": "627d1003d4baa549bf5b83f9"
                  },
                  "name": {
                    "name": "name",
                    "description": "The name of the theme.",
                    "type": "string",
                    "example": "demo_theme"
                  },
                  "role": {
                    "name": "role",
                    "description": "The status of the theme",
                    "type": "integer",
                    "example": 0
                  },
                  "theme_store_id": {
                    "name": "theme_store_id",
                    "description": "store ID",
                    "type": "string",
                    "example": "1631700219512"
                  },
                  "updated_at": {
                    "name": "updated_at",
                    "description": "The date and time of when the theme was last updated",
                    "type": "long",
                    "example": 0
                  }
                },
                "example": {
                  "id": "627d1003d4baa549bf5b83f9",
                  "name": "demo_theme",
                  "role": 0,
                  "theme_store_id": "1631700219512",
                  "updated_at": 0,
                  "created_at": 0
                }
              },
              "check_errors": {
                "name": "check_errors",
                "description": "Check errors info",
                "type": "array",
                "items": {
                  "name": "check_errors",
                  "description": "Check errors info",
                  "type": "object",
                  "properties": {
                    "message": {
                      "name": "message",
                      "description": "Message of error info",
                      "type": "array",
                      "items": {
                        "name": "message",
                        "description": "Message of error info",
                        "type": "string",
                        "example": ""
                      },
                      "example": [
                        ""
                      ]
                    },
                    "type": {
                      "name": "type",
                      "description": "Type of error info",
                      "type": "string",
                      "example": ""
                    },
                    "filename": {
                      "name": "filename",
                      "description": "Filename of error info",
                      "type": "string",
                      "example": ""
                    }
                  },
                  "example": {
                    "type": "",
                    "filename": "",
                    "message": [
                      ""
                    ]
                  }
                },
                "example": [
                  {
                    "filename": "",
                    "message": [
                      ""
                    ],
                    "type": ""
                  }
                ]
              }
            },
            "example": {
              "check_errors": [
                {
                  "filename": "",
                  "message": [
                    ""
                  ],
                  "type": ""
                }
              ],
              "theme": {
                "updated_at": 0,
                "created_at": 0,
                "id": "627d1003d4baa549bf5b83f9",
                "name": "demo_theme",
                "role": 0,
                "theme_store_id": "1631700219512"
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/themes.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Create theme",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_themes"
  ]
}
```