Magento rest API configurable product and category list Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Price In Configurable Product is 0 in REST API Response : Magento 2Changing/Modifying Magento 2 Rest Api call from urlHow to get same products from rest api as are visible on frontend?How to show configurable price range on product list page & product page?Magento 2 filter products by price from Rest APIMultiple Filters not working in magetno2 using rest APIHow to set the multi lang storeHow to load another language variables by REST APIMagento 2.3 V1/Search with sortOrders not working in REST APIMagento2 API Filtering Multiple categoriesError on retriving Product List API
Denied boarding although I have proper visa and documentation. To whom should I make a complaint?
Crossing US/Canada Border for less than 24 hours
Does the Weapon Master feat grant you a fighting style?
Did Krishna say in Bhagavad Gita "I am in every living being"
Why aren't air breathing engines used as small first stages?
How could we fake a moon landing now?
Find 108 by using 3,4,6
Source for Esri sample data from 911 Hot Spot Analysis
Significance of Cersei's obsession with elephants?
Do wooden building fires get hotter than 600°C?
Central Vacuuming: Is it worth it, and how does it compare to normal vacuuming?
What do you call the main part of a joke?
How can I reduce the gap between left and right of cdot with a macro?
Why is Nikon 1.4g better when Nikon 1.8g is sharper?
Time to Settle Down!
What does it mean that physics no longer uses mechanical models to describe phenomena?
AppleTVs create a chatty alternate WiFi network
How does light 'choose' between wave and particle behaviour?
Why is it faster to reheat something than it is to cook it?
What is a fractional matching?
Is CEO the "profession" with the most psychopaths?
How do living politicians protect their readily obtainable signatures from misuse?
Can a new player join a group only when a new campaign starts?
How come Sam didn't become Lord of Horn Hill?
Magento rest API configurable product and category list
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Price In Configurable Product is 0 in REST API Response : Magento 2Changing/Modifying Magento 2 Rest Api call from urlHow to get same products from rest api as are visible on frontend?How to show configurable price range on product list page & product page?Magento 2 filter products by price from Rest APIMultiple Filters not working in magetno2 using rest APIHow to set the multi lang storeHow to load another language variables by REST APIMagento 2.3 V1/Search with sortOrders not working in REST APIMagento2 API Filtering Multiple categoriesError on retriving Product List API
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am having a project using Magento rest API V1, I have read through the documentation and looking for the answer around the web but cannot find the solution.
** First: **
I want to show list of configurable products and user will select the size before adding to cart, I am using :
domain/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=has_options&searchCriteria[filterGroups][0][filters][01][value]=1&searchCriteria[pageSize]=10
**The response I get: **
"items": [
"id": 1,
"sku": "AA0001",
"name": "Sample Product",
"attribute_set_id": 1,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
....
,
....
]
The problem is the price is 0, and I only want to show configurable product list.
** Second: **
I want to do a filter by size, color and another attribute for a specific category, how can I get a list of available attributes by category?
Like category_id = 1 and show what sizes are available only for that category.
Thanks in advance
magento2 api rest
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I am having a project using Magento rest API V1, I have read through the documentation and looking for the answer around the web but cannot find the solution.
** First: **
I want to show list of configurable products and user will select the size before adding to cart, I am using :
domain/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=has_options&searchCriteria[filterGroups][0][filters][01][value]=1&searchCriteria[pageSize]=10
**The response I get: **
"items": [
"id": 1,
"sku": "AA0001",
"name": "Sample Product",
"attribute_set_id": 1,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
....
,
....
]
The problem is the price is 0, and I only want to show configurable product list.
** Second: **
I want to do a filter by size, color and another attribute for a specific category, how can I get a list of available attributes by category?
Like category_id = 1 and show what sizes are available only for that category.
Thanks in advance
magento2 api rest
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
To my mind if your logic is specific you need to create your custom API based on the Magento native API. You will have more control to manage the output.
– Franck Garnier
Dec 1 '16 at 7:56
add a comment |
I am having a project using Magento rest API V1, I have read through the documentation and looking for the answer around the web but cannot find the solution.
** First: **
I want to show list of configurable products and user will select the size before adding to cart, I am using :
domain/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=has_options&searchCriteria[filterGroups][0][filters][01][value]=1&searchCriteria[pageSize]=10
**The response I get: **
"items": [
"id": 1,
"sku": "AA0001",
"name": "Sample Product",
"attribute_set_id": 1,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
....
,
....
]
The problem is the price is 0, and I only want to show configurable product list.
** Second: **
I want to do a filter by size, color and another attribute for a specific category, how can I get a list of available attributes by category?
Like category_id = 1 and show what sizes are available only for that category.
Thanks in advance
magento2 api rest
I am having a project using Magento rest API V1, I have read through the documentation and looking for the answer around the web but cannot find the solution.
** First: **
I want to show list of configurable products and user will select the size before adding to cart, I am using :
domain/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=has_options&searchCriteria[filterGroups][0][filters][01][value]=1&searchCriteria[pageSize]=10
**The response I get: **
"items": [
"id": 1,
"sku": "AA0001",
"name": "Sample Product",
"attribute_set_id": 1,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
....
,
....
]
The problem is the price is 0, and I only want to show configurable product list.
** Second: **
I want to do a filter by size, color and another attribute for a specific category, how can I get a list of available attributes by category?
Like category_id = 1 and show what sizes are available only for that category.
Thanks in advance
magento2 api rest
magento2 api rest
edited Dec 21 '17 at 3:51
Amrit Pal Singh
802624
802624
asked Dec 1 '16 at 4:55
HakutsuruHakutsuru
312
312
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 6 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
To my mind if your logic is specific you need to create your custom API based on the Magento native API. You will have more control to manage the output.
– Franck Garnier
Dec 1 '16 at 7:56
add a comment |
To my mind if your logic is specific you need to create your custom API based on the Magento native API. You will have more control to manage the output.
– Franck Garnier
Dec 1 '16 at 7:56
To my mind if your logic is specific you need to create your custom API based on the Magento native API. You will have more control to manage the output.
– Franck Garnier
Dec 1 '16 at 7:56
To my mind if your logic is specific you need to create your custom API based on the Magento native API. You will have more control to manage the output.
– Franck Garnier
Dec 1 '16 at 7:56
add a comment |
2 Answers
2
active
oldest
votes
Here is the REST API call to filter only configurable product:
http://magento2api.com/rest/V1/products?searchCriteria[pageSize]=5&searchCriteria[currentPage]=1&searchCriteria[filterGroups][0][filters][0][field]=type_id&searchCriteria[filterGroups][0][filters][0][value]=configurable&searchCriteria[filterGroups][0][filters][0][conditionType]=eq
postman screen image:

