Skip to main content

Category

By using this api, you can manage categories of your products.

Models

Category

type Category {
id: ID!
categoryPath: [String!]
categoryPathItems: [CategoryPathItem!]
conditions: [CategoryCondition!]
description: String
imageId: String
isAutomated: Boolean
metaData: HTMLMetaData
name: String!
orderType: CategoryProductsOrderTypeEnum
parentId: String
salesChannelIds: [String!]
salesChannels: [CategorySalesChannel!]
shouldMatchAllConditions: Boolean
translations: [CategoryTranslation!]
}

Fields

idID!required
categoryPath[String!]

It is the id list information where the ids of all the superclasses of the category are found.

categoryPathItems[CategoryPathItem!]

It is the id list information where the ids of all the superclasses of the category are found.

descriptionString

It is the description of the category of the product.

imageIdString

It is the id where the picture of the category is kept in the system.

isAutomatedBoolean
metaDataHTMLMetaData

It is the metadata information of the product category.

nameString!required

It is the name of the category in which the product is located.

parentIdString

It is the id of the superclass category of the category.

salesChannelIds[String!]

It is the information of which sales channel the product category is in.

List of hidden sales channels of the category.

shouldMatchAllConditionsBoolean

It is the translation information of the product category.

CategoryCondition

type CategoryCondition {
conditionType: CategoryConditionTypeEnum!
method: CategoryConditionMethodEnum
valueList: [String!]!
}

Fields

conditionTypeCategoryConditionTypeEnum!required
valueList[String!]!required

CategoryTranslation

type CategoryTranslation {
description: String
locale: String!
name: String
}

Fields

descriptionString

It is the description information of the translation.

localeString!required

It is the name information of the translation.

nameString

It is the information in which language the translation is saved.

Queries

List Categories

Using this api, you can view the categories of products. Search applies to following fields: name

listCategory(
categoryPath: CategoryPathFilterInput
id: StringFilterInput
name: StringFilterInput
search: String
updatedAt: DateFilterInput
): [Category!]!

Arguments

You can filter according to the category path of the product.

You can filter according to the name of the category.

searchString

Some listing APIs have searchable fields. You can search in these fields as you wish. For example, in an API; Let the searchableFields :['name', 'description']. If we send search: AAA as input in args, it will return records with 'AAA' in both the name and description fields.

Return Type

CategoryCategory

Mutations

Save Category

Using this api, you can update the categories of products.

saveCategory(
input: CategoryInput!
): Category!

Arguments

inputCategoryInput!required

Return Type

CategoryCategory

Delete Category List

Using this api, you can delete the categories of products.

deleteCategoryList(
idList: [String!]!
): Boolean!

Arguments

idList[String!]!required

Return Type

BooleanBoolean

The Boolean scalar type represents true or false.

Examples

Retrieves a list of categories

curl --location --request POST 'https://api.myikas.com/api/v1/admin/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--data-raw '{"query":"{ listCategory { id name } }"}'

Response

{
"data": {
"listProductAttribute": {
"data": [
{
"id": "a8befae6-2cb9-487a-bd7f-5e0bfff3676b",
"name": "Category name",
"createdAt": 1634019877744
}
]
}
}
}