Kategorie

Operations with manufacturers

Operations with manufacturers - GET, INSERT, UPDATE, DELETE

How to get all manufacturers 
GET /odata/manufacturer

Request Type: GET

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

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

List of all manufacturers - Get in API

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

Request Type: GET

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

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

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

Get manufacturer by id - results screen

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

Request Type: DELETE

Enter the request URL: http://StoreURL/odata/manufacturer('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 manufacturer
POST /odata/manufacturer

Request Type: POST

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

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 manufacturer. 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": "Lenovo",
"SeName": "lenovo",
"Description": null,
"ManufacturerTemplateId": null,
"MetaKeywords": null,
"MetaDescription": null,
"MetaTitle": null,
"PictureId": null,
"PageSize": 0,
"AllowCustomersToSelectPageSize": false,
"PageSizeOptions": null,
"PriceRanges": null,
"ShowOnHomePage": false,
"FeaturedProductsOnHomaPage": false,
"IncludeInTopMenu": false,
"Icon": null,
"Published": false,
"DisplayOrder": 0,
"Id": "Leave it empty"
}

How to update manufacturer
POST /odata/manufacturer

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 manufacturer, if you want to update the manufacturer, you have to enter all fields that exist and in the ID field, enter the ID of manufacturer which you want update. You can use JSON presented in the previous chapter.

 

back to top