Magento 2: Setting the product url key with REST API
-
09-10-2020 - |
Domanda
Is it possible? I see no mention of a url_key
in the Swagger docs.
I have a large database of product I need to import, and the names (which seem to determine the url) are not unique.
Soluzione
Although Swagger doesn't specify "url_key", you can add this attribute value by the following method:
{
"product": {
...
"customAttributes": [
{
"attributeCode": "url_key",
"value": "<your_value>"
}
]
}
}
Note: Next time, you can use GET to know the product JSON structure first. Then any customized attributes can be created according to the JSON structure.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange