Category

This section covers endpoints used for fetching, creating & updating Category list and details.


GET/api/v1/category

Get Categories

This endpoint is used to get category list in a tree format. All the sub-categories are nested inside their respective parent categories.

Request Parameters

NA - No request parameters required for this endpoint

Sample Request

Request

GET
/api/v1/category
curl --location '<api_url>/api/v1/category' \
--header 'Accept: text/plain' \
--header 'Authorization: bearer {{apiKey}}'

Response Model

Response

{
"statusCode": 200,
"status": "OK",
"error": null,
"errorId": null,
"message": null,
"messageCode": "OK",
"result": [
  {
  "id": "string",
  "name": "string",
  "subCategories": [
    "string"
  ],
  "description": "string",
  "iId": 0
}
]
}

NameTypeDescription
resultobjectContains the category object with all details
result.idintCategory id
result.namestringCategory name
result.subCategoriesarrayList of sub-categories associated with item
result.descriptionstringDescription of the category
result.iIdintiId of the category


POST/api/v1/category

Create Category

This endpoint is used to create a new category.

Request Parameters

NameTypeDescription
categoryCodestringCode of the category
categoryNamestringName of the category
parentCategoryCodestringCode of the parent category
productFamilyIdintId of the product family

Sample Request

Request

POST
/api/v1/category
curl --location --request POST '<api_url>/api/v1/category' \
--header 'Content-Type: application/json' \
--header 'Accept: text/plain' \
--header 'Authorization: {{apiKey}}'\
--data '{
"categoryCode": "string",
"categoryName": "string",
"parentCategoryCode": "string",
"productFamilyId": 0
}'

Response Model

Response

{
"isValid": true,
"message": "string",
"errors": [
"string"
],
"messageCode": "string",
"recordId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

NameTypeDescription
isValidbooleanWhether the transaction was successful or failure, true - Success, false - Failure
messagestringMessage to display on frontend (if any) in case of errors/success
errorsarrayList of error messages, if any
messageCodestringResponse message code
recordIdGuidRecord ID of the object updated / created


GET/api/v1/category/{id}

Category Detail

This endpoint is used to get category details based on category id.

Request Parameters

NameTypeDescription
idGuidId of the category

Sample Request

Request

POST
/api/v1/category
curl --location --request POST '<api_url>/api/v1/category' \
--header 'Content-Type: application/json' \
--header 'Accept: text/plain' \
--header 'Authorization: {{apiKey}}'

Response Model

Response

{
"name": "string",
"image": "string",
"slug": "string",
"displayText": "string",
"isFeatured": true,
"isGenderSpecific": true,
"parentMenuId": "string",
"displayOrder": 0,
"customSetId": "string",
"tariffCode": "string",
"description": "string",
"metaTitle": "string",
"metaDescription": "string",
"metaKeywords": "string",
"subcategories": [
{
  "parentCategoryCode": "string",
  "categoryCode": "string",
  "categoryName": "string",
  "productFamilyId": 0
}
],
"canonicalTags": "string",
"parentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parent": "string",
"link": "string",
"hasCustomSlug": true,
"customSlug": "string",
"level": 0,
"hasChild": true,
"externalRefId": 0,
"categoryCode": "string",
"prodCount": 0,
"additionalInfo1": "string",
"additionalInfo2": "string",
"additionalInfo3": "string",
"additionalInfo4": "string",
"additionalInfo5": "string",
"productFamilyId": 0,
"files": [
{
  "recordId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "mediaType": 0,
  "name": "string",
  "url": "string",
  "altText": "string",
  "isDefault": true,
  "isActive": true,
  "displayOrder": 0,
  "previewUrl": "string",
  "isMultiple": true,
  "isInternal": true
}
]
}

NameTypeDescription
namestringName of the category
imagestringImage of the category
slugstringSlug of the category
displayTextstringDisplay text of the category
isFeaturedbooleanWhether category is featured or not
isGenderSpecificbooleanWhether category is gender specific or not
parentMenuIdstringParent menu id of the category
displayOrderintegerDisplay order of the category
customSetIdstringCustom set id of the category
tariffCodestringTariff code of the category
descriptionstringDescription of the category
metaTitlestringMeta title of the category
metaDescriptionstringMeta description of the category
metaKeywordsstringMeta keywords of the category
subcategoriesList of ObjectSub-categories detail
subcategories.parentCategoryCodestringParent category code of the category
subcategories.categoryCodestringCode of the category
subcategories.categoryNamestringName of the category
subcategories.productFamilyIdintegerProduct family id of the category
canonicalTagsstringCanonical tags of the category
parentIdstringParent id of the category
parentstringParent of the category
linkstringLink of the category
customSlugstringCustom slug of the category
levelintegerLevel of the category
externalRefIdintegerExternal ref id of the category
categoryCodestringCode of the category
prodCountintegerTotal product count of the category
additionalInfo1stringAdditional info1 of the category
additionalInfo2stringAdditional info2 of the category
additionalInfo3stringAdditional info3 of the category
additionalInfo4stringAdditional info4 of the category
additionalInfo5stringAdditional info5 of the category
productFamilyIdintegerProduct family id of the category
fileslist of object
files.recordIdstringId of the file
files.mediaTypeintegerType of media, ex: 0 for Image, 1 for Video and 2 for PDF
files.namestringName of the file
files.urlstringUrl of the file
files.altTextstringAlt text of the file
files.isDefaultbooleanWhether this file is default or not
files.isActivebooleanWhether the file is active or not
files.displayOrderintegerDisplay order of the file
files.previewUrlstringPreview url of the file
files.isMultiplebooleanWhether the file has got multiple files
files.isInternalbooleanWhether the file is for internal purpose or not


PUT/api/v1/category/{id}

Update category

This endpoint is used to update details for an existing category.

Request Parameters

NameTypeDescription
namestringName of the category
imagestringImage of the category
slugstringSlug of the category
displayTextstringDisplay text of the category
isFeaturedbooleanWhether category is featured or not
isGenderSpecificbooleanWhether category is gender specific or not
parentMenuIdstringParent menu id of the category
displayOrderintegerDisplay order of the category
customSetIdstringCustom set id of the category
tariffCodestringTariff code of the category
descriptionstringDescription of the category
metaTitlestringMeta title of the category
metaDescriptionstringMeta description of the category
metaKeywordsstringMeta keywords of the category
canonicalTagsstringCanonical tags of the category
parentstringParent of the category
linkstringLink of the category
customSlugstringCustom slug of the category
levelintegerLevel of the category
externalRefIdintegerExternal ref id of the category
categoryCodestringCode of the category
prodCountintegerTotal product count of the category
additionalInfo1stringAdditional info1 of the category
additionalInfo2stringAdditional info2 of the category
additionalInfo3stringAdditional info3 of the category
additionalInfo4stringAdditional info4 of the category
additionalInfo5stringAdditional info5 of the category
productFamilyIdintegerProduct family id of the category
fileslist of object
files.recordIdstringId of the file
files.mediaTypeintegerType of media, ex: 0 for Image, 1 for Video and 2 for PDF
files.namestringName of the file
files.urlstringUrl of the file
files.altTextstringAlt text of the file
files.isDefaultbooleanWhether this file is default or not
files.isActivebooleanWhether the file is active or not
files.displayOrderintegerDisplay order of the file
files.previewUrlstringPreview url of the file
files.isMultiplebooleanWhether the file has got multiple files
files.isInternalbooleanWhether the file is for internal purpose or not

Sample Request

Request

PUT
/api/v1/category/:id
curl --location --request PUT '<api_url>/api/v1/category/{categoryId}' \
--header 'Content-Type: application/json' \
--header 'Accept: text/plain' \
--header 'Authorization: bearer {{api-key}}'\
--data '{
"name": "string",
"image": "string",
"slug": "string",
"displayText": "string",
"isFeatured": true,
"isGenderSpecific": true,
"parentMenuId": "string",
"displayOrder": 0,
"customSetId": "string",
"tariffCode": "string",
"description": "string",
"metaTitle": "string",
"metaDescription": "string",
"metaKeywords": "string",
"subcategories": [
{
  "parentCategoryCode": "string",
  "categoryCode": "string",
  "categoryName": "string",
  "productFamilyId": 0
}
],
"canonicalTags": "string",
"parentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parent": "string",
"link": "string",
"hasCustomSlug": true,
"customSlug": "string",
"level": 0,
"hasChild": true,
"externalRefId": 0,
"categoryCode": "string",
"prodCount": 0,
"additionalInfo1": "string",
"additionalInfo2": "string",
"additionalInfo3": "string",
"additionalInfo4": "string",
"additionalInfo5": "string",
"productFamilyId": 0,
"files": [
{
  "recordId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "mediaType": 0,
  "name": "string",
  "url": "string",
  "altText": "string",
  "isDefault": true,
  "isActive": true,
  "displayOrder": 0,
  "previewUrl": "string",
  "isMultiple": true,
  "isInternal": true
}
]
}'

Response Model

Response

{
"isValid": true,
"message": "string",
"errors": [
"string"
],
"messageCode": "string",
"recordId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

NameTypeDescription
isValidbooleanWhether the transaction was successful or failure, true - Success, false - Failure
messagestringMessage to display on front end (if any) in case of errors/success
errorsarrayList of error messages, if any
messageCodestringResponse message code
recordIdGuidRecord ID of the object updated / created