"original_price" property in variant object not comming in response from server when using expand #8876
Unanswered
saimarshadsaim31
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am getting the list of products for my store-front and in the list of products i get following properties for each of my variant in variant array by default like this:
{ "id": "prod_01J6CF4SQGFAPEGWXJ1GQF7V15", "created_at": "2024-08-28T12:25:08.576Z", "updated_at": "2024-08-28T12:25:55.255Z", "deleted_at": null, //other properties "variants": [ { "id": "variant_01J6CF4SRA1A2J58ZYQ54G3QJR", //other properties "prices": [ { "id": "ma_01J6CF5Y7QP3XM109VXH5GD9CD", "created_at": "2024-08-28T12:25:45.961Z", "updated_at": "2024-08-28T12:25:45.961Z" //other properties } ], "original_price": null, "calculated_price": null, "original_price_incl_tax": null, "calculated_price_incl_tax": null, "original_tax": null, "calculated_tax": null, "tax_rates": null } ] }
but I also need categories of products but they do not come in response by default so i expand them like this:
http://localhost:9000/store/productsexpand=categories
this does bring categories but now overwrites default expansions (variants, options etc). Now do not come in response so for that i also manually expand them like this:
http://localhost:9000/store/products?expand=categories,variants.prices
which does bring categories, variants and prices array in each variant but these properties still are nowhere to be found:
"original_price": null, "calculated_price": null, "original_price_incl_tax": null, "calculated_price_incl_tax": null, "original_tax": null, "calculated_tax": null, "tax_rates": null
I have tried
variants.orignal_price
but that doesn't seems to works and throws this error:{ "type": "invalid_data", "message": "Requested fields [variants.original_price] are not valid" }
Beta Was this translation helpful? Give feedback.
All reactions