Result:
"items": [
"id": 67,
"sku": "MH01",
"name": "Chaz Kangeroo Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:52",
"updated_at": "2016-09-26 06:45:52",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Ideal for cold-weather training or work outdoors, the Chaz Hoodie promises superior warmth with every wear. Thick material blocks out the wind as ribbed cuffs and bottom band seal in body heat.</p>n<p>• Two-tone gray heather hoodie.<br />• Drawstring-adjustable hood. <br />• Machine wash/dry.</p>"
]
,
"id": 83,
"sku": "MH02",
"name": "Teton Pullover Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>This Teton Pullover Hoodie gives you more than laid-back style. It's equipped with moisture-wicking fabric to keep light and dry inside, especially in chilly-weather workouts. An elasticized hem lets you move about freely.</p>n<p>• Black pullover hoodie.<br />• Soft, brushed interior. <br />• Front hand pockets. <br />• Machine wash/dry.</p>"
]
,
"id": 99,
"sku": "MH03",
"name": "Bruno Compete Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Stay comfortable and stay in the race no matter what the weather's up to. The Bruno Compete Hoodie's water-repellent exterior shields you from the elements, while advanced fabric technology inside wicks moisture to keep you dry.</p>n<p>• Full zip black hoodie pullover. <br />• Adjustable drawstring hood. <br />• Ribbed cuffs/waistband. <br />• Kangaroo pocket. <br />• Machine wash/dry.</p>"
]
,
"id": 115,
"sku": "MH04",
"name": "Frankie Sweatshirt",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>The Frankie Sweatshirt is your best friend at long afternoon stadium stints or winter trailside campsites. The soft fleece fabric keeps you toasty as moisture-wicking technology kicks in when the sun comes out.</p>n<p>• Light green crewneck sweatshirt.<br />• Hand pockets.<br />• Relaxed fit.<br />• Machine wash/dry.</p>"
]
,
"id": 131,
"sku": "MH05",
"name": "Hollister Backyard Sweatshirt",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Kick off your weekend in the Hollister Backyard Sweatshirt. Whether you're raking leaves or flipping burgers, this comfy layer blocks the bite of the crisp autumn air. Puffy thick from hood to hem, it traps heat against your core.</p>n<p>• Cream crewneck sweatshirt with navy sleeves/trim.<br />• Relaxed fit. <br />• Ribbed cuffs and hem. <br />• Machine wash/dry.</p>"
]
],
"search_criteria":
"filter_groups": [
"filters": [
"field": "type_id",
"value": "configurable",
"condition_type": "eq"
]
],
"page_size": 5,
"current_page": 1
,
"total_count": 147
for more attribute change type_id with the atteibute code and value of the attribute for example:
searchCriteria[filterGroups][0][filters][0][field] color
searchCriteria[filterGroups][0][filters][0][value] red
searchCriteria[filterGroups][0][filters][0][conditionType] eq
How to display a real price without 0 ?
– Jsparo30
Aug 20 '17 at 5:56
add a comment |
I know it's an old question, but I hope someone would find it useful.
You need to use another endpoint to get the configurable product price.
/rest/V1/configurable-products/:sku/children
Each product children might be having their own price.
So you need to find a lower price or any reasonable way from the children to display the configurable product price in a category list. Also in default product detail display.
Because each product children might be having different price. You need to get the correct price based on the selected configurable product options.
You can see all the options below the "extension_attributes" -> "configurable_product_options" property or using below endpoint :
/rest/V1/configurable-products/:sku/options/all
To display the options correct values, you need to get all available product attributes using below endpoint :
/rest/V1/products/attributes?searchCriteria[filterGroups][0][filters][0][field]=is_visible&searchCriteria[filterGroups][0][filters][0][value]=1&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[filterGroups][1][filters][0][field]=is_user_defined&searchCriteria[filterGroups][1][filters][0][value]=1&searchCriteria[filterGroups][1][filters][0][conditionType]=eq
Check & modify the query param for your best result. Also by the time I answer this question, you cannot test this endpoint using plain Postman request, you need to pass the Authorization header.
Then display the options based on the "configurable_product_options" property.
I have a problem which I return configurable products in many APIs, So I can't loop on each API to make it custom. Can you check this question magento.stackexchange.com/questions/189724/…
– Jsparo30
Aug 20 '17 at 6:00
I'm also did that for now, because I'm not yet having time to find out where to override the output of this endpoint. But you can start checking the magento/module-catalog/etc/webapi.xml and repositories used there.
– sule
Aug 20 '17 at 10:09
Does any Magento 2 interface or api not leak profusely?
– J. M. Becker
Dec 16 '18 at 19:13
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f148310%2fmagento-rest-api-configurable-product-and-category-list%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here is the REST API call to filter only configurable product:
http://magento2api.com/rest/V1/products?searchCriteria[pageSize]=5&searchCriteria[currentPage]=1&searchCriteria[filterGroups][0][filters][0][field]=type_id&searchCriteria[filterGroups][0][filters][0][value]=configurable&searchCriteria[filterGroups][0][filters][0][conditionType]=eq
postman screen image:

