Requires The user must have write_themes and write_theme_api permissions. If you think that your app is eligible for an exemption and should have access to this API, then you can submit an exception request.

Creates a theme using an external URL or for files that were previously uploaded using the stagedUploadsCreate mutation. These themes are added to the Themes page in Shopify admin.


The name of the theme to be created.

Anchor to source
source
required

An external URL or a staged upload URL of the theme to import.


Was this section helpful?

The theme that was created.

The list of errors that occurred from executing the mutation.


Was this section helpful?

Examples

Hide code
Copy
mutation themeCreate($source: URL!, $name: String!) {
  themeCreate(source: $source, name: $name) {
    theme {
      name
      role
    }
    userErrors {
      field
      message
    }
  }
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation themeCreate($source: URL!, $name: String!) { themeCreate(source: $source, name: $name) { theme { name role } userErrors { field message } } }",
 "variables": {
    "source": "http://www.example.com/dawn.zip",
    "name": "Dawn"
  }
}'
const { admin } = await authenticate.admin(request);

const response = await admin.graphql(
  `#graphql
  mutation themeCreate($source: URL!, $name: String!) {
    themeCreate(source: $source, name: $name) {
      theme {
        name
        role
      }
      userErrors {
        field
        message
      }
    }
  }`,
  {
    variables: {
      "source": "http://www.example.com/dawn.zip",
      "name": "Dawn"
    },
  },
);

const data = await response.json();
session = ShopifyAPI::Auth::Session.new(
  shop: "your-development-store.myshopify.com",
  access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
  session: session
)

query = <<~QUERY
  mutation themeCreate($source: URL!, $name: String!) {
    themeCreate(source: $source, name: $name) {
      theme {
        name
        role
      }
      userErrors {
        field
        message
      }
    }
  }
QUERY

variables = {
  "source": "http://www.example.com/dawn.zip",
  "name": "Dawn"
}

response = client.query(query: query, variables: variables)
const client = new shopify.clients.Graphql({session});
const data = await client.query({
  data: {
    "query": `mutation themeCreate($source: URL!, $name: String!) {
      themeCreate(source: $source, name: $name) {
        theme {
          name
          role
        }
        userErrors {
          field
          message
        }
      }
    }`,
    "variables": {
      "source": "http://www.example.com/dawn.zip",
      "name": "Dawn"
    },
  },
});
use Shopify\Clients\Graphql;

$client = new Graphql("your-development-store.myshopify.com", $accessToken);
$query = <<<QUERY
  mutation themeCreate($source: URL!, $name: String!) {
    themeCreate(source: $source, name: $name) {
      theme {
        name
        role
      }
      userErrors {
        field
        message
      }
    }
  }
QUERY;

$variables = [
  "source" => "http://www.example.com/dawn.zip",
  "name" => "Dawn",
];

$response = $client->query(["query" => $query, "variables" => $variables]);
Hide code
Input variables
Copy
{
  "source": "http://www.example.com/dawn.zip",
  "name": "Dawn"
}
Hide code
Response
JSON
{
  "themeCreate": {
    "theme": {
      "name": "Dawn",
      "role": "UNPUBLISHED"
    },
    "userErrors": []
  }
}