- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings,
I am new to Magento & its API so please excuse my newbie questions. I am on a project which is integrating NetSuite <> Magento using Dell Boomi as the integration platform. One of the things we need to do is, on a daily basis, check NetSuite for any products with MAP, MSRP or base price changes. For any records returned, update Magento with these price changes.The response from NetSuite can have 1,2 or 3 records per item/product depending on if any of those prices has changed.
My questions, at this point, are
- I can update the base price by sending a payload to the endpoint rest/default/V1/products/base-prices. Can this endpoint be used to update MAP & MSRP also? If so how is that done?
- Are there separate endpoints for updating MAP & MSRP?
- Can these price updates all be sent in one payload for a product and have all 1,2 or 3 prices update with one request? If so, what would be the API endpoint?
Thanks for any ideas/suggestions you provide - it is much appreciated.
Regards,
Joe
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vimal,
Thank you for your time and suggestions. It is much appreciated!
I finally got it to update the MSRP. For whatever reason, it would not update until I only passed in the custom attribute in the payload. Here is the Postman request and payload that got it to update the MSRP. You were correct in that when it is successful it returns the product JSON.
/rest/all/V1/products/product_sku
{
"product": {
"custom_attributes": [
{
"attribute_code": "msrp",
"value": "252.58"
}
]
}
}
Regards,
Joe
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: How to update a product's MSRP, MAP & base price via API
Hey @joled,
You can use following API endpoint for update a product usign sku.
- PUT: /V1/products/{sku}
for more info:
https://devdocs.magento.com/swagger/index_22.html#/catalogProductRepositoryV1/catalogProductReposito...
I hope it will help you!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: How to update a product's MSRP, MAP & base price via API
Hi Vimal,
Thanks so much for the suggestion. I will look at products in the docs to see how it is used. I think I will have to use some custom attributes. I will respond with my resolution on this.
Regards,
Joe
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: How to update a product's MSRP, MAP & base price via API
We need to pass attribute code and attribute value.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: How to update a product's MSRP, MAP & base price via API
Hi Vimal,
Unfortunately I am still unable to update MAP or MSRP prices with the /V1/products/{sk} end point. DevDocs says the PUT method for that endpoint creates a product. I am updating.
Have a good one.
Joe
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: How to update a product's MSRP, MAP & base price via API
Hi @joled,
What respone you are getting from the API?
Could you paste here?
Actually in the responce you will get the product json if everything correct. Otherwise it will return the error.
also make sure that you authentication and correct.
For more info check beow stack link .
update-product-api-magento2
You can also check first using the POSTMAN tool.
Example:
update-product-using-rest-api-magento-2/
I hope it will help you!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vimal,
Thank you for your time and suggestions. It is much appreciated!
I finally got it to update the MSRP. For whatever reason, it would not update until I only passed in the custom attribute in the payload. Here is the Postman request and payload that got it to update the MSRP. You were correct in that when it is successful it returns the product JSON.
/rest/all/V1/products/product_sku
{
"product": {
"custom_attributes": [
{
"attribute_code": "msrp",
"value": "252.58"
}
]
}
}
Regards,
Joe