Result:
"items": [
"id": 67,
"sku": "MH01",
"name": "Chaz Kangeroo Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:52",
"updated_at": "2016-09-26 06:45:52",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Ideal for cold-weather training or work outdoors, the Chaz Hoodie promises superior warmth with every wear. Thick material blocks out the wind as ribbed cuffs and bottom band seal in body heat.</p>n<p>• Two-tone gray heather hoodie.<br />• Drawstring-adjustable hood. <br />• Machine wash/dry.</p>"
]
,
"id": 83,
"sku": "MH02",
"name": "Teton Pullover Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>This Teton Pullover Hoodie gives you more than laid-back style. It's equipped with moisture-wicking fabric to keep light and dry inside, especially in chilly-weather workouts. An elasticized hem lets you move about freely.</p>n<p>• Black pullover hoodie.<br />• Soft, brushed interior. <br />• Front hand pockets. <br />• Machine wash/dry.</p>"
]
,
"id": 99,
"sku": "MH03",
"name": "Bruno Compete Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Stay comfortable and stay in the race no matter what the weather's up to. The Bruno Compete Hoodie's water-repellent exterior shields you from the elements, while advanced fabric technology inside wicks moisture to keep you dry.</p>n<p>• Full zip black hoodie pullover. <br />• Adjustable drawstring hood. <br />• Ribbed cuffs/waistband. <br />• Kangaroo pocket. <br />• Machine wash/dry.</p>"
]
,
"id": 115,
"sku": "MH04",
"name": "Frankie Sweatshirt",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>The Frankie Sweatshirt is your best friend at long afternoon stadium stints or winter trailside campsites. The soft fleece fabric keeps you toasty as moisture-wicking technology kicks in when the sun comes out.</p>n<p>• Light green crewneck sweatshirt.<br />• Hand pockets.<br />• Relaxed fit.<br />• Machine wash/dry.</p>"
]
,
"id": 131,
"sku": "MH05",
"name": "Hollister Backyard Sweatshirt",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Kick off your weekend in the Hollister Backyard Sweatshirt. Whether you're raking leaves or flipping burgers, this comfy layer blocks the bite of the crisp autumn air. Puffy thick from hood to hem, it traps heat against your core.</p>n<p>• Cream crewneck sweatshirt with navy sleeves/trim.<br />• Relaxed fit. <br />• Ribbed cuffs and hem. <br />• Machine wash/dry.</p>"
]
],
"search_criteria":
"filter_groups": [
"filters": [
"field": "type_id",
"value": "configurable",
"condition_type": "eq"
]
],
"page_size": 5,
"current_page": 1
,
"total_count": 147
for more attribute change type_id with the atteibute code and value of the attribute for example:
searchCriteria[filterGroups][0][filters][0][field] color
searchCriteria[filterGroups][0][filters][0][value] red
searchCriteria[filterGroups][0][filters][0][conditionType] eq
How to display a real price without 0 ?
– Jsparo30
Aug 20 '17 at 5:56
add a comment |
Here is the REST API call to filter only configurable product:
http://magento2api.com/rest/V1/products?searchCriteria[pageSize]=5&searchCriteria[currentPage]=1&searchCriteria[filterGroups][0][filters][0][field]=type_id&searchCriteria[filterGroups][0][filters][0][value]=configurable&searchCriteria[filterGroups][0][filters][0][conditionType]=eq
postman screen image:

