Tag

Tags are a way to group products for filtering on your store. They can be used to limit which products a coupon or sale applies to.

Tags have a name, description, and a url-safe slug for easy linking on your store.

Tags can be added to a product in the product configuration. Tags can also be used to dynamically build a navigation header for your store using navlinks.


The Tag object

  • Fields

  • Name
    id
    Type
    integer
    Tags
    Description

    id of the tag

  • Name
    store_id
    Type
    integer
    Tags
    Description

    id of the store the tag belongs to

  • Name
    slug
    Type
    string
    Tags
    Description

    A URL-safe version of the tag name

  • Name
    name
    Type
    string
    Tags
    Description

    name of the tag

  • Name
    description
    Type
    string
    Tags
    NULLABLE
    Description

    A description of what the tag represents

  • Name
    enabled
    Type
    boolean
    Tags
    Description

    Indicates if the tag is enabled

  • Name
    created_by
    Type
    user
    Tags
    Description

    the user who created the tag

  • Name
    created_at
    Type
    time
    Tags
    Description

    time when the tag was created

  • Name
    updated_by
    Type
    user
    Tags
    NULLABLE
    Description

    the user who most recently updated the tag

  • Name
    updated_at
    Type
    time
    Tags
    NULLABLE
    Description

    time when the tag was last updated

The Tag object

{
    "id": 123,
    "store_id": 456,
    "slug": "example-tag",
    "name": "Example Tag",
    "description": "This is an example tag.",
    "enabled": true,
    "created_by": {
        "id": "11084680073842688",
        "email": "[email protected]",
        "first_name": "Example",
        "last_name": "Exampleson",
        "created_at": "2023-04-13T01:26:04Z"
    },
    "created_at": "2023-04-13T01:26:04Z",
    "updated_by": {
        "id": "11084680073842688",
        "email": "[email protected]",
        "first_name": "Example",
        "last_name": "Exampleson",
        "created_at": "2023-04-13T01:26:04Z"
    },
    "updated_at": "2023-04-14T01:26:04Z"
}

Get Tags

This endpoint fetches all the tags associated with a specified store ID.

Returns

Returns an array of Tag objects.

Request

Get Tags Response

[
    {
        "id": 789,
        "store_id": 456,
        "slug": "newtag",
        "name": "NewTag",
        "description": "This is a new tag.",
        "enabled": true,
        "created_by": {
            "id": "11084680073842688",
            "email": "[email protected]",
            "first_name": "Example",
            "last_name": "Exampleson",
            "created_at": "2023-04-13T01:26:04Z"
        },
        "created_at": "2023-04-13T01:26:04Z",
        "updated_by": null,
        "updated_at": null
    },
    {
        // ...other tags
    }
]

Get Tag

This endpoint fetches a single tag based on the provided store and tag ID.

Returns

Returns a Tag object.

Get Tag Response

{
    "id": 789,
    "store_id": 456,
    "slug": "newtag",
    "name": "NewTag",
    "description": "This is a new tag.",
    "enabled": true,
    "created_by": {
        "id": "11084680073842688",
        "email": "[email protected]",
        "first_name": "Example",
        "last_name": "Exampleson",
        "created_at": "2023-04-13T01:26:04Z"
    },
    "created_at": "2023-04-13T01:26:04Z",
    "updated_by": null,
    "updated_at": null
}

Update Tag

This endpoint updates the details of a specified tag based on the provided store and tag ID. All fields are optional, and only the fields provided will be updated.

  • Fields

  • Name
    slug
    Type
    string?
    Tags
    OPTIONAL
    Description

    A URL-safe version of the tag name

  • Name
    name
    Type
    string?
    Tags
    OPTIONAL
    Description

    name of the tag

  • Name
    enabled
    Type
    boolean?
    Tags
    OPTIONAL
    Description

    Indicates if the tag is enabled

  • Name
    description
    Type
    string?
    Tags
    OPTIONAL
    Description

    A description of what the tag represents (1 - 50,000 characters)

Returns

Returns the updated Tag object.

Update Tag Request

{
    "slug": "updated-tag",
    "name": "Updated Tag",
    "enabled": false,
    "description": "This is an updated tag."
}

Update Tag Response

{
    "id": 789,
    "store_id": 456,
    "slug": "updated-tag",
    "name": "Updated Tag",
    "description": "This is an updated tag.",
    "enabled": false,
    "created_by": {
        "id": "11084680073842688",
        "email": "[email protected]",
        "first_name": "Example",
        "last_name": "Exampleson",
        "created_at": "2023-04-13T01:26:04Z"
    },
    "created_at": "2023-04-13T01:26:04Z",
    "updated_by": {
        "id": "11084680073842688",
        "email": "[email protected]",
        "first_name": "Example",
        "last_name": "Exampleson",
        "created_at": "2023-04-13T01:26:04Z"
    },
    "updated_at": "2023-04-14T01:26:04Z"
}

Delete Tag

Deletes a specified tag based on the provided store and tag ID.

Returns

Returns HTTP 204 indicating that the tag has been successfully deleted.

Response

HTTP 204