|
According to the API documentation, in the body we would include When I do a GET on a product that has this particular piece of data, this is what I get back (The remainder of the response is truncated for brevity): This doesn't appear to be an array at all; however since this is the only custom attribute assigned to this specific product, I'm willing to assume it will only return an array if there's more than one attribute. To take it one step further, it looks like a key-value pair rather than String as indicated in the documentation. Regardless of whether I use POST, PUT, or PATCH, (using the same credentials as when I succeeded on the GET) I receive an error when I try to send up the following in the body: The error I'm getting back is: |
Replies: 3 comments 13 replies
|
I remember something being weird with this endpoint. I think you're right that it wants a dictionary; however, the other oddity I recall was that it didn't accept underscores in the key names. The underscores needed to be a [space] character.... even though the returned result uses underscores in the key names. Try using spaces instead of underscores in your POST. EDIT: Only use spaces for the custom attribute keys. All other keys should have underscores. i.e. {
"sku": "your_sku",
"custom_attributes": {
"dnd size category":"Medium"
}
} |
|
It looks like the documentation is incorrect. The custom_attributes should receive an object. Could you try sending an object and report results here? |
|
I was able to get it working! When I saw that it was escaping the quotes I changed the way I was passing the parameter (I gave the exact JSON rather than let n8n do it for me) and it worked. It totally trampled the attributes that were already there and replaced them with only the single attribute I passed in, but it worked. Luckily, it was just test data.
Now, how do we go about getting the documentation updated so that it shows
custom_attributestake key-value-pairs rather than just a string?