Result:
"items": [
"id": 67,
"sku": "MH01",
"name": "Chaz Kangeroo Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:52",
"updated_at": "2016-09-26 06:45:52",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Ideal for cold-weather training or work outdoors, the Chaz Hoodie promises superior warmth with every wear. Thick material blocks out the wind as ribbed cuffs and bottom band seal in body heat.</p>n<p>• Two-tone gray heather hoodie.<br />• Drawstring-adjustable hood. <br />• Machine wash/dry.</p>"
]
,
"id": 83,
"sku": "MH02",
"name": "Teton Pullover Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>This Teton Pullover Hoodie gives you more than laid-back style. It's equipped with moisture-wicking fabric to keep light and dry inside, especially in chilly-weather workouts. An elasticized hem lets you move about freely.</p>n<p>• Black pullover hoodie.<br />• Soft, brushed interior. <br />• Front hand pockets. <br />• Machine wash/dry.</p>"
]
,
"id": 99,
"sku": "MH03",
"name": "Bruno Compete Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Stay comfortable and stay in the race no matter what the weather's up to. The Bruno Compete Hoodie's water-repellent exterior shields you from the elements, while advanced fabric technology inside wicks moisture to keep you dry.</p>n<p>• Full zip black hoodie pullover. <br />• Adjustable drawstring hood. <br />• Ribbed cuffs/waistband. <br />• Kangaroo pocket. <br />• Machine wash/dry.</p>"
]
,
"id": 115,
"sku": "MH04",
"name": "Frankie Sweatshirt",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>The Frankie Sweatshirt is your best friend at long afternoon stadium stints or winter trailside campsites. The soft fleece fabric keeps you toasty as moisture-wicking technology kicks in when the sun comes out.</p>n<p>• Light green crewneck sweatshirt.<br />• Hand pockets.<br />• Relaxed fit.<br />• Machine wash/dry.</p>"
]
,
"id": 131,
"sku": "MH05",
"name": "Hollister Backyard Sweatshirt",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Kick off your weekend in the Hollister Backyard Sweatshirt. Whether you're raking leaves or flipping burgers, this comfy layer blocks the bite of the crisp autumn air. Puffy thick from hood to hem, it traps heat against your core.</p>n<p>• Cream crewneck sweatshirt with navy sleeves/trim.<br />• Relaxed fit. <br />• Ribbed cuffs and hem. <br />• Machine wash/dry.</p>"
]
],
"search_criteria":
"filter_groups": [
"filters": [
"field": "type_id",
"value": "configurable",
"condition_type": "eq"
]
],
"page_size": 5,
"current_page": 1
,
"total_count": 147
for more attribute change type_id with the atteibute code and value of the attribute for example:
searchCriteria[filterGroups][0][filters][0][field] color
searchCriteria[filterGroups][0][filters][0][value] red
searchCriteria[filterGroups][0][filters][0][conditionType] eq
How to display a real price without 0 ?
– Jsparo30
Aug 20 '17 at 5:56
add a comment |
Here is the REST API call to filter only configurable product:
http://magento2api.com/rest/V1/products?searchCriteria[pageSize]=5&searchCriteria[currentPage]=1&searchCriteria[filterGroups][0][filters][0][field]=type_id&searchCriteria[filterGroups][0][filters][0][value]=configurable&searchCriteria[filterGroups][0][filters][0][conditionType]=eq
postman screen image:

