# tagsAdd - admin-graphql - MUTATION
Version: 2025-01

## Description
Add tags to an order, a draft order, a customer, a product, or an online store article.

### Access Scopes



## Arguments
* [id](/docs/api/admin-graphql/2025-01/scalars/ID): ID! - The ID of a resource to add tags to.
* [tags](/docs/api/admin-graphql/2025-01/scalars/String): String! - A list of tags to add to the resource. Can be an array of strings or a single string composed of a comma-separated list of values. Example values: `["tag1", "tag2", "tag3"]`, `"tag1, tag2, tag3"`.


## Returns
* [node](/docs/api/admin-graphql/2025-01/interfaces/Node): Node The object that was updated.
* [userErrors](/docs/api/admin-graphql/2025-01/objects/UserError): UserError! The list of errors that occurred from executing the mutation.


## Examples
### Add tags to a customer
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation addTags($id: ID!, $tags: [String!]!) { tagsAdd(id: $id, tags: $tags) { node { id } userErrors { message } } }\",\n \"variables\": {\n    \"id\": \"gid://shopify/Customer/544365967\",\n    \"tags\": \"one, two, three\"\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation addTags($id: ID!, $tags: [String!]!) {\n      tagsAdd(id: $id, tags: $tags) {\n        node {\n          id\n        }\n        userErrors {\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"id\": \"gid://shopify/Customer/544365967\",\n      \"tags\": \"one, two, three\"\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation addTags($id: ID!, $tags: [String!]!) {\n    tagsAdd(id: $id, tags: $tags) {\n      node {\n        id\n      }\n      userErrors {\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"id\": \"gid://shopify/Customer/544365967\",\n  \"tags\": \"one, two, three\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation addTags($id: ID!, $tags: [String!]!) {\n    tagsAdd(id: $id, tags: $tags) {\n      node {\n        id\n      }\n      userErrors {\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"id\": \"gid://shopify/Customer/544365967\",\n      \"tags\": \"one, two, three\"\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation addTags($id: ID!, $tags: [String!]!) {\n  tagsAdd(id: $id, tags: $tags) {\n    node {\n      id\n    }\n    userErrors {\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "id": "gid://shopify/Customer/544365967",
  "tags": "one, two, three"
}
#### Graphql Response
{
  "data": {
    "tagsAdd": {
      "node": {
        "id": "gid://shopify/Customer/544365967"
      },
      "userErrors": []
    }
  }
}

### Add tags to a product
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation addTags($id: ID!, $tags: [String!]!) { tagsAdd(id: $id, tags: $tags) { node { id } userErrors { message } } }\",\n \"variables\": {\n    \"id\": \"gid://shopify/Product/20995642\",\n    \"tags\": \"one, two, three\"\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation addTags($id: ID!, $tags: [String!]!) {\n      tagsAdd(id: $id, tags: $tags) {\n        node {\n          id\n        }\n        userErrors {\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"id\": \"gid://shopify/Product/20995642\",\n      \"tags\": \"one, two, three\"\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation addTags($id: ID!, $tags: [String!]!) {\n    tagsAdd(id: $id, tags: $tags) {\n      node {\n        id\n      }\n      userErrors {\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"id\": \"gid://shopify/Product/20995642\",\n  \"tags\": \"one, two, three\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation addTags($id: ID!, $tags: [String!]!) {\n    tagsAdd(id: $id, tags: $tags) {\n      node {\n        id\n      }\n      userErrors {\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"id\": \"gid://shopify/Product/20995642\",\n      \"tags\": \"one, two, three\"\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation addTags($id: ID!, $tags: [String!]!) {\n  tagsAdd(id: $id, tags: $tags) {\n    node {\n      id\n    }\n    userErrors {\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "id": "gid://shopify/Product/20995642",
  "tags": "one, two, three"
}
#### Graphql Response
{
  "data": {
    "tagsAdd": {
      "node": {
        "id": "gid://shopify/Product/20995642"
      },
      "userErrors": []
    }
  }
}

### Attempt to add tags to an product that does not exist
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation addTags($id: ID!, $tags: [String!]!) { tagsAdd(id: $id, tags: $tags) { node { id } userErrors { message } } }\",\n \"variables\": {\n    \"id\": \"gid://shopify/Product/12345\",\n    \"tags\": \"one, two, three\"\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation addTags($id: ID!, $tags: [String!]!) {\n      tagsAdd(id: $id, tags: $tags) {\n        node {\n          id\n        }\n        userErrors {\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"id\": \"gid://shopify/Product/12345\",\n      \"tags\": \"one, two, three\"\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation addTags($id: ID!, $tags: [String!]!) {\n    tagsAdd(id: $id, tags: $tags) {\n      node {\n        id\n      }\n      userErrors {\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"id\": \"gid://shopify/Product/12345\",\n  \"tags\": \"one, two, three\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation addTags($id: ID!, $tags: [String!]!) {\n    tagsAdd(id: $id, tags: $tags) {\n      node {\n        id\n      }\n      userErrors {\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"id\": \"gid://shopify/Product/12345\",\n      \"tags\": \"one, two, three\"\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation addTags($id: ID!, $tags: [String!]!) {\n  tagsAdd(id: $id, tags: $tags) {\n    node {\n      id\n    }\n    userErrors {\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "id": "gid://shopify/Product/12345",
  "tags": "one, two, three"
}
#### Graphql Response
{
  "data": {
    "tagsAdd": {
      "node": null,
      "userErrors": [
        {
          "message": "Product does not exist"
        }
      ]
    }
  }
}