0

I have configurable product added, sku KudosConfig. I have added an attributes called kudos_size and kudos_colour which have values of Small, Medium, Large and Green, Pink, Orange respectively. The next step, I thought, was to add the 9 simple products with appropriate attribute value set for both kudos_size and kudos_colour. To do this I am using the following request:

 PUT https://example.com/rest/V1/products/KudosConfigGreenSmall

The body of the request is:

{
 "product":{
 "sku":"KudosConfigGreenSmall ",
 "name":"Kudos Configurable Green Small",
 "price":30.00,
 "status":0,
 "type_id":"simple",
 "attribute_set_id":4,
 "weight":1,
 "custom_attributes":[
 {
 "attribute_code":"kudos_colour",
 "value":"Green"
 },
 {
 "attribute_code":"kudos_size",
 "value":"Small"
 }
 ]
 }

This however returns a http 400 bad request response with message:

Error occurred during "custom_attributes" processing. Attribute "kudos_colour" has invalid value. Invalid type for value: "Green". Expected Type: "int".

I don't understand why it is expecting an integer, all the values in the setup are strings.

asked Jan 18, 2017 at 11:02

1 Answer 1

0

I think I understand now. Instead of passing the actual value you need to pass in the value id which you can get from the catalogProductAttributeOptionManagementV1 service. Have tried this and now working.

answered Jan 19, 2017 at 11:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.