Customer Tags Queries

Access customer tags for segmentation and filtering.

CustomerTag — Returns a single customer tag based on the id provided

query GetCustomerTag($id: ID) {
  CustomerTag(id: $id) {
    id
    label
    active
  }
}
{
  "id": 100012
}

CustomerTags — Returns a list of customer tags with filters, ordering, and search

query CustomerTags(
  $orderBy: [QueryCustomerTagsOrderByOrderByClause!],
  $where: QueryCustomerTagsWhereWhereConditions,
  $search: String,
  $first: Int,
  $page: Int
) {
  CustomerTags(
    orderBy: $orderBy
    where: $where
    search: $search
    first: $first
    page: $page
  ) {
    paginatorInfo {
      total
      currentPage
    }
    data {
      id
      label
      active
    }
  }
}
{
  "where": {
    "AND": [
      { "column": "ACTIVE", "operator": "EQ", "value": true }
    ]
  },
  "orderBy": [
    { "column": "LABEL", "order": "ASC" }
  ],
  "search": "tag name"
}

Available fields

FieldTypeDescription
idIntUnique identifier of the tag.
labelStringName/Label of the tag.
activeBooleanTag's activation status.

Filters

You can create filters based on following fields:

id - Int
Example: { "column": "ID", "operator": "EQ", "value": 10001 }
label - String
Example: { "column": "LABEL", "operator": "LIKE", "value": "%VIP%" }
active - Boolean
Example: { "column": "ACTIVE", "operator": "EQ", "value": true }

Sorting

You can sort data based on following fields: id, label, active

query SortCustomerTags(
  $where: QueryCustomerTagsWhereWhereConditions,
  $first: Int,
  $page: Int
) {
  CustomerTags(
    where: $where
    orderBy: [{ column: LABEL, order: ASC }]
    first: $first
    page: $page
  ) {
    paginatorInfo {
      total
      currentPage
    }
    data {
      id
      label
      active
    }
  }
}

Example of data returned

{
  "data": {
    "CustomerTags": [
      {
        "id": 100001,
        "label": "Premium",
        "active": true
      },
      {
        "id": 100002,
        "label": "VIP",
        "active": true
      }
    ]
  }
}