1

The catalog price rule is working in frontend. But when we get the product from REST API, we are getting the original price only.

Example: Product price is 34, we were created catalog rule with 10% for all products, in frontend we are getting both prices 30.26 and 34. But from api, we are getting only 34.

Please help.

API EndPoint:

http://localhost/magento/rest/default/V1/products/24-MB01

Partial Response:
{
  "id": 1,
  "sku": "24-MB01",
  "name": "Joust Duffle Bag",
  "attribute_set_id": 15,
  "price": 34,
  "status": 1,
  "visibility": 4,
  "type_id": "simple",
  "created_at": "2017-01-10 07:50:47",
  "updated_at": "2017-01-10 07:50:47",
  "extension_attributes": [],
  "product_links": [],
  "options": [],
}
  • share your parametrs and rest api call code. Post code – Manthan Dave Feb 15 '17 at 11:52
  • Hi @ManthanDave, Please check the edited content. – Nagarajan Feb 15 '17 at 13:03
2

Special Price is a custom attributes so you will get its details response in Custom Attributes section.

So follow below steps :

  1. Your Api end point should be - http://yourwebsitelink/index.php/rest/default/V1/products/24-MB01/
  2. Pass Authorization Bearer your_access_token in the header
  3. You will get the full response wit details of that product :
  4. So over there at last you will find option "custom_attributes" like below :
"tier_prices": [],
  "custom_attributes": [
    {
      "attribute_code": "description",
      "value": "<p>The sporty Joust Duffle Bag can't be beat"
    },
    {
      "attribute_code": "special_price",
      "value": "30.0000"
    },
    {
      "attribute_code": "special_from_date",
      "value": "2017-02-07 00:00:00"
    },
    {
      "attribute_code": "special_to_date",
      "value": "2017-02-28 00:00:00"
    },
    {
      "attribute_code": "cost",
      "value": "30.0000"
    },
    {
      "attribute_code": "image",
      "value": "/m/b/mb01-blue-0.jpg"
    },
    {
      "attribute_code": "small_image",
      "value": "/m/b/mb01-blue-0.jpg"
    },
    {
      "attribute_code": "thumbnail",
      "value": "/m/b/mb01-blue-0.jpg"
    },
    {
      "attribute_code": "color",
      "value": "49"
    },
    {
      "attribute_code": "news_from_date",
      "value": "2017-02-15 00:00:00"
    },
    {
      "attribute_code": "custom_design_from",
      "value": "2017-02-15 00:00:00"
    },
    {
      "attribute_code": "category_ids",
      "value": [
        "3",
        "4"
      ]
    },
  1. From there you will get attribute_code = special_price and its value
  • Thank you Manthan. But I'm not getting the special_price attribute in my custom attributes. – Nagarajan Feb 16 '17 at 9:56
  • Hi @ManthanDave, Any solution? – Nagarajan Feb 18 '17 at 11:09
  • @Nagarajan i have check with my end II Yes its not working and there is no solution for catalog price rules !! see this link - stackoverflow.com/questions/18801856/… – Manthan Dave Feb 20 '17 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.