Problem with API product attribute value assigment


Trying to update some attribute values for a product that is already created…Maybe I am going incorrect about it as I can’t get it to work…Tried multiple times

Use following API PUT Request

api/v1/ProductAttributeValue/{Product ID}

With following body

“name”: “test”,
“productId”: “{product id}”,
“attributeId”: “{attribute id}”,
“value”: “test”

I am getting a 200 response, but no values shows up under the productid ? Done allot of other API Requests without any issues.

Hi tlab
PUT request must be as follow: api/v1/ProductAttributeValue/{ProductAttributeValueId}, in the request it is necessary to transfer the value {“value”: “…”}

Thanks…@tetiana_treopim…Maybe I am missing something as I tried following for testing and no value got applied.

I grabbed the id from a ProductAtttribute that belong to product: 5d59f5334cde00cdc

“id”: “5d59f5a239bcd19d1”,
“name”: null,
“deleted”: false,
“sRequired”: false,
“value”: null,
“data”: null,
“scope”: “Global”,
“isCustom”: true,
“attributeType”: “text”,
“createdAt”: “2019-08-19 01:04:34”,
“modifiedAt”: “2019-08-19 01:04:34”,
“valueFrCa”: null,
“valueEnUs”: null,
“valueEnGb”: null,
“productId”: “5d59f5334cde00cdc”,
“productName”: “XXXXXXXXXXXX”
“attributeId”: “5d57f273cc9192396”,
“attributeName”: “Reason For Add”,
“createdById”: “1”,
“createdByName”: “Admin”,
“modifiedById”: null,
“modifiedByName”: null,
“ownerUserId”: “1”,
“ownerUserName”: “Admin”,
“assignedUserId”: “1”,
“assignedUserName”: “Admin”

As Per your response. I made a PUT Request


With following body

{“value”: “test value”}

I get a 200 Response and but if I check product id: 5d59f5334cde00cdc, the Attribute value has not been applied to attribute id - 5d57f273cc9192396

Please help me understand what I am missing here


Please check, if there are in treo logs data/logs some errors, when updating the attribute value. Please check also, if you set in title of request the Content-Type: application/json

Thanks…I resolved it…Looks like one of the values in the response was missing a " :slight_smile: Sorry.

Other quick question (And I have looked around in the API for an answer, but can’t find…

How do I allocate a Product to a category via a API Call ?

You should send a POST-request to /api/v1/ProductCategory, in the request it is needed to transfer categoryId, productId, scope. The category must belong to the catalog, which is specified for the product.

1 Like