Result:
"items": [
"id": 67,
"sku": "MH01",
"name": "Chaz Kangeroo Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:52",
"updated_at": "2016-09-26 06:45:52",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Ideal for cold-weather training or work outdoors, the Chaz Hoodie promises superior warmth with every wear. Thick material blocks out the wind as ribbed cuffs and bottom band seal in body heat.</p>n<p>• Two-tone gray heather hoodie.<br />• Drawstring-adjustable hood. <br />• Machine wash/dry.</p>"
]
,
"id": 83,
"sku": "MH02",
"name": "Teton Pullover Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>This Teton Pullover Hoodie gives you more than laid-back style. It's equipped with moisture-wicking fabric to keep light and dry inside, especially in chilly-weather workouts. An elasticized hem lets you move about freely.</p>n<p>• Black pullover hoodie.<br />• Soft, brushed interior. <br />• Front hand pockets. <br />• Machine wash/dry.</p>"
]
,
"id": 99,
"sku": "MH03",
"name": "Bruno Compete Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Stay comfortable and stay in the race no matter what the weather's up to. The Bruno Compete Hoodie's water-repellent exterior shields you from the elements, while advanced fabric technology inside wicks moisture to keep you dry.</p>n<p>• Full zip black hoodie pullover. <br />• Adjustable drawstring hood. <br />• Ribbed cuffs/waistband. <br />• Kangaroo pocket. <br />• Machine wash/dry.</p>"
]
,
"id": 115,
"sku": "MH04",
"name": "Frankie Sweatshirt",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>The Frankie Sweatshirt is your best friend at long afternoon stadium stints or winter trailside campsites. The soft fleece fabric keeps you toasty as moisture-wicking technology kicks in when the sun comes out.</p>n<p>• Light green crewneck sweatshirt.<br />• Hand pockets.<br />• Relaxed fit.<br />• Machine wash/dry.</p>"
]
,
"id": 131,
"sku": "MH05",
"name": "Hollister Backyard Sweatshirt",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Kick off your weekend in the Hollister Backyard Sweatshirt. Whether you're raking leaves or flipping burgers, this comfy layer blocks the bite of the crisp autumn air. Puffy thick from hood to hem, it traps heat against your core.</p>n<p>• Cream crewneck sweatshirt with navy sleeves/trim.<br />• Relaxed fit. <br />• Ribbed cuffs and hem. <br />• Machine wash/dry.</p>"
]
],
"search_criteria":
"filter_groups": [
"filters": [
"field": "type_id",
"value": "configurable",
"condition_type": "eq"
]
],
"page_size": 5,
"current_page": 1
,
"total_count": 147
for more attribute change type_id with the atteibute code and value of the attribute for example:
searchCriteria[filterGroups][0][filters][0][field] color
searchCriteria[filterGroups][0][filters][0][value] red
searchCriteria[filterGroups][0][filters][0][conditionType] eq
Here is the REST API call to filter only configurable product:
http://magento2api.com/rest/V1/products?searchCriteria[pageSize]=5&searchCriteria[currentPage]=1&searchCriteria[filterGroups][0][filters][0][field]=type_id&searchCriteria[filterGroups][0][filters][0][value]=configurable&searchCriteria[filterGroups][0][filters][0][conditionType]=eq
postman screen image:

