I am trying to update base price of product by store id and product SKU using POSTMAN. But, getting error Invalid Attribute
. Sometimes it works fine. I tried to change product attributes to if it cause to this issue but it didn't resolved the issue.
Request URL -
{{url}}/V1/products/base-prices
Request Body -
{
"prices": [
{
"price": 38,
"store_id": 4,
"sku": "WEBPRICETEST"
}
]
}
Response -
[
{
"message": "Invalid attribute %fieldName = %fieldValue.",
"parameters": [
"SKU",
"WEBPRICETEST"
]
}
]
There is no any traces in error log.
CodePudding user response:
So basically if both success and error request payload are some and it gives error with few of SKUs then it may be the type of product which is causing error. The endpoint you are using will only update below types of product base price.
Simple, Virtual, Downloadable, Bundle (fixed price type only).
https://devdocs.magento.com/guides/v2.4/rest/modules/catalog-pricing.html#set-base-prices
CodePudding user response:
Magento already supports getting prices by store. You just need to add store_code and URL: {{url}}/{store code}/V1/products/base-prices