Categories

Operations with categories

Operations with Categories - GET, INSERT, UPDATE, DELETE

How to get all categories 
GET /odata/category

Request Type: GET

Enter the request URL: http://StoreURL/odata/category

Auth type: Bearer Token - paste the token generated in the previous steps

List of all categories - Get in API

How to get category by id
GET /odata/category('id')

Request Type: GET

Enter the request URL: http://StoreURL/odata/category('id')

Auth type: Bearer Token - paste the token generated in the previous steps

As a result you will get only category with specified ID. 

Get category bi id - results screen

How to delete category
DELETE /odata/category('id')

Request Type: DELETE

Enter the request URL: http://StoreURL/odata/category('id')

Auth type: Bearer Token - paste the token generated in the previous steps

Please note that in DELETE operations, you will get only "Status: 200 OK" information if the item was successfully deleted.

Delete category result

 

How to add new category
POST /odata/category

Request Type: POST

Enter the request URL: http://StoreURL/odata/category

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page.

URGENT: You don't have to specify all fields. You can add only that fields, which are important for you. Below you will find a full request to add a category. Edit fields which you want, the rest can be removed and they will get a default value. Please note that Name is required and ID has to be empty.

{
"Name": "Enter the name of category",
"Description": null,
"CategoryTemplateId": null,
"MetaKeywords": null,
"MetaDescription": null,
"MetaTitle": null,
"SeName": "",
"ParentCategoryId": "",
"PictureId": null,
"PageSize": 0,
"AllowCustomersToSelectPageSize": false,
"PageSizeOptions": null,
"PriceRanges": null,
"ShowOnHomePage": false,
"FeaturedProductsOnHomaPage": false,
"IncludeInTopMenu": false,
"Published": false,
"DisplayOrder": 0,
"Flag": null,
"FlagStyle": null,
"Icon": null,
"HideOnCatalog": false,
"ShowOnSearchBox": false,
"SearchBoxDisplayOrder": 0,
"Id": "leave it empty"
}

How to update category
POST /odata/category

Request Type: POST

Enter the request URL: http://StoreURL/odata/category

Auth type: Bearer Token - paste the token generated in the previous steps

Headers: In the Key field enter the Content-Type, in Value field enter the application/json, description is empty.

Body: In the body field you need to enter the proper JSON. Which fields are necessary for specified actions you can check in the bottom of $metadata page.

URGENT: Unlike adding a new category, if you want to update the category, you have to enter all fields that exist and enter the ID of manufacturer which you want update. You can use JSON presented in the previous chapter.

 

back to top