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

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. 

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.

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.

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 category which you want update. You can use JSON presented in the previous chapter.

How to partially update category
PATCH /odata/category('id')

Request Type: PATCH

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

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: It's the PATCH request, so you don't have to provide all fields. 

How to update whole category
PUT /odata/category('id')

Request Type: PUT

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

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.