Operations with products

Operations with Product - GET, INSERT, UPDATE, DELETE, PUT, PATCH

GET all products from store

Request Type: GET

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

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


GET product by ID

Request Type: GET

Enter the request URL: http://StoreURL/odata/product('ID')

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

Filter products
GET /odata/product?$filter

Request Type: GET

Enter the request URL: http://StoreUrl/odata/product?$filter=Name eq 'adidas Consortium Campus 80s Running Shoes'

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

It will show you only product which name is equal to "adidas Consortium Campus 80s Running Shoes".

How to add new product
POST /odata/product

Request Type: POST

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

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. 

How to update product in your store
POST /odata/product

Request Type: POST

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

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.

How to partially update product in your store
PATCH /odata/product('id')

Request Type: PATCH

Enter the request URL: http://StoreURL/odata/product('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 PATCH request, so you enter only field that have changed. 

How to update whole product in your store
PUT /odata/product('id')

Request Type: PUT

Enter the request URL: http://StoreURL/odata/product('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 PUT request, so you have to enter all fields that appear in that product, also the id field. 

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

Request Type: DELETE

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

Update Stock
POST /odata/product('id')/UpdateStock

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/UpdateStock

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, section with EntityAction. 

Assign product to category
POST /odata/product('id')/CreateProductCategory

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/CreateProductCategory

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, section with EntityAction. In the case of CreateProductCategory, it's more complicated.

How to update product category
POST /odata/product('id')/UpdateProductCategory

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/UpdateProductCategory

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, section with EntityAction. 

How to delete product category
POST /odata/product('id')/DeleteProductCategory

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/DeleteProductCategory

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, section with EntityAction. In the case of DeleteProductCategory it's just CategoryId.

How to assign product to collection
POST /odata/product('id')/CreateProductCollection

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/CreateProductCollection

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, section with EntityAction.

How to update product collection
POST /odata/product('id')/UpdateProductCollection

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/UpdateProductCollection

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, section with EntityAction. 

How to delete product collection
POST /odata/product('id')/DeleteProductCollection

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/DeleteProductCollection

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, section with EntityAction. 

How to add product picture
POST /odata/product('id')/CreateProductPicture

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/CreateProductPicture

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, section with EntityAction. This method requires more actions from you. First of all, you need to know picture Id, so we need to upload picture first. 

How to update product picture
POST /odata/product('id')/UpdateProductPicture

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/UpdateProductPicture

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, section with EntityAction.

You need to know the MIME Type, list of MIME types can be found here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types

How to delete product picture
POST /odata/product('id')/DeleteProductPicture

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/DeleteProductPicture

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, section with EntityAction.

{
"PictureId":"ID of Picture"
}

How to add tier price
POST /odata/product('id')/CreateProductTierPrice

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/CreateProductTierPrice

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, section with EntityAction. 

How to update product tier price
POST /odata/product('id')/UpdateProductTierPrice

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/UpdateProductTierPrice

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, section with EntityAction.

How to delete product tier price
POST /odata/product('id')/DeleteProductTierPrice

Request Type: POST

Enter the request URL: http://StoreURL/odata/product('ID')/DeleteProductTierPrice

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, section with EntityAction.