I have recently try to get product final price via rest api.
You can check special_price
is already active and it will 20
but of price are coming 45
it will be 20
.
API URL : http://magento.local/rest/V1/products/24-WB04
Magento Product API response.
{
"id": 14,
"sku": "24-WB04",
"name": "Push It Messenger Bag",
"attribute_set_id": 15,
"price": 45,
"status": 1,
"visibility": 4,
"type_id": "simple",
"created_at": "2018-12-31 05:48:58",
"updated_at": "2019-01-25 04:55:39",
"extension_attributes": {
"website_ids": [1],
"category_links": [{
"position": 0,
"category_id": "3"
}, {
"position": 0,
"category_id": "7"
}, {
"position": 0,
"category_id": "4"
}]
},
"product_links": [{
"sku": "24-WB04",
"link_type": "crosssell",
"linked_product_sku": "24-WG082-pink",
"linked_product_type": "simple",
"position": 1
}, {
"sku": "24-WB04",
"link_type": "crosssell",
"linked_product_sku": "24-UG05",
"linked_product_type": "simple",
"position": 2
}, {
"sku": "24-WB04",
"link_type": "crosssell",
"linked_product_sku": "24-UG02",
"linked_product_type": "simple",
"position": 3
}, {
"sku": "24-WB04",
"link_type": "crosssell",
"linked_product_sku": "24-UG06",
"linked_product_type": "simple",
"position": 4
}, {
"sku": "24-WB04",
"link_type": "upsell",
"linked_product_sku": "24-MB02",
"linked_product_type": "simple",
"position": 1
}, {
"sku": "24-WB04",
"link_type": "upsell",
"linked_product_sku": "24-UB02",
"linked_product_type": "simple",
"position": 2
}],
"options": [],
"media_gallery_entries": [{
"id": 18,
"media_type": "image",
"label": "Image",
"position": 1,
"disabled": false,
"types": ["image", "small_image", "thumbnail"],
"file": "\/w\/b\/wb04-blue-0.jpg"
}],
"tier_prices": [],
"custom_attributes": [{
"attribute_code": "image",
"value": "\/w\/b\/wb04-blue-0.jpg"
}, {
"attribute_code": "small_image",
"value": "\/w\/b\/wb04-blue-0.jpg"
}, {
"attribute_code": "special_price",
"value": "20.0000"
}, {
"attribute_code": "thumbnail",
"value": "\/w\/b\/wb04-blue-0.jpg"
}, {
"attribute_code": "special_from_date",
"value": "2019-01-25 04:55:39"
}, {
"attribute_code": "options_container",
"value": "container2"
}, {
"attribute_code": "msrp_display_actual_price_type",
"value": "0"
}, {
"attribute_code": "url_key",
"value": "push-it-messenger-bag"
}, {
"attribute_code": "gift_message_available",
"value": "0"
}, {
"attribute_code": "gst_origin",
"value": "533"
}, {
"attribute_code": "required_options",
"value": "0"
}, {
"attribute_code": "has_options",
"value": "0"
}, {
"attribute_code": "image_label",
"value": "Image"
}, {
"attribute_code": "small_image_label",
"value": "Image"
}, {
"attribute_code": "thumbnail_label",
"value": "Image"
}, {
"attribute_code": "tax_class_id",
"value": "2"
}, {
"attribute_code": "category_ids",
"value": ["3", "7", "4"]
}, {
"attribute_code": "description",
"value": "<p>The name says so, but the Push It Messenger Bag is much more than a busy commuter's tote. It's a closet away from home when you're pedaling from class or work to gym and back or home again. It's the perfect size and shape for laptop, folded clothes, even extra shoes.<\/p>\r\n<ul>\r\n<li>Adjustable crossbody strap.<\/li>\r\n<li>Top handle.<\/li>\r\n<li>Zippered interior pocket.<\/li>\r\n<li>Secure clip closures.<\/li>\r\n<li>Durable fabric construction.<\/li>\r\n<\/ul>"
}, {
"attribute_code": "activity",
"value": "20,23,8"
}, {
"attribute_code": "style_bags",
"value": "27,28"
}, {
"attribute_code": "material",
"value": "37,38"
}, {
"attribute_code": "color",
"value": "49"
}, {
"attribute_code": "strap_bags",
"value": "61,62,63,65,66,67"
}, {
"attribute_code": "features_bags",
"value": "74,75,78,79"
}, {
"attribute_code": "eco_collection",
"value": "0"
}, {
"attribute_code": "performance_fabric",
"value": "1"
}, {
"attribute_code": "erin_recommends",
"value": "0"
}, {
"attribute_code": "new",
"value": "0"
}, {
"attribute_code": "sale",
"value": "0"
}]
}
Is there any function or plugin where I can set product final price and put it into response ?