Categories

Operations with product attributes

Operations with ProductAttributes - GET, INSERT, UPDATE, DELETE

How to get all product attributes
GET /odata/productattribute

Request Type: GET

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

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

Get all product attributes

How to get product attribute by id
GET /odata/productattribute('id')

Request Type: GET

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

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

Get product by id results screen

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

Request Type: DELETE

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

Request Type: POST

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

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. 

{
    "Name": "Attribute added via API with values",
    "Description": null,
    "Id": "",
    "PredefinedProductAttributeValues": [
        {
        "Name": "test",
        "PriceAdjustment": 0,
        "WeightAdjustment": 0,
        "Cost": 0,
        "IsPreSelected": false,
        "DisplayOrder": 0,
        "Id": ""
        },
        {
        "Name": "test dwa",
        "PriceAdjustment": 0,
        "WeightAdjustment": 0,
        "Cost": 0,
        "IsPreSelected": false,
        "DisplayOrder": 0,
        "Id": ""
        }
        ]
}

 

How to update product attribute
POST /odata/productattribute

Request Type: POST

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

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. You can use the previous body request. Please note that you need to have all fields in your request.

How to partially update product attribute
PATCH /odata/productattribute('id')

Request Type: PATCH

Enter the request URL: http://StoreURL/odata/productattribute('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: Please note that it's PATCH request, so you don't need to provide all fields in your request.

How to update whole product attribute
PUT /odata/productattribute('id')

Request Type: PUT

Enter the request URL: http://StoreURL/odata/productattribute('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: Please note that it's PUT request, so you have to provide all fields in your request, also with the "id" field.

back to top