Result:
"items": [
"id": 67,
"sku": "MH01",
"name": "Chaz Kangeroo Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:52",
"updated_at": "2016-09-26 06:45:52",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Ideal for cold-weather training or work outdoors, the Chaz Hoodie promises superior warmth with every wear. Thick material blocks out the wind as ribbed cuffs and bottom band seal in body heat.</p>n<p>• Two-tone gray heather hoodie.<br />• Drawstring-adjustable hood. <br />• Machine wash/dry.</p>"
]
,
"id": 83,
"sku": "MH02",
"name": "Teton Pullover Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>This Teton Pullover Hoodie gives you more than laid-back style. It's equipped with moisture-wicking fabric to keep light and dry inside, especially in chilly-weather workouts. An elasticized hem lets you move about freely.</p>n<p>• Black pullover hoodie.<br />• Soft, brushed interior. <br />• Front hand pockets. <br />• Machine wash/dry.</p>"
]
,
"id": 99,
"sku": "MH03",
"name": "Bruno Compete Hoodie",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Stay comfortable and stay in the race no matter what the weather's up to. The Bruno Compete Hoodie's water-repellent exterior shields you from the elements, while advanced fabric technology inside wicks moisture to keep you dry.</p>n<p>• Full zip black hoodie pullover. <br />• Adjustable drawstring hood. <br />• Ribbed cuffs/waistband. <br />• Kangaroo pocket. <br />• Machine wash/dry.</p>"
]
,
"id": 115,
"sku": "MH04",
"name": "Frankie Sweatshirt",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>The Frankie Sweatshirt is your best friend at long afternoon stadium stints or winter trailside campsites. The soft fleece fabric keeps you toasty as moisture-wicking technology kicks in when the sun comes out.</p>n<p>• Light green crewneck sweatshirt.<br />• Hand pockets.<br />• Relaxed fit.<br />• Machine wash/dry.</p>"
]
,
"id": 131,
"sku": "MH05",
"name": "Hollister Backyard Sweatshirt",
"attribute_set_id": 9,
"price": 0,
"status": 1,
"visibility": 4,
"type_id": "configurable",
"created_at": "2016-09-26 06:45:53",
"updated_at": "2016-09-26 06:45:53",
"extension_attributes": [],
"product_links": [],
"tier_prices": [],
"custom_attributes": [
"attribute_code": "description",
"value": "<p>Kick off your weekend in the Hollister Backyard Sweatshirt. Whether you're raking leaves or flipping burgers, this comfy layer blocks the bite of the crisp autumn air. Puffy thick from hood to hem, it traps heat against your core.</p>n<p>• Cream crewneck sweatshirt with navy sleeves/trim.<br />• Relaxed fit. <br />• Ribbed cuffs and hem. <br />• Machine wash/dry.</p>"
]
],
"search_criteria":
"filter_groups": [
"filters": [
"field": "type_id",
"value": "configurable",
"condition_type": "eq"
]
],
"page_size": 5,
"current_page": 1
,
"total_count": 147
for more attribute change type_id with the atteibute code and value of the attribute for example:
searchCriteria[filterGroups][0][filters][0][field] color
searchCriteria[filterGroups][0][filters][0][value] red
searchCriteria[filterGroups][0][filters][0][conditionType] eq
answered Dec 8 '16 at 10:04
ManishManish
2,02931840
2,02931840
How to display a real price without 0 ?
– Jsparo30
Aug 20 '17 at 5:56
add a comment |
How to display a real price without 0 ?
– Jsparo30
Aug 20 '17 at 5:56
How to display a real price without 0 ?
– Jsparo30
Aug 20 '17 at 5:56
How to display a real price without 0 ?
– Jsparo30
Aug 20 '17 at 5:56
add a comment |
I know it's an old question, but I hope someone would find it useful.
You need to use another endpoint to get the configurable product price.
/rest/V1/configurable-products/:sku/children
Each product children might be having their own price.
So you need to find a lower price or any reasonable way from the children to display the configurable product price in a category list. Also in default product detail display.
Because each product children might be having different price. You need to get the correct price based on the selected configurable product options.
You can see all the options below the "extension_attributes" -> "configurable_product_options" property or using below endpoint :
/rest/V1/configurable-products/:sku/options/all
To display the options correct values, you need to get all available product attributes using below endpoint :
/rest/V1/products/attributes?searchCriteria[filterGroups][0][filters][0][field]=is_visible&searchCriteria[filterGroups][0][filters][0][value]=1&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[filterGroups][1][filters][0][field]=is_user_defined&searchCriteria[filterGroups][1][filters][0][value]=1&searchCriteria[filterGroups][1][filters][0][conditionType]=eq
Check & modify the query param for your best result. Also by the time I answer this question, you cannot test this endpoint using plain Postman request, you need to pass the Authorization header.
Then display the options based on the "configurable_product_options" property.
I have a problem which I return configurable products in many APIs, So I can't loop on each API to make it custom. Can you check this question magento.stackexchange.com/questions/189724/…
– Jsparo30
Aug 20 '17 at 6:00
I'm also did that for now, because I'm not yet having time to find out where to override the output of this endpoint. But you can start checking the magento/module-catalog/etc/webapi.xml and repositories used there.
– sule
Aug 20 '17 at 10:09
Does any Magento 2 interface or api not leak profusely?
– J. M. Becker
Dec 16 '18 at 19:13
add a comment |
I know it's an old question, but I hope someone would find it useful.
You need to use another endpoint to get the configurable product price.
/rest/V1/configurable-products/:sku/children
Each product children might be having their own price.
So you need to find a lower price or any reasonable way from the children to display the configurable product price in a category list. Also in default product detail display.
Because each product children might be having different price. You need to get the correct price based on the selected configurable product options.
You can see all the options below the "extension_attributes" -> "configurable_product_options" property or using below endpoint :
/rest/V1/configurable-products/:sku/options/all
To display the options correct values, you need to get all available product attributes using below endpoint :
/rest/V1/products/attributes?searchCriteria[filterGroups][0][filters][0][field]=is_visible&searchCriteria[filterGroups][0][filters][0][value]=1&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[filterGroups][1][filters][0][field]=is_user_defined&searchCriteria[filterGroups][1][filters][0][value]=1&searchCriteria[filterGroups][1][filters][0][conditionType]=eq
Check & modify the query param for your best result. Also by the time I answer this question, you cannot test this endpoint using plain Postman request, you need to pass the Authorization header.
Then display the options based on the "configurable_product_options" property.
I have a problem which I return configurable products in many APIs, So I can't loop on each API to make it custom. Can you check this question magento.stackexchange.com/questions/189724/…
– Jsparo30
Aug 20 '17 at 6:00
I'm also did that for now, because I'm not yet having time to find out where to override the output of this endpoint. But you can start checking the magento/module-catalog/etc/webapi.xml and repositories used there.
– sule
Aug 20 '17 at 10:09
Does any Magento 2 interface or api not leak profusely?
– J. M. Becker
Dec 16 '18 at 19:13
add a comment |
I know it's an old question, but I hope someone would find it useful.
You need to use another endpoint to get the configurable product price.
/rest/V1/configurable-products/:sku/children
Each product children might be having their own price.
So you need to find a lower price or any reasonable way from the children to display the configurable product price in a category list. Also in default product detail display.
Because each product children might be having different price. You need to get the correct price based on the selected configurable product options.
You can see all the options below the "extension_attributes" -> "configurable_product_options" property or using below endpoint :
/rest/V1/configurable-products/:sku/options/all
To display the options correct values, you need to get all available product attributes using below endpoint :
/rest/V1/products/attributes?searchCriteria[filterGroups][0][filters][0][field]=is_visible&searchCriteria[filterGroups][0][filters][0][value]=1&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[filterGroups][1][filters][0][field]=is_user_defined&searchCriteria[filterGroups][1][filters][0][value]=1&searchCriteria[filterGroups][1][filters][0][conditionType]=eq
Check & modify the query param for your best result. Also by the time I answer this question, you cannot test this endpoint using plain Postman request, you need to pass the Authorization header.
Then display the options based on the "configurable_product_options" property.
I know it's an old question, but I hope someone would find it useful.
You need to use another endpoint to get the configurable product price.
/rest/V1/configurable-products/:sku/children
Each product children might be having their own price.
So you need to find a lower price or any reasonable way from the children to display the configurable product price in a category list. Also in default product detail display.
Because each product children might be having different price. You need to get the correct price based on the selected configurable product options.
You can see all the options below the "extension_attributes" -> "configurable_product_options" property or using below endpoint :
/rest/V1/configurable-products/:sku/options/all
To display the options correct values, you need to get all available product attributes using below endpoint :
/rest/V1/products/attributes?searchCriteria[filterGroups][0][filters][0][field]=is_visible&searchCriteria[filterGroups][0][filters][0][value]=1&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[filterGroups][1][filters][0][field]=is_user_defined&searchCriteria[filterGroups][1][filters][0][value]=1&searchCriteria[filterGroups][1][filters][0][conditionType]=eq
Check & modify the query param for your best result. Also by the time I answer this question, you cannot test this endpoint using plain Postman request, you need to pass the Authorization header.
Then display the options based on the "configurable_product_options" property.
answered May 8 '17 at 7:59
sulesule
1
1
I have a problem which I return configurable products in many APIs, So I can't loop on each API to make it custom. Can you check this question magento.stackexchange.com/questions/189724/…
– Jsparo30
Aug 20 '17 at 6:00
I'm also did that for now, because I'm not yet having time to find out where to override the output of this endpoint. But you can start checking the magento/module-catalog/etc/webapi.xml and repositories used there.
– sule
Aug 20 '17 at 10:09
Does any Magento 2 interface or api not leak profusely?
– J. M. Becker
Dec 16 '18 at 19:13
add a comment |
I have a problem which I return configurable products in many APIs, So I can't loop on each API to make it custom. Can you check this question magento.stackexchange.com/questions/189724/…
– Jsparo30
Aug 20 '17 at 6:00
I'm also did that for now, because I'm not yet having time to find out where to override the output of this endpoint. But you can start checking the magento/module-catalog/etc/webapi.xml and repositories used there.
– sule
Aug 20 '17 at 10:09
Does any Magento 2 interface or api not leak profusely?
– J. M. Becker
Dec 16 '18 at 19:13
I have a problem which I return configurable products in many APIs, So I can't loop on each API to make it custom. Can you check this question magento.stackexchange.com/questions/189724/…
– Jsparo30
Aug 20 '17 at 6:00
I have a problem which I return configurable products in many APIs, So I can't loop on each API to make it custom. Can you check this question magento.stackexchange.com/questions/189724/…
– Jsparo30
Aug 20 '17 at 6:00
I'm also did that for now, because I'm not yet having time to find out where to override the output of this endpoint. But you can start checking the magento/module-catalog/etc/webapi.xml and repositories used there.
– sule
Aug 20 '17 at 10:09
I'm also did that for now, because I'm not yet having time to find out where to override the output of this endpoint. But you can start checking the magento/module-catalog/etc/webapi.xml and repositories used there.
– sule
Aug 20 '17 at 10:09
Does any Magento 2 interface or api not leak profusely?
– J. M. Becker
Dec 16 '18 at 19:13
Does any Magento 2 interface or api not leak profusely?
– J. M. Becker
Dec 16 '18 at 19:13
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f148310%2fmagento-rest-api-configurable-product-and-category-list%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
To my mind if your logic is specific you need to create your custom API based on the Magento native API. You will have more control to manage the output.
– Franck Garnier
Dec 1 '16 at 7:56