产品的主要类别存在于 DATA API 的产品文档 (primary_category_id) 中,但无法写入。在使用不同的 primary_category_id 发送产品的 PATCH 更新后,它不会更改。
有没有办法通过 OCAPI 做到这一点?
产品的主要类别存在于 DATA API 的产品文档 (primary_category_id) 中,但无法写入。在使用不同的 primary_category_id 发送产品的 PATCH 更新后,它不会更改。
有没有办法通过 OCAPI 做到这一点?
可以是PATCH Method.Fields 可以更新的一些限制:名称、page_description、long_descripton、page_title、page_keywords、brand、ean、upc、manufacturer_sku、manufacturer_name、searchable、unit、searchable、online_flag、default_variant_id。
尝试使用 PUT 方法。放置 https://hostname:port/dw/data/v19_1/products/ { id}。另外,请查看请求文件。
目前看来,这似乎无法通过 OCAPI 进行管理。
我怀疑将来您可以使用以下资源来实现它:
DELETE /catalogs/{catalog_id}/categories/{category_id}/products/{product_id}
其次是:
PUT /catalogs/{catalog_id}/categories/{category_id}/products/{product_id}
在通话中带有ProductCategoryAssignment
文件。PUT
但是,这需要 Salesforce 将这些属性添加到ProductCategoryAssignment
文档中。
我建议添加它的原因是在目录导入文档 (XML) 中,标志与类似的资源表示相关联。例如:
<category-assignment category-id="gear-bags-backpacks" product-id="NSF4003100">
<primary-flag>true</primary-flag>
</category